exclude git specific files from the distribution tarballs
[citadel.git] / libcitadel / buildpackages
index 84cf56ac201f3cde9482e2ef4005a54e572547b8..7b16b6fde2d5e4e93c1fcefafbd219479da8817a 100755 (executable)
@@ -8,7 +8,6 @@ fi
 
 export `grep PACKAGE_VERSION= configure |sed -e "s;';;g" -e "s;PACKAGE;LIBCITADEL;"`
 
-PACKAGE_VERSION=`cat packageversion`
 DATE=`date '+%a, %d %b %Y %H:%I:00 %z'`
 ACTUAL_DIR=`pwd`
 
@@ -21,7 +20,7 @@ else
        if test -L "$ACTUAL_DIR"; then 
                SYMLINK_=`pwd`
                SYMLINK=`ls -l $SYMLINK_|sed "s;.*-> ;;"`
-               if ls -l $SYMLINK_|grep -q "$LIBCITADEL_VERSION"; then
+               if ls -l $SYMLINK|grep -q "$LIBCITADEL_VERSION"; then
                        done=true
                fi
        else
@@ -29,8 +28,7 @@ else
        fi
        if test "$done" = "false"; then 
                cd ..
-               mv -- $SYMLINK "libcitadel-$LIBCITADEL_VERSION"
-               ln -sf "libcitadel-$LIBCITADEL_VERSION" libcitadel
+               ln -sf libcitadel "libcitadel-$LIBCITADEL_VERSION" 
                cd "libcitadel-$LIBCITADEL_VERSION"
        else
                cd "../libcitadel-$LIBCITADEL_VERSION"
@@ -53,7 +51,7 @@ case $1 in
            mkdir tmp
            cp -rL libcitadel-$LIBCITADEL_VERSION tmp
            cd tmp/libcitadel-$LIBCITADEL_VERSION
-           rm -rf `find -name .svn ` svn*tmp config.log config.status
+           rm -rf `find -name .svn ` svn*tmp config.log config.status `find -name .libs`
            find -type f -exec chmod a-x {} \;
            chmod a+x configure
            cd ..
@@ -102,9 +100,19 @@ EMAIL=citadel@outgesourced.org
 
        ;;
     sourcedist)
-       cd ..; tar --exclude .svn --exclude "debian/*" -chvzf libcitadel-$LIBCITADEL_VERSION.tar.gz libcitadel-$LIBCITADEL_VERSION/
+       cd ..; tar --exclude .svn \
+           --exclude ".gitignore" \
+           --exclude .libs \
+           --exclude "*.lo" \
+           --exclude "*.o" \
+           --exclude "*.d" \
+           --exclude "debian/*" \
+           --exclude "sysdep.h" \
+           --exclude tests/testdata \
+           \
+           -chvzf libcitadel-$LIBCITADEL_VERSION.tar.gz libcitadel-$LIBCITADEL_VERSION/
        ;;
        *)
-               echo "Not yet implemented. we have: debian "
+               echo "Not yet implemented. we have: debian, sourcedist "
                ;;
 esac