Whamcloud - gitweb
LU-14953 e2fsck: pfsck progress report
[tools/e2fsprogs.git] / util / gen-tarball.in
1 #!/bin/sh
2 #
3 # This script is used to generate the distribution tarball
4 #
5 srcdir=@srcdir@
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$$
12 GZIP=gzip
13
14 #
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.
19 #
20 deb_pkgver="$base_ver${base_rel:+-$base_rel}"
21     
22 case $1 in
23     debian|ubuntu)
24         SRCROOT="e2fsprogs-$deb_pkgver"
25         tarout="e2fsprogs_$deb_pkgver.orig.tar.gz"
26         ;;
27    all|*)
28         SRCROOT="e2fsprogs-$base_ver"
29         tarout="$SRCROOT.tar.gz"
30         ;;
31 esac
32
33 if test -z "$SOURCE_DATE_EPOCH" ; then
34     export SOURCE_DATE_EPOCH=$(cd $top_srcdir; git log -1 --pretty=%ct)
35 fi
36
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 \) \
42                 -print) > $exclude
43 sed -e "s;^;$base_e2fsprogs/;" < $srcdir/all.exclude >> $exclude
44
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
50 $GZIP -ln $tarout
51 rm -f "$exclude"