BUG 758 -- patch from jpeach@sgi.com (James Peach); fix pdma build
[ira/wip.git] / make-tarball.sh
1 #!/bin/sh
2
3 ## A simple script to build a tarball of the current CVS tree.
4 ## You either need to include the using_samba cvs module in the
5 ## parent directory or tell the script where to find it 
6 ##
7 ## Usgae:  ./make-tarball.sh
8
9 DOCSDIR=../samba-docs/
10 USING_SAMBA=../using_samba/
11 SRCDIR=`pwd`
12
13 if [ ! -d $USING_SAMBA ]; then
14
15         echo Cannot find "Using Samba" directory \(assuming $USING_SAMBA\).  
16         echo Please set the USING_SAMBA variable in this script to the correct
17         echo location.  The html files are available in the using_samba CVS 
18         echo module on cvs.samba.org.  See http://cvs/samba.org/ for details 
19         echo about anonymous CVS access.  Exiting now....
20
21         exit 1
22
23 fi
24
25 if [ ! -d $DOCSDIR ]; then
26
27         echo Cannot find samba-docs \(assuming $DOCSDIR\).
28         echo Please set the DOCSDIR variable in this script 
29         echo to the correct path.
30
31         exit 1
32
33 fi
34
35
36 VERSION=`grep SAMBA_VERSION_OFFICIAL_STRING source/include/version.h | cut -d\" -f2 | sed 's/ /_/g'`
37 TARBALLDIR=/tmp/samba-$VERSION
38
39 echo Creating the tarball source directory in $TARBALLDIR
40
41 /bin/rm -rf $TARBALLDIR
42 /bin/rm -f samba-$VERSION.tar
43
44 mkdir $TARBALLDIR
45 rsync -aC ./ $TARBALLDIR
46 /bin/rm -rf $TARBALLDIR/docs/*
47 rsync -aC $DOCSDIR/ $TARBALLDIR/docs/ 
48 rsync -aC $USING_SAMBA $TARBALLDIR/docs/htmldocs/
49
50 echo Creating packaging scripts...
51 ( cd $TARBALLDIR/packaging; sh bin/update-pkginfo $VERSION 1 )
52
53 echo Creating source/configure...
54 ( cd $TARBALLDIR/source; ./autogen.sh )
55
56 echo Making tarball samba-$VERSION.tar in current directory...
57 ( cd `dirname $TARBALLDIR`; tar cf $SRCDIR/samba-$VERSION.tar samba-$VERSION )