automake: add basic libtool support
[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         ppp/Makefile
28         Makefile
29         xpp/Makefile
30         ppp/Makefile.in
31         Makefile.in
32         xpp/Makefile.in
33         xpp/oct612x/Makefile.in
34         auxdir/compile
35         auxdir/config.guess
36         auxdir/config.sub
37         auxdir/depcomp
38         auxdir/install-sh
39         auxdir/ltmain.sh
40         auxdir/missing
41         m4/libtool.m4
42         m4/ltoptions.m4
43         m4/ltsugar.m4
44         m4/ltversion.m4
45         m4/lt~obsolete.m4
46         '
47 find $extra_dist | cpio -pudmv "$tmp_version_dir"
48 tar czf "$output" -C "$tmp_work_dir" "$tarball_prefix"
49 rm -rf "$tmp_work_dir"
50 echo "I: tarball is ready: '$output'"