exclude git specific files from the distribution tarballs
[citadel.git] / citadel / buildpackages
index f1ae0097f41f02451070ea747da53ca6b9fa12b0..2a027858babeb1006e7a41a3023fa75cfd4ca787 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # find out the package version from conf
-if test -x Makefile; then
-    make clean
+if test -f Makefile; then
+    make distclean
 fi
 
 ./bootstrap
@@ -12,6 +12,8 @@ PACKAGE_VERSION=`cat packageversion`
 DATE=`date '+%a, %d %b %Y %H:%I:00 %z'`
 ACTUAL_DIR=`pwd`
 
+
+rm -rf debian/citadel-client debian/citadel-common debian/citadel-doc debian/citadel-mta debian/citadel-server debian/citadel-suite debian/tmp
 if echo "$ACTUAL_DIR" |grep -q "$CITADEL_VERSION"; then
        echo "directory ($ACTUAL_DIR) naming scheme seems right. nothing done."
 else
@@ -27,8 +29,7 @@ else
        fi
        if test "$done" = "false"; then 
                cd ..
-               mv -- $SYMLINK "citadel-$CITADEL_VERSION"
-               ln -sf "citadel-$CITADEL_VERSION" citadel
+               ln -sf citadel "citadel-$CITADEL_VERSION"
                cd "citadel-$CITADEL_VERSION"
        else
                cd "../citadel-$CITADEL_VERSION"
@@ -42,19 +43,22 @@ case $1 in
        if grep -q "($CITADEL_VERSION" debian/changelog; then
            echo rebuilding package.
        else
-           echo "citadel (${CITADEL_VERSION}-${PACKAGE_VERSION}) unstable; urgency=low
-
-  * update to actual Citadel SVN. many new features. see Packages changelog.
-
- -- Wilfried Goesgens <citadel@outgesourced.org>  $DATE
-
-" >/tmp/citadel_changelog
-           cat debian/changelog >>/tmp/citadel_changelog
-           mv /tmp/citadel_changelog debian/changelog
+           echo "Upstream Version higher than local."
            
        fi
        if test "$2" == "src"; then
-           cd ..; dpkg-source -b "citadel-$CITADEL_VERSION"
+           cd ..
+           rm -rf tmp
+           mkdir tmp
+           cp -rL citadel-$CITADEL_VERSION tmp
+           cd tmp/citadel-$CITADEL_VERSION
+           rm -rf `find -name .svn ` svn*tmp config.log config.status
+           find -type f -exec chmod a-x {} \;
+           chmod a+x configure *.sh *.sh.in debian/rules debian/*inst* debian/rules mkinstalldirs
+           cd ..
+           tar -chzf citadel_${CITADEL_VERSION}.orig.tar.gz citadel-${CITADEL_VERSION}/ --exclude "debian/*"
+           pwd
+           cd  citadel-${CITADEL_VERSION}; debuild -S -sa -kw.goesgens@outgesourced.org
        else
            fakeroot dpkg-buildpackage
        fi
@@ -77,7 +81,6 @@ EMAIL=citadel@outgesourced.org
        ./configure \
            --with-db=/opt/csw/bdb44 \
            --with-ical=/usr/local/ \
-           --without-curses \
            --with-prefix=/opt/csw/ \
            --with-datadir=/opt/csw/var/lib/citadel \
            --with-sysconfdir=/opt/csw/etc/citadel \
@@ -97,7 +100,7 @@ EMAIL=citadel@outgesourced.org
 
        ;;
     sourcedist)
-       cd ..; tar --exclude .svn -cvzf citadel-$CITADEL_VERSION.tgz citadel-$CITADEL_VERSION/
+       cd ..; tar --exclude .gitignore --exclude "debian/*" -chvzf citadel-$CITADEL_VERSION.tar.gz citadel-$CITADEL_VERSION/
        ;;
        *)
                echo "Not yet implemented. we have: debian "