dist.sh 3.57 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
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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

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

## Distribution of the library
cd $SOURCE_TOP || exit 1
cd library || exit 1
rm -rf ../../libtarot-*.tar.gz ../../libtarot-*/ libtarot-*.tar.gz
sh autogen.sh || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
22
23
./configure \
    CFLAGS="-Wall -Wextra -g -O0 -Wno-unused-function" \
24
    --prefix="$SOURCE_TOP/root" \
25
26
    || (cat config.log ; exit 1) \
    || exit 1
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
make indent || exit 1
(cd lib && make -j 16) || exit 1
make -j 16 distcheck || exit 1
make -j 16 check || exit 1
make -j 16 install install-html || exit 1not ignored
cp libtarot-*.tar.gz ../../ || exit 1
cd ../../ || exit 1
tar xf libtarot-*.tar.gz || exit 1
cd libtarot-* || exit 1
DIST_TOP=$(pwd)
cd $CLEAN_TOP/library || exit 1
OK="yes"
for source in $(find . -type f)
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.";;
	*)
	    if ! $(diff $source $DIST_TOP/$source)
	    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;;
	esac
done;
if test "$OK" = "no"
then
    echo "Failure."
    exit 1
fi
59

60
61
62
63
64
65
66
67
68
69
70
71
72
## Distribution of the program
cd $SOURCE_TOP || exit 1
cd program || exit 1
rm -rf ../../tarot-*.tar.gz ../../tarot-*/ tarot-*.tar.gz
sh autogen.sh || exit 1
export PKG_CONFIG_PATH="$SOURCE_TOP/root/share/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$SOURCE_TOP/root/lib:$LD_LIBRARY_PATH"
echo "Looking for libtarot.pc in $PKG_CONFIG_PATH"
./configure \
    CFLAGS="-Wall -Wextra -g -O0" \
    --prefix="$SOURCE_TOP/public" \
    || (cat config.log ; exit 1) \
    || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
73
make indent || exit 1
74
(cd lib && make -j 16) || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
75
make -j 16 distcheck || exit 1
76
make -j 16 check || exit 1
77
78
79
80
make -j 16 install install-html || exit 1
rm -rf ../../tarot-*.tar.gz ../../tarot-*/
cp tarot-*.tar.gz ../../ || exit 1
cd ../../ || exit 1
81
82
tar xf tarot-*.tar.gz || exit 1
cd tarot-* || exit 1
83
84
DIST_TOP=$(pwd)
cd $CLEAN_TOP/program || exit 1
85
OK="yes"
Vivien Kraus's avatar
Vivien Kraus committed
86
for source in $(find . -type f)
87
88
89
90
91
92
93
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.";;
	*)
94
	    if ! $(diff $source $DIST_TOP/$source)
Vivien Kraus's avatar
Vivien Kraus committed
95
96
97
98
	    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;;
99
100
	esac
done;
Vivien Kraus's avatar
Vivien Kraus committed
101
102
103
104
105
if test "$OK" = "no"
then
    echo "Failure."
    exit 1
fi
106
107
108
109
110
111
112
113
114
115

## Nice!
cd $SOURCE_TOP || exit 1
mkdir -p $SOURCE_TOP/public || exit 1
cp $SOURCE_TOP/library/.version \
   $SOURCE_TOP/public/library-version || exit 1
cp $SOURCE_TOP/program/.version \
   $SOURCE_TOP/public/program-version || exit 1
cp ../libtarot-*.tar.gz $SOURCE_TOP/public/ || exit 1
cp ../tarot-*.tar.gz $SOURCE_TOP/public/ || exit 1