forked from ARPA-SIMC/wreport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis-build.sh
50 lines (46 loc) · 1.41 KB
/
.travis-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
#!/bin/bash
set -ex
image=$1
if [[ $image =~ ^centos:7 ]]
then
pkgcmd="yum"
builddep="yum-builddep"
sed -i '/^tsflags=/d' /etc/yum.conf
yum install -y epel-release
yum install -y @buildsys-build
yum install -y yum-utils
yum install -y git
elif [[ $image =~ ^centos:8 ]]
then
pkgcmd="dnf"
builddep="dnf builddep"
sed -i '/^tsflags=/d' /etc/dnf/dnf.conf
dnf install -q -y epel-release
dnf install -q -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled powertools
dnf groupinstall -q -y "Development Tools"
dnf install -q -y 'dnf-command(builddep)'
dnf install -q -y git
dnf install -q -y rpmdevtools
elif [[ $image =~ ^fedora: ]]
then
pkgcmd="dnf"
builddep="dnf builddep"
sed -i '/^tsflags=/d' /etc/dnf/dnf.conf
dnf install -y --allowerasing @buildsys-build
dnf install -y 'dnf-command(builddep)'
dnf install -y git
fi
$builddep -y fedora/SPECS/wreport.spec
if [[ $image =~ ^fedora: || $image =~ ^centos: ]]
then
pkgname=wreport-$(git describe --abbrev=0 --tags --match='v*' | sed -e 's,^v,,g')
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
cp fedora/SPECS/wreport.spec ~/rpmbuild/SPECS/wreport.spec
git archive --prefix=$pkgname/ --format=tar HEAD | gzip -c > ~/rpmbuild/SOURCES/$pkgname.tar.gz
rpmbuild -ba ~/rpmbuild/SPECS/wreport.spec
else
autoreconf -ifv
./configure
make check
fi