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

3
4
5
6
7
8
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
9
rm -rf $SOURCE_TOP/public || exit 1
10
11
12
13
14

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

cd $SOURCE_TOP || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
15
rm -rf ../tarot-*.tar.gz ../tarot-*/ tarot-*.tar.gz
16
17
sh autogen.sh || exit 1
./configure \
18
    CFLAGS="-Wall -Wextra -Werror -g -O0 $CFLAGS" \
19
    --prefix="$SOURCE_TOP/public" \
Vivien Kraus's avatar
Vivien Kraus committed
20
    --enable-valgrind=yes \
21
22
    || (cat config.log ; exit 1) \
    || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
23
make indent || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
24
(cd lib-library && make -j 16) || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
25
26
(cd lib-program && make -j 16) || exit 1
# I don't know exactly which targets are not thread safe...
Vivien Kraus's avatar
Vivien Kraus committed
27
make dist || exit 1
28
29
30
31
32
33
make -j 16 distcheck \
    || (cat "$SOURCE_TOP/tarot-$(cat .version)/_build/sub/test-suite.log" ; exit 1) \
    || exit 1
make -j 16 check \
    || (cat test-suite.log ; exit 1) \
    || exit 1
34
35
36
37
make -j 16 install install-html || exit 1
rm -rf ../../tarot-*.tar.gz ../../tarot-*/
cp tarot-*.tar.gz ../../ || exit 1
cd ../../ || exit 1
38
39
tar xf tarot-*.tar.gz || exit 1
cd tarot-* || exit 1
40
DIST_TOP=$(pwd)
Vivien Kraus's avatar
Vivien Kraus committed
41
cd $CLEAN_TOP || exit 1
42
OK="yes"
Vivien Kraus's avatar
Vivien Kraus committed
43
for source in $(find . -type f)
44
45
46
47
48
49
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
50
	*/.git/*);;
51
	*)
Vivien Kraus's avatar
Vivien Kraus committed
52
	    if diff $source $DIST_TOP/$source
Vivien Kraus's avatar
Vivien Kraus committed
53
	    then
Vivien Kraus's avatar
Vivien Kraus committed
54
55
		echo "$source: OK"
	    else
Vivien Kraus's avatar
Vivien Kraus committed
56
57
58
		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;;
59
60
	esac
done;
Vivien Kraus's avatar
Vivien Kraus committed
61
62
63
64
65
if test "$OK" = "no"
then
    echo "Failure."
    exit 1
fi
66
67
68
69

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