aboutsummaryrefslogtreecommitdiffstats
path: root/.github/containers/rocky8/build.sh
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2022-12-30 14:11:05 +0100
committerPierre Ossman <ossman@cendio.se>2022-12-30 14:19:42 +0100
commiteff7fdd81bed6761a29f85b7dfa39f07d3015ea4 (patch)
treeca6cc18e9c6e543a577a77f3435a8781f16bccb3 /.github/containers/rocky8/build.sh
parent81b80305a21e943e6b188f870d46aa872951b715 (diff)
downloadtigervnc-eff7fdd81bed6761a29f85b7dfa39f07d3015ea4.tar.gz
tigervnc-eff7fdd81bed6761a29f85b7dfa39f07d3015ea4.zip
Use Rocky Linux for RHEL builds
CentOS Stream isn't fully compatible with RHEL, and there are no useful RHEL images available, so that leaves us with one of the new RHEL forks.
Diffstat (limited to '.github/containers/rocky8/build.sh')
-rwxr-xr-x.github/containers/rocky8/build.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/.github/containers/rocky8/build.sh b/.github/containers/rocky8/build.sh
new file mode 100755
index 00000000..d56eb62c
--- /dev/null
+++ b/.github/containers/rocky8/build.sh
@@ -0,0 +1,45 @@
+#!/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/el8
+
+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 --rm tigervnc/${DOCKER} \
+ bash -e -x -c "
+ sudo dnf install -y xorg-x11-server-devel;
+ sudo dnf builddep -y ~/rpmbuild/SPECS/tigervnc.spec;
+ sudo chown 0.0 ~/rpmbuild/SOURCES/*;
+ sudo chown 0.0 ~/rpmbuild/SPECS/*;
+ rpmbuild -ba ~/rpmbuild/SPECS/tigervnc.spec;
+ "
+
+mkdir -p ${CURDIR}/result
+cp -av ${CURDIR}/rpmbuild/RPMS ${CURDIR}/result
+cp -av ${CURDIR}/rpmbuild/SRPMS ${CURDIR}/result