dist.sh 1.98 KB
Newer Older
Vivien Kraus's avatar
Vivien Kraus committed
1
2
3
4
#!/bin/sh

apt-get update
apt-get upgrade -y 
Vivien Kraus's avatar
Vivien Kraus committed
5
apt-get install -y --no-install-recommends texlive-base texlive-latex-base git ca-certificates texlive-fonts-recommended texlive-generic-recommended autoconf automake gettext autopoint libtool texinfo gnulib autoconf-archive make gcc flex bison gperf emacs org-mode indent check gengetopt help2man libreadline-dev libunistring-dev valgrind autogen libuile-2.0-dev guile-2.0
6

7
8
9
10
11
12
13
14
15
16
17
SOURCE_TOP=$(pwd)
CLEAN_TOP=$(cd .. && pwd)/clean
mkdir -p ../clean
chmod -R ugo+w ../clean || exit 1
rm -rf ../clean || exit 1
mkdir -p ../clean || exit 1

cd $CLEAN_TOP
git clone $SOURCE_TOP . || exit 1

cd $SOURCE_TOP || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
18
rm -rf ../tarot-*.tar.gz ../tarot-*/ tarot-*.tar.gz
19
20
21
22
23
24
sh autogen.sh || exit 1
./configure \
    CFLAGS="-Wall -Wextra -g -O0" \
    --prefix="$SOURCE_TOP/public" \
    || (cat config.log ; exit 1) \
    || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
25
make indent || exit 1
26
(cd lib && make -j 16) || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
27
make -j 16 distcheck || exit 1
28
make -j 16 check || exit 1
29
30
31
32
make -j 16 install install-html || exit 1
rm -rf ../../tarot-*.tar.gz ../../tarot-*/
cp tarot-*.tar.gz ../../ || exit 1
cd ../../ || exit 1
33
34
tar xf tarot-*.tar.gz || exit 1
cd tarot-* || exit 1
35
36
DIST_TOP=$(pwd)
cd $CLEAN_TOP/program || exit 1
37
OK="yes"
Vivien Kraus's avatar
Vivien Kraus committed
38
for source in $(find . -type f)
39
40
41
42
43
44
45
do
    case $source in
	*.po | *.pot)
	    echo "Ignoring PO file $source, as it has a date in it.";;
	*.md)
	    echo "Ignoring Markdown file $source, as it may be non-reproducibly generated by org-mode.";;
	*)
46
	    if ! $(diff $source $DIST_TOP/$source)
Vivien Kraus's avatar
Vivien Kraus committed
47
48
49
50
	    then
		echo "ERROR: $source has been modified since check-in, or ignored from the distribution.  Is it automatically generated?  Did you forget to indent it?  Did you forget to include it as distributed in Automake?"
		OK="no"
	    fi;;
51
52
	esac
done;
Vivien Kraus's avatar
Vivien Kraus committed
53
54
55
56
57
if test "$OK" = "no"
then
    echo "Failure."
    exit 1
fi
58
59
60
61
62

## Nice!
cd $SOURCE_TOP || exit 1
mkdir -p $SOURCE_TOP/public || exit 1
cp $SOURCE_TOP/program/.version \
Vivien Kraus's avatar
Vivien Kraus committed
63
   $SOURCE_TOP/public/version || exit 1
64
cp ../tarot-*.tar.gz $SOURCE_TOP/public/ || exit 1