dist.sh 2.01 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
6
7

SOURCE=$(pwd)
Vivien Kraus's avatar
Vivien Kraus committed
8
9
10
11
12
13
mkdir -p ../rebuilt ../clean
chmod -R ugo+w ../rebuilt ../clean || exit 1
rm -rf ../rebuilt ../clean || exit 1
mkdir -p ../rebuilt ../clean || exit 1
cd ../clean
git clone $SOURCE . || exit 1
14
15
16
cd ../rebuilt
git clone $SOURCE . || exit 1
sh ./autogen.sh || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
17
18
19
20
21
./configure \
    CFLAGS="-Wall -Wextra -g -O0 -Wno-unused-function" \
    --with-asan=yes \
    --with-libunistring=yes \
    --prefix="$PWD/public" \
22
23
24
    || (cat config.log ; exit 1) \
    || exit 1

Vivien Kraus's avatar
Vivien Kraus committed
25
echo "INDENTING"
Vivien Kraus's avatar
Vivien Kraus committed
26
make indent || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
27
echo "GNULIB"
28
(cd lib && make -j 16) || exit 1
29
echo "DIST"
Vivien Kraus's avatar
Vivien Kraus committed
30
make -j 16 distcheck || exit 1
31
32
33
34
echo "CHECK"
make -j 16 check || exit 1
echo "INSTALL"
make -j 16 install || exit 1
35
rm -rf ../tarot-*.tar.gz ../tarot-*/
36
37
38
39
40
41
cp tarot-*.tar.gz ../ || exit 1
cd ..
tar xf tarot-*.tar.gz || exit 1
cd tarot-* || exit 1
DIST=$(pwd)

Vivien Kraus's avatar
Vivien Kraus committed
42
cd $SOURCE/../clean
43
OK="yes"
Vivien Kraus's avatar
Vivien Kraus committed
44
for source in $(find . -type f)
45
46
47
48
49
50
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.";;
Vivien Kraus's avatar
Vivien Kraus committed
51
52
	*~)
	    echo "Ignoring backup file $source.";;
53
54
	./.git/*);;
	./tarot-*);;
55
	*)
Vivien Kraus's avatar
Vivien Kraus committed
56
	    if ! $(diff $source $DIST/$source)
Vivien Kraus's avatar
Vivien Kraus committed
57
58
59
60
	    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;;
61
62
63
	esac
done;

Vivien Kraus's avatar
Vivien Kraus committed
64
65
66
67
68
if test "$OK" = "no"
then
    echo "Failure."
    exit 1
fi
69
mkdir -p $SOURCE/public || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
70
cp ../rebuilt/.version $SOURCE/public || exit 1
71
cp ../tarot-*.tar.gz $SOURCE/public/ || exit 1