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

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