summaryrefslogtreecommitdiffstats
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
parent82c65e4e58bb0c6629543fa9282039780aa721d0 (diff)
downloadtigervnc-02876df2e8713d65986fa44d1e027bdea8272b28.tar.gz
tigervnc-02876df2e8713d65986fa44d1e027bdea8272b28.zip
Build RHEL 7 packages in Travis
-rw-r--r--.travis.yml50
-rw-r--r--.travis/centos7/Dockerfile13
-rwxr-xr-x.travis/centos7/build.sh40
3 files changed, 86 insertions, 17 deletions
diff --git a/.travis.yml b/.travis.yml
index ceafcbb7..69198463 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,20 +1,36 @@
-language:
- - c++
- - java
+language: minimal
-# Travis is still stuck on Ubuntu 14.04, which has too old crap
-before_install:
-# GnuTLS 3.x
- - sudo apt-get install -y libgnutls28-dev
-# FLTK 1.3.4
- - wget http://fltk.org/pub/fltk/1.3.4/fltk-1.3.4-2-source.tar.gz
- - tar -xvf fltk-1.3.4-2-source.tar.gz
- - pushd fltk-1.3.4-2
- - ./configure --prefix=/usr --enable-shared
- - make -j2
- - sudo make install
- - popd
+env:
+ - DOCKER=centos7
+
+matrix:
+ include:
+ - language: c++
+ env:
+
+ # Travis is still stuck on Ubuntu 14.04, which has too old crap
+ before_install:
+ # GnuTLS 3.x
+ - sudo apt-get install -y libgnutls28-dev
+ # FLTK 1.3.4
+ - wget http://fltk.org/pub/fltk/1.3.4/fltk-1.3.4-2-source.tar.gz
+ - tar -xvf fltk-1.3.4-2-source.tar.gz
+ - pushd fltk-1.3.4-2
+ - ./configure --prefix=/usr --enable-shared
+ - make -j2
+ - sudo make install
+ - popd
+ script:
+ - cmake -DCMAKE_BUILD_TYPE=Debug . && make
+
+ - language: java
+ env:
+ before_install: skip
+ script:
+ - cd java && cmake . && make
+
+before_install:
+ - docker build -t tigervnc/$DOCKER .travis/$DOCKER
script:
- - cmake -DCMAKE_BUILD_TYPE=Debug . && make
- - cd java && cmake . && make
+ - .travis/$DOCKER/build.sh
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
+ "