dist.sh 2.61 KB
Newer Older
Vivien Kraus's avatar
Vivien Kraus committed
1
#!/bin/sh
2
3
4
5
6
# tarot implements the rules of the tarot game
# Copyright (C) 2019  Vivien Kraus

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation, version 3 of the License.
8
9
10
11
12
13
14
15
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Vivien Kraus's avatar
Vivien Kraus committed
16

Vivien Kraus's avatar
Vivien Kraus committed
17
18
19
20
# HACKS!!!!
#
# Remove VALAFLAGS="--target-glib=2.50"

Vivien Kraus's avatar
Vivien Kraus committed
21
22
23
apt-get update
apt-get upgrade -y
apt-get install -y \
24
	appstream \
Vivien Kraus's avatar
Vivien Kraus committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
	autoconf \
	autoconf-archive \
	automake \
	autopoint \
	build-essential \
	check \
	curl \
	devscripts \
	emacs \
	emacs-goodies-el \
	gcc \
	gettext \
	git \
	gobject-introspection \
	gperf \
40
	guile-2.2-dev \
Vivien Kraus's avatar
Vivien Kraus committed
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
	help2man \
	imagemagick \
	indent \
	jq \
	libcairo2-dev \
	libgirepository1.0-dev \
	libglib2.0-dev \
	libgtk-3-dev \
	libtool \
	libxml2 \
	libxml2-dev \
	libxml2-utils \
	make \
	nettle-dev \
	org-mode \
	pkg-config \
	r-cran-ggplot2 \
Vivien Kraus's avatar
Vivien Kraus committed
58
	r-cran-glmnet \
Vivien Kraus's avatar
Vivien Kraus committed
59
	r-cran-optparse \
Vivien Kraus's avatar
Vivien Kraus committed
60
	texinfo \
61
	texlive-full \
Vivien Kraus's avatar
Vivien Kraus committed
62
63
	valac \
	valgrind \
64
	wget \
Vivien Kraus's avatar
Vivien Kraus committed
65
66
	xsltproc

67
SOURCE_TOP=$(pwd)
Vivien Kraus's avatar
Vivien Kraus committed
68
rm -rf $SOURCE_TOP/dist || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
69
rm -rf ../tarot-*.tar.gz ../tarot-*/ tarot-*.tar.gz
70
sh autogen.sh VALAFLAGS="--target-glib=2.50" || exit 1
71
./configure \
72
    CFLAGS="-Wall -Wextra -g $CFLAGS" \
Vivien Kraus's avatar
Vivien Kraus committed
73
    VALAFLAGS="--target-glib=2.50" \
Vivien Kraus's avatar
Vivien Kraus committed
74
    --prefix="$SOURCE_TOP/dist" \
Vivien Kraus's avatar
Vivien Kraus committed
75
    --enable-valgrind=yes \
Vivien Kraus's avatar
Vivien Kraus committed
76
    --enable-silent-rules=yes \
77
78
    || (cat config.log ; exit 1) \
    || exit 1
79
make .version || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
80
make -j || exit 1
81
make -j git-check || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
82
make -j distcheck || exit 1
83
cd $SOURCE_TOP || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
84
mkdir -p $SOURCE_TOP/dist || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
85
cp $SOURCE_TOP/.version \
Vivien Kraus's avatar
Vivien Kraus committed
86
87
   $SOURCE_TOP/dist/version || exit 1
cp tarot-*.tar.gz $SOURCE_TOP/dist/ || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
88
89
90
91
92

if test "x$CI_COMMIT_TAG" != "x"
then
    cd $SOURCE_TOP
    TARFILE=$(ls dist/tarot-*.tar.gz)
93
    mkdir /root/.ssh || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
94
95
    echo "$SSH_KEY" > /root/.ssh/id_rsa || exit 1
    echo "$SSH_KEY_PUB" > /root/.ssh/id_rsa.pub || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
96
97
    echo "$SSH_KNOWN_HOSTS" > /root/.ssh/known_hosts || exit 1
    chmod go-rwx /root/.ssh/id_rsa || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
98
99
    git config --global user.email "vivien@planete-kraus.eu" || exit 1
    git config --global user.name "Gitlab CI for the tarot package" || exit 1
100
101
102
    wget -O /tmp/submit https://play-tarot.frama.io/tarot-releases/submit || exit 1
    chmod ugo+x /tmp/submit || exit 1
    /tmp/submit $TARFILE || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
103
fi