3 # This script is used to generate the distribution tarball
6 top_srcdir=@top_srcdir@
7 top_dir=`cd $top_srcdir; pwd`
8 base_ver=`echo @E2FSPROGS_PKGVER@`
9 base_rel=`echo @E2FSPROGS_PKGREL@`
10 base_e2fsprogs=`basename $top_dir`
11 exclude=/tmp/exclude$$
15 # This hack is needed because texi2dvi blows up horribly if there are
16 # any '~' characters in the directory pathname. So we kludge around it by
17 # using a non-standard directory name for WIP releases. dpkg-source
18 # complains, but life goes on.
20 deb_pkgver="$base_ver${base_rel:+-$base_rel}"
24 SRCROOT="e2fsprogs-$deb_pkgver"
25 tarout="e2fsprogs_$deb_pkgver.orig.tar.gz"
28 SRCROOT="e2fsprogs-$base_ver"
29 tarout="$SRCROOT.tar.gz"
33 if test -z "$SOURCE_DATE_EPOCH" ; then
34 export SOURCE_DATE_EPOCH=$(cd $top_srcdir; git log -1 --pretty=%ct)
37 (cd $top_srcdir/.. ; find $base_e2fsprogs \( -name \*~ -o -name \*.orig \
38 -o -name CVS -o -name \*.rej -o -name Makefile.pq \
39 -o -name TAGS -o -name \*.old -o -name SCCS \
40 -o -name changed-files -o -name .#\* -o -name \*.tar.gz \
41 -o -name autom4te.cache \) \
43 sed -e "s;^;$base_e2fsprogs/;" < $srcdir/all.exclude >> $exclude
45 (cd $top_srcdir/.. ; \
46 tar -c -f - -X $exclude --sort=name --owner=0 --group=0 \
47 --transform "flags=r;s|^$base_e2fsprogs|$SRCROOT|" \
48 --numeric-owner --mtime="@${SOURCE_DATE_EPOCH}" $base_e2fsprogs) \
49 | $GZIP -9n -c > $tarout