dist.sh 3.46 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
sh autogen.sh VALAFLAGS="--target-glib=2.50" || exit 1
21
./configure \
22
    CFLAGS="-Wall -Wextra -Werror -g $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 \
Vivien Kraus's avatar
Vivien Kraus committed
26
    --enable-renderer=yes \
Vivien Kraus's avatar
Vivien Kraus committed
27
    --enable-generator=yes \
28
    --enable-tree-renderer=yes \
Vivien Kraus's avatar
Vivien Kraus committed
29
    --enable-silent-rules=yes \
30
31
    || (cat config.log ; exit 1) \
    || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
32
33
(cd lib-library && make -j 16 CFLAGS="-Wno-error -g $CFLAGS") || exit 1
(cd lib-program && make -j 16 CFLAGS="-Wno-error -g $CFLAGS") || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
34
35
make -j 16 distcheck || exit 1
make -j 16 check || exit 1
36
make -j 16 install install-html || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
37
make indent || exit 1
38
39
40
rm -rf ../../tarot-*.tar.gz ../../tarot-*/
cp tarot-*.tar.gz ../../ || exit 1
cd ../../ || exit 1
41
42
tar xf tarot-*.tar.gz || exit 1
cd tarot-* || exit 1
43
DIST_TOP=$(pwd)
Vivien Kraus's avatar
Vivien Kraus committed
44
cd $CLEAN_TOP || exit 1
45
OK="yes"
Vivien Kraus's avatar
Vivien Kraus committed
46
for source in $(find . -type f)
47
48
49
50
51
52
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
53
	*/.git/*);;
54
	*)
Vivien Kraus's avatar
Vivien Kraus committed
55
	    if diff $source $DIST_TOP/$source
Vivien Kraus's avatar
Vivien Kraus committed
56
	    then
Vivien Kraus's avatar
Vivien Kraus committed
57
58
		echo "$source: OK"
	    else
Vivien Kraus's avatar
Vivien Kraus committed
59
60
61
		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;;
62
63
	esac
done;
Vivien Kraus's avatar
Vivien Kraus committed
64
65
66
67
68
69
70
71
cd $DIST_TOP || exit 1
./configure && make maintainer-clean || exit 1
echo "Checking what files are maintainer-clean..."
for source in $(find . -type f)
do
    case $source in
	*.po | *.pot)
	    echo "Ignoring PO file $source, as it has a date in it.";;
Vivien Kraus's avatar
Vivien Kraus committed
72
73
	./po/en@quot.header | ./po/en@boldquot.header | ./po/Rules-quot | ./po/remove-potcdate.sin | ./po/boldquot.sed | ./po/quot.sed | ./po/insert-header.sin | ./po/Makefile.in.in)
	    echo "Ignoring Gettext garbage $source.";;
Vivien Kraus's avatar
Vivien Kraus committed
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
	./libopts/*)
	    echo "Ignoring embedded file $source, as it is not ours.";;
	./.tarball-version)
	    echo "Ignoring .tarball-version.";;
	./lib-library/* | ./lib-program/* | ./snippet/*)
	    echo "Ignoring $source, some gnulib stuff.";;
	./m4/*)
	    echo "Ignoring autoconf macro $source.";;
	./git-version-gen | ./gitlog-to-changelog)
	    echo "Ignoring helper script $source.";;
	./compile | ./depcomp | ./config.rpath | ./config.sub | ./texinfo.tex | ./ar-lib | ./INSTALL | ./missing | ./test-driver | ./ltmain.sh | ./aclocal.m4 | ./ChangeLog | ./config.h.in | ./config.guess | ./Makefile.in | ./configure | ./install-sh | ./ABOUT-NLS)
	    echo "Ignoring required automake script $source.";;
	*)
	    if diff $source $CLEAN_TOP/$source
	    then
		echo "$source: OK"
	    else
		echo "ERROR: $source is not a maintainer-clean file, but it has been rebuilt or deleted since checkout.  If this file has been generated, add it to MAINTAINERCLEANFILES."
		OK="no"
	    fi;;
    esac
done;
Vivien Kraus's avatar
Vivien Kraus committed
96
97
98
99
100
if test "$OK" = "no"
then
    echo "Failure."
    exit 1
fi
101
102
103
104

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