New file mkdist.sh, copied from mkadmin/mkdist.sh
authorMike Taylor <mike@miketaylor.org.uk>
Mon, 12 Jul 2010 16:14:30 +0000 (17:14 +0100)
committerMike Taylor <mike@miketaylor.org.uk>
Mon, 12 Jul 2010 16:14:30 +0000 (17:14 +0100)
mkdist.sh [new file with mode: 0755]

diff --git a/mkdist.sh b/mkdist.sh
new file mode 100755 (executable)
index 0000000..9bcb7ad
--- /dev/null
+++ b/mkdist.sh
@@ -0,0 +1,16 @@
+# Creates a distribution tarball of the kind that Debian packages are
+# made from.
+DEBCHANGELOG=debian/changelog
+
+l=`head -1 $DEBCHANGELOG`
+NAME=`echo $l|sed 's/ .*//g'`
+FULLVERSION=`echo $l|sed 's/.*(//g'|sed 's/).*//g'`
+VERSION=`echo $FULLVERSION|sed 's/-.*//g'`
+
+git archive --format=tar --prefix=$NAME-$VERSION/ HEAD > $NAME-$VERSION.tar
+tar xf $NAME-$VERSION.tar
+rm -r $NAME-$VERSION/debian
+rm -r $NAME-$VERSION/archive
+tar cfz $NAME-$VERSION.tar.gz $NAME-$VERSION
+rm $NAME-$VERSION.tar
+rm -r $NAME-$VERSION