* Set all version numbers to 7.41 for upcoming beta.
[citadel.git] / webcit / buildpackages
blobef0763a4bd7d8cf32b519d973a3126880b782b69
1 #!/bin/bash
2 if test -x Makefile; then
3 make clean
4 fi
5 ./bootstrap
6 export `grep PACKAGE_VERSION= configure |sed -e "s;';;g" -e "s;PACKAGE;WEBCIT;"`
8 PACKAGE_VERSION=`cat packageversion`
9 DATE=`date '+%a, %d %b %Y %H:%I:00 %z'`
10 ACTUAL_DIR=`pwd`
13 rm -rf debian/citadel-webcit debian/tmp/
14 if echo "$ACTUAL_DIR" |grep -q "$WEBCIT_VERSION"; then
15 echo "directory ($ACTUAL_DIR) naming scheme seems right. nothing done."
16 else
17 done=false
18 if test -L "$ACTUAL_DIR"; then
19 SYMLINK_=`pwd`
20 SYMLINK=`ls -l $SYMLINK_|sed "s;.*-> ;;"`
21 if ls -l $SYMLINK_|grep -q "$WEBCIT_VERSION"; then
22 done=true
24 else
25 SYMLINK=`pwd|sed "s;.*/;;"`
27 if test "$done" = "false"; then
28 cd ..
29 mv -- $SYMLINK "webcit-$WEBCIT_VERSION"
30 ln -sf "webcit-$WEBCIT_VERSION" webcit
31 cd "webcit-$WEBCIT_VERSION"
32 else
33 cd "../webcit-$WEBCIT_VERSION"
38 case $1 in
39 debian)
40 if grep -q "($WEBCIT_VERSION" debian/changelog; then
41 echo rebuilding package.
42 else
43 echo "Upstream Version higher than local."
45 if test "$2" == "src"; then
46 cd ..
47 rm -rf tmp
48 mkdir tmp
49 cp -rL webcit-$WEBCIT_VERSION tmp
50 cd tmp/webcit-$WEBCIT_VERSION
51 rm -rf `find -name .svn ` svn*tmp* build-stamp configure-stamp *~ config.guess config.log config.status autom4te.cache
52 find -type f -exec chmod a-x {} \;
53 chmod a+x configure debian/rules po/create-pot.sh
54 cd ..
55 tar -chzf webcit_${WEBCIT_VERSION}.orig.tar.gz webcit-${WEBCIT_VERSION}/ --exclude "debian/*"
56 pwd
57 cd webcit-${WEBCIT_VERSION}; debuild -S -sa -kw.goesgens@outgesourced.org
58 else
59 fakeroot dpkg-buildpackage
62 sourcedist)
63 if test "$2" == "dfsg"; then
64 NONDFSG=-"-exclude static/openid-small.gif"
66 cd ..; tar --exclude .svn --exclude "debian/*" $NONDFSG -cvhzf webcit-${WEBCIT_VERSION}.tar.gz webcit-${WEBCIT_VERSION}/
69 echo "Not yet implemented. we have: debian "
71 esac