Whamcloud - gitweb
libext2fs: move the alignment field from unix_io to the io_manager
[tools/e2fsprogs.git] / util / gen-tarball.in
index 8365df1..b82f12c 100644 (file)
@@ -8,17 +8,20 @@ top_dir=`cd $top_srcdir; pwd`
 base_ver=`echo @E2FSPROGS_VERSION@ | sed -e 's/-WIP//' -e 's/pre-//' -e 's/-PLUS//'`
 base_e2fsprogs=`basename $top_dir`
 exclude=/tmp/exclude
+GZIP=gzip
 
-deb_pkgver=`echo @E2FSPROGS_PKGVER@ | sed -e 's/_/-/g'`
-echo Debian package $deb_pkgver
+#
+# This hack is needed because texi2dvi blows up horribly if there are 
+# any '~' chracters in the directory pathname.  So we kludge around it by
+# using a non-standard directory name for WIP releases.  dpkg-source
+# complains, but life goes on.
+#
+deb_pkgver=`echo @E2FSPROGS_PKGVER@ | sed -e 's/~/-/g'`
     
 case $1 in
-    debian)
-       SRCROOT="e2fsprogs-$deb_pkgver+dfsg"
-       list=debian
-       ;;
-    ubuntu)
+    debian|ubuntu)
        SRCROOT="e2fsprogs-$deb_pkgver"
+       rename_tarball="e2fsprogs_@E2FSPROGS_PKGVER@.orig.tar.gz"
        list=all
        ;;
     subset)
@@ -40,10 +43,14 @@ mv ../e2fsprogs.spec $top_srcdir/e2fsprogs.spec
                -print) | sed -e "s/^$base_e2fsprogs/$SRCROOT/" > $exclude
 sed -e "s;^;$SRCROOT/;" < $srcdir/$list.exclude >> $exclude
 
-(cd $top_srcdir/.. ; rm -f $SRCROOT ; ln -sf e2fsprogs $SRCROOT)
+(cd $top_srcdir/.. ; rm -f $SRCROOT ; ln -sf $base_e2fsprogs $SRCROOT)
 
 (cd $top_srcdir/.. ; tar -c -h -v -f - -X $exclude $SRCROOT) \
-        | gzip -9 > $SRCROOT.tar.gz
+        | $GZIP -9 -c > $SRCROOT.tar.gz
+$GZIP -l $SRCROOT.tar.gz
 
 (cd $top_srcdir/.. ; rm -f $SRCROOT)
 mv $top_srcdir/e2fsprogs.spec ../e2fsprogs.spec 
+if test -n "$rename_tarball"; then
+    mv $SRCROOT.tar.gz $rename_tarball
+fi