summaryrefslogtreecommitdiffstats
path: root/.travis
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2019-01-14 18:55:13 +0100
committerPierre Ossman <ossman@cendio.se>2019-01-21 16:35:22 +0100
commit02876df2e8713d65986fa44d1e027bdea8272b28 (patch)
treec23746b37c7e591960f487211a569554bd19f470 /.travis
parent82c65e4e58bb0c6629543fa9282039780aa721d0 (diff)
downloadtigervnc-02876df2e8713d65986fa44d1e027bdea8272b28.tar.gz
tigervnc-02876df2e8713d65986fa44d1e027bdea8272b28.zip
Build RHEL 7 packages in Travis
Diffstat (limited to '.travis')
-rw-r--r--.travis/centos7/Dockerfile13
-rwxr-xr-x.travis/centos7/build.sh40
2 files changed, 53 insertions, 0 deletions
diff --git a/.travis/centos7/Dockerfile b/.travis/centos7/Dockerfile
new file mode 100644
index 00000000..36e86fbd
--- /dev/null
+++ b/.travis/centos7/Dockerfile
@@ -0,0 +1,13 @@
+FROM centos:7
+
+RUN yum -y groupinstall 'Development Tools'
+RUN yum -y install centos-packager
+
+RUN yum -y install sudo
+
+RUN useradd -s /bin/bash -m rpm
+RUN echo >> /etc/sudoers
+RUN echo "rpm ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
+
+USER rpm
+WORKDIR /home/rpm
diff --git a/.travis/centos7/build.sh b/.travis/centos7/build.sh
new file mode 100755
index 00000000..f5b4de03
--- /dev/null
+++ b/.travis/centos7/build.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+set -e
+set -x
+
+## Basic variables
+
+CURDIR=$(dirname $(readlink -f $0))
+TOPDIR=$(git rev-parse --show-toplevel 2>/dev/null)
+
+RPMDIR=${TOPDIR}/contrib/packages/rpm/el7
+
+VERSION=$(grep '^set(VERSION ' ${TOPDIR}/CMakeLists.txt | sed 's@^set(VERSION \(.*\))@\1@')
+
+## Prepare the build directory
+
+rm -rf ${CURDIR}/rpmbuild
+mkdir -p ${CURDIR}/rpmbuild/{BUILD,BUILDROOT,SRPMS,SOURCES,SPECS,RPMS}
+chmod a+w ${CURDIR}/rpmbuild/{BUILD,BUILDROOT,SRPMS,RPMS}
+[ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled && chcon -Rt container_file_t ${CURDIR}/rpmbuild
+
+## Copy over the packaging files
+
+cp ${RPMDIR}/SOURCES/* ${CURDIR}/rpmbuild/SOURCES
+cp ${RPMDIR}/SPECS/tigervnc.spec ${CURDIR}/rpmbuild/SPECS
+sed -i "s/@VERSION@/${VERSION}/" ${CURDIR}/rpmbuild/SPECS/tigervnc.spec
+
+## Copy over the source code
+
+(cd ${TOPDIR} && git archive --prefix tigervnc-${VERSION}/ HEAD) | bzip2 > ${CURDIR}/rpmbuild/SOURCES/tigervnc-${VERSION}.tar.bz2
+
+## Start the build
+
+docker run --volume ${CURDIR}/rpmbuild:/home/rpm/rpmbuild --interactive --tty --rm tigervnc/${DOCKER} \
+ bash -c "
+ sudo yum-builddep -y ~/rpmbuild/SPECS/tigervnc.spec &&
+ sudo chown 0.0 ~/rpmbuild/SOURCES/* &&
+ sudo chown 0.0 ~/rpmbuild/SPECS/* &&
+ rpmbuild -ba ~/rpmbuild/SPECS/tigervnc.spec
+ "