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

# 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 \
Vivien Kraus's avatar
Vivien Kraus committed
24
	appstream-util \
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
	help2man \
	imagemagick \
	indent \
	jq \
	libcairo2-dev \
	libgirepository1.0-dev \
	libglib2.0-dev \
	libgtk-3-dev \
	libtool \
	libxml2-utils \
	make \
	nettle-dev \
	org-mode \
	pkg-config \
	r-cran-ggplot2 \
Vivien Kraus's avatar
Vivien Kraus committed
56
	r-cran-glmnet \
Vivien Kraus's avatar
Vivien Kraus committed
57
	r-cran-optparse \
Vivien Kraus's avatar
Vivien Kraus committed
58
	texinfo \
59
	texlive-full \
Vivien Kraus's avatar
Vivien Kraus committed
60
61
	valac \
	valgrind \
62
	wget \
Vivien Kraus's avatar
Vivien Kraus committed
63
64
	xsltproc

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

if test "x$CI_COMMIT_TAG" != "x"
then
    cd $SOURCE_TOP
    TARFILE=$(ls dist/tarot-*.tar.gz)
91
    mkdir /root/.ssh || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
92
93
    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
94
95
    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
96
97
    git config --global user.email "vivien@planete-kraus.eu" || exit 1
    git config --global user.name "Gitlab CI for the tarot package" || exit 1
98
99
100
    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
101
fi