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

Vivien Kraus's avatar
Vivien Kraus committed
3
4
5
6
# HACKS!!!!
#
# Remove VALAFLAGS="--target-glib=2.50"

7
8
9
10
11
12
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
13
rm -rf $SOURCE_TOP/public || exit 1
14
15
16
17
18

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

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

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