You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.sh 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/bash
  2. set -e
  3. set -x
  4. ## Basic variables
  5. CURDIR=$(dirname $(readlink -f $0))
  6. TOPDIR=$(git rev-parse --show-toplevel 2>/dev/null)
  7. RPMDIR=${TOPDIR}/contrib/packages/rpm/el9
  8. VERSION=$(grep '^set(VERSION ' ${TOPDIR}/CMakeLists.txt | sed 's@^set(VERSION \(.*\))@\1@')
  9. ## Prepare the build directory
  10. rm -rf ${CURDIR}/rpmbuild
  11. mkdir -p ${CURDIR}/rpmbuild/{BUILD,BUILDROOT,SRPMS,SOURCES,SPECS,RPMS}
  12. chmod a+w ${CURDIR}/rpmbuild/{BUILD,BUILDROOT,SRPMS,RPMS}
  13. [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled && chcon -Rt container_file_t ${CURDIR}/rpmbuild
  14. ## Copy over the packaging files
  15. cp ${RPMDIR}/SOURCES/* ${CURDIR}/rpmbuild/SOURCES
  16. cp ${RPMDIR}/SPECS/tigervnc.spec ${CURDIR}/rpmbuild/SPECS
  17. sed -i "s/@VERSION@/${VERSION}/" ${CURDIR}/rpmbuild/SPECS/tigervnc.spec
  18. ## Copy over the source code
  19. (cd ${TOPDIR} && git archive --prefix tigervnc-${VERSION}/ HEAD) | bzip2 > ${CURDIR}/rpmbuild/SOURCES/tigervnc-${VERSION}.tar.bz2
  20. ## Start the build
  21. docker run --volume ${CURDIR}/rpmbuild:/home/rpm/rpmbuild --interactive --rm tigervnc/${DOCKER} \
  22. bash -e -x -c "
  23. sudo dnf install -y xorg-x11-server-devel;
  24. sudo dnf install -y https://kojihub.stream.centos.org/kojifiles/packages/xorg-x11-font-utils/7.5/53.el9/x86_64/xorg-x11-font-utils-7.5-53.el9.x86_64.rpm;
  25. sudo dnf builddep -y ~/rpmbuild/SPECS/tigervnc.spec;
  26. sudo chown 0.0 ~/rpmbuild/SOURCES/*;
  27. sudo chown 0.0 ~/rpmbuild/SPECS/*;
  28. rpmbuild -ba ~/rpmbuild/SPECS/tigervnc.spec;
  29. "
  30. mkdir -p ${CURDIR}/result
  31. cp -av ${CURDIR}/rpmbuild/RPMS ${CURDIR}/result
  32. cp -av ${CURDIR}/rpmbuild/SRPMS ${CURDIR}/result