Utility for making Debian orig tar.gz's.
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 24 Mar 2010 14:48:33 +0000 (15:48 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 24 Mar 2010 14:48:33 +0000 (15:48 +0100)
id-deb-build/id-mk-dist.sh [new file with mode: 0755]

diff --git a/id-deb-build/id-mk-dist.sh b/id-deb-build/id-mk-dist.sh
new file mode 100755 (executable)
index 0000000..6ab0876
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+if test ! -f debian/changelog; then
+       echo "debian/changelog not found"
+       exit 1
+fi
+PRODUCT=`head -1 debian/changelog |awk '{print $1}'`
+if test ! -f IDMETA; then
+       echo "VERSION not found in current directory"
+       exit 1
+fi
+. ./IDMETA
+for f in debian/*; do
+       if test -d $f; then
+               echo "Removing $f"
+               rm -r $f
+       fi
+done
+git log >ChangeLog
+rm -f dist.tar ${PRODUCT}-*.tar.gz ${PRODUCT}-${VERSION}
+tar cv --exclude='*~' --exclude='.*' -f dist.tar *
+mkdir $PRODUCT-$VERSION
+(cd $PRODUCT-$VERSION; tar xf ../dist.tar)
+for f in .gitignore debian; do
+       (cd $PRODUCT-$VERSION; rm -fr $f)
+done
+tar zcvf $PRODUCT-$VERSION.tar.gz $PRODUCT-$VERSION
+rm -fr $PRODUCT-$VERSION dist.tar
+