build: remove autoconf generated files
[dahdi/tools.git] / build_tools / make_dist
1 #! /bin/sh
2
3 if [ "$#" -ne 2 ]; then
4         echo >&2 "Usage: $0 <package> <version>"
5         exit 1
6 fi
7 package="$1"
8 version="$2"
9 tarball_prefix="$package-$version"
10 echo "I: Making dist tarball for $tarball_prefix"
11 tarball_name="$tarball_prefix.tar.gz"
12
13 tmp_work_dir=".tmp"
14 tmp_version_dir="$tmp_work_dir/$tarball_prefix"
15
16 if [ "$DESTDIR" != '' ]; then
17         destdir="$DESTDIR/"
18 fi
19 output="$destdir$tarball_name"
20
21 mkdir -p "$tmp_version_dir"
22 git archive --format tar HEAD | tar xf - -C "$tmp_version_dir"
23 echo "$version" > "$tmp_version_dir/.version"
24 extra_dist='
25         autoconfig.h.in
26         configure
27         '
28 find $extra_dist | cpio -pudmv "$tmp_version_dir"
29 tar czf "$output" -C "$tmp_work_dir" "$tarball_prefix"
30 rm -rf "$tmp_work_dir"
31 echo "I: tarball is ready: '$output'"