]> source.dussan.org Git - tigervnc.git/commitdiff
Build Ubuntu 16.04 (Xenial) package in Travis
authorPierre Ossman <ossman@cendio.se>
Tue, 15 Jan 2019 14:00:21 +0000 (15:00 +0100)
committerPierre Ossman <ossman@cendio.se>
Mon, 21 Jan 2019 15:35:22 +0000 (16:35 +0100)
.travis.yml
.travis/xenial/Dockerfile [new file with mode: 0644]
.travis/xenial/build.sh [new file with mode: 0755]

index 7055a58316b998178468c286b5b06da8d380c975..4591a5c4728b6f1df56168d43163025ba1c5f3d7 100644 (file)
@@ -3,6 +3,7 @@ language: minimal
 env:
   - DOCKER=centos6
   - DOCKER=centos7
+  - DOCKER=xenial
 
 matrix:
   include:
diff --git a/.travis/xenial/Dockerfile b/.travis/xenial/Dockerfile
new file mode 100644 (file)
index 0000000..ad5414f
--- /dev/null
@@ -0,0 +1,11 @@
+FROM ubuntu:xenial
+
+RUN apt-get update
+RUN apt-get -y install packaging-dev equivs
+
+RUN useradd -s /bin/bash -m deb
+RUN echo >> /etc/sudoers
+RUN echo "deb ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
+
+USER deb
+WORKDIR /home/deb
diff --git a/.travis/xenial/build.sh b/.travis/xenial/build.sh
new file mode 100755 (executable)
index 0000000..5c140f9
--- /dev/null
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+set -e
+set -x
+
+## Basic variables
+
+CURDIR=$(dirname $(readlink -f $0))
+TOPDIR=$(git rev-parse --show-toplevel 2>/dev/null)
+
+DEBDIR=${TOPDIR}/contrib/packages/deb/ubuntu-xenial
+
+VERSION=$(grep '^set(VERSION ' ${TOPDIR}/CMakeLists.txt | sed 's@^set(VERSION \(.*\))@\1@')
+
+## Prepare the build directory
+
+rm -rf ${CURDIR}/build
+mkdir -p ${CURDIR}/build
+chmod a+w ${CURDIR}/build
+[ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled && chcon -Rt container_file_t ${CURDIR}/build
+
+## Copy over the source code
+
+(cd ${TOPDIR} && git archive --prefix tigervnc-${VERSION}/ HEAD) | xz > ${CURDIR}/build/tigervnc_${VERSION}.orig.tar.xz
+
+## Copy over the packaging files
+
+cp -r ${DEBDIR}/debian ${CURDIR}/build/debian
+
+chmod a+x ${CURDIR}/build/debian/rules
+
+# Assemble a fake changelog entry to get the correct version
+
+cat - > ${CURDIR}/build/debian/changelog << EOT
+tigervnc (${VERSION}-1ubuntu1) UNRELEASED; urgency=low
+
+  * Automated build for TigerVNC
+
+ -- Build bot <tigervncbot@tigervnc.org>  $(date -R)
+
+EOT
+cat ${DEBDIR}/debian/changelog >> ${CURDIR}/build/debian/changelog
+
+## Start the build
+
+docker run --volume ${CURDIR}/build:/home/deb/build --interactive --tty --rm tigervnc/${DOCKER} \
+       bash -c "
+       tar -C ~/build -axf ~/build/tigervnc_${VERSION}.orig.tar.xz &&
+       cp -a ~/build/debian ~/build/tigervnc-${VERSION}/debian &&
+       mk-build-deps ~/build/tigervnc-${VERSION}/debian/control &&
+       sudo dpkg --unpack ~/tigervnc-build-deps_*.deb &&
+       sudo apt-get -f install -y &&
+       cd ~/build/tigervnc-${VERSION} && dpkg-buildpackage
+       "