aboutsummaryrefslogtreecommitdiffstats
path: root/bs/mkdist.sh
blob: 130871345e9904db18d2969b1271e5b8cd06c4b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
set -e
. bs/pkginfo.sh
head=${1-'HEAD'}
git_ver=
if git rev-parse --git-dir > /dev/null 2>&1; then
	git_ver=`git describe $head`
	git_ver=`expr "z$git_ver" : 'z.*\(-g[0-9a-f].*\)' || true`
	if test -n "$git_ver"; then
		dirty=`git diff-index --name-only HEAD 2>/dev/null || true`
		if test -n "$dirty"; then
			git_ver=$git_ver-dirty
		fi
	fi
fi

v=$v$git_ver
dir=$O/$p-$v
rm -rf "$dir"
git tar-tree $head $dir | tar x

at_files='
Makefile.in
aclocal.m4
compile
config.guess
config.h.in
config.sub
configure
depcomp
doc/Makefile.in
install-sh
ltmain.sh
missing
mkinstalldirs
src/Makefile.in
src/mp4ff/Makefile.in
'

for i in $at_files; do
	if test -f $i; then
		echo cp $i $dir/$i
		cp $i $dir/$i
	fi
done

cd $O
tar c $p-$v | gzip -9 > $p-$v.tar.gz
rm -rf $p-$v
echo "Generated tarball in: $p-$v.tar.gz"