r23795: more v2->v3 conversion
[Samba/bb.git] / make-tarball.sh
blobc57f01dc790fcf9e894f4e4de52c268a1e0a33b9
1 #!/bin/sh
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 [nodocs]
9 NODOCS=0
10 if [ x"$1" = x"nodocs" ] ; then
11 NODOCS=1
12 echo Not including docs.
15 DOCSDIR=../samba-docs/
16 USING_SAMBA=../using_samba/
17 SRCDIR=`pwd`
19 if [ $NODOCS -eq 0 ]; then
20 if [ ! -d $USING_SAMBA ]; then
22 echo Cannot find "Using Samba" directory \(assuming $USING_SAMBA\).
23 echo Please set the USING_SAMBA variable in this script to the correct
24 echo location. The html files are available in the using_samba CVS
25 echo module on cvs.samba.org. See http://cvs.samba.org/ for details
26 echo about anonymous CVS access. Exiting now....
28 exit 1
32 if [ ! -d $DOCSDIR ]; then
34 echo Cannot find samba-docs \(assuming $DOCSDIR\).
35 echo Please set the DOCSDIR variable in this script
36 echo to the correct path.
38 exit 1
43 ( cd source ; sh script/mkversion.sh )
44 VERSION=`grep SAMBA_VERSION_OFFICIAL_STRING source/include/version.h | cut -d\" -f2 | sed 's/ /_/g'`
45 TARBALLDIR=/tmp/samba-$VERSION
47 echo Creating the tarball source directory in $TARBALLDIR
49 /bin/rm -rf $TARBALLDIR
50 /bin/rm -f samba-$VERSION.tar
52 mkdir $TARBALLDIR
53 rsync -aC ./ $TARBALLDIR
54 /bin/rm -rf $TARBALLDIR/docs/*
55 if [ $NODOCS -eq 0 ]; then
56 rsync -aC $DOCSDIR/ $TARBALLDIR/docs/
57 rsync -aC $USING_SAMBA $TARBALLDIR/docs/htmldocs/
60 echo Creating packaging scripts...
61 ( cd $TARBALLDIR/packaging; sh bin/update-pkginfo $VERSION 1 )
63 echo Creating source/configure...
64 ( cd $TARBALLDIR/source; ./autogen.sh )
66 echo Making tarball samba-$VERSION.tar in current directory...
67 ( cd `dirname $TARBALLDIR`; tar cf $SRCDIR/samba-$VERSION.tar samba-$VERSION )