-
Notifications
You must be signed in to change notification settings - Fork 0
/
DIST
executable file
·43 lines (35 loc) · 1.08 KB
/
DIST
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
#!/bin/sh
#
# A helper script for developers.
# ./DIST gen : runs autoconf to generate 'configure' script.
# ./DIST tgz : creates a tarball.
# Assumes gnu tar.
MODULE=paradoc
while [ $# -gt 0 ]; do
case $1 in
gen) gen=yes; shift ;;
tgz) tgz=yes; shift ;;
*) echo "DIST gen|tgz"; exit 0;;
esac
done
if [ "$gen" = "yes" ]; then
autoconf
fi
if [ "$tgz" = "yes" ]; then
if [ -f Makefile ]; then make maintainer-clean; fi
if [ -f configure.ac ]; then ./DIST gen; fi
./configure
make distclean
if [ ! -f VERSION ]; then echo "No VERSION; something wrong?"; exit 1; fi
VERSION=`cat VERSION`
rm -f DIST_EXCLUDE_X
echo DIST > DIST_EXCLUDE_X
echo DIST_EXCLUDE_X >> DIST_EXCLUDE_X
if [ -f DIST_EXCLUDE ]; then cat DIST_EXCLUDE >> DIST_EXCLUDE_X; fi
find . \( -name CVS -o -name .svn -o -name .git \) -print -prune >> DIST_EXCLUDE_X
rm -rf ../$MODULE-$VERSION
mkdir ../$MODULE-$VERSION
tar cvfX - DIST_EXCLUDE_X . | (cd ../$MODULE-$VERSION; tar xf -)
(cd ..; tar cvf - $MODULE-$VERSION | gzip -9 > $MODULE-$VERSION.tgz)
(cd ..; rm -rf $MODULE-$VERSION)
fi