dist.sh 2.59 KB
Newer Older
Vivien Kraus's avatar
Vivien Kraus committed
1
#!/bin/sh
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 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
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# 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
17

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

Vivien Kraus's avatar
Vivien Kraus committed
22
23
24
apt-get update
apt-get upgrade -y
apt-get install -y \
25
	appstream \
Vivien Kraus's avatar
Vivien Kraus committed
26
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
	autoconf \
	autoconf-archive \
	automake \
	autopoint \
	build-essential \
	check \
	curl \
	devscripts \
	emacs \
	emacs-goodies-el \
	gcc \
	gettext \
	git \
	gobject-introspection \
	gperf \
	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
80
make -j git-check || 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