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.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. DEBDIR=${TOPDIR}/contrib/packages/deb/ubuntu-jammy
  8. VERSION=$(grep '^set(VERSION ' ${TOPDIR}/CMakeLists.txt | sed 's@^set(VERSION \(.*\))@\1@')
  9. ## Prepare the build directory
  10. rm -rf ${CURDIR}/build
  11. mkdir -p ${CURDIR}/build
  12. chmod a+w ${CURDIR}/build
  13. [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled && chcon -Rt container_file_t ${CURDIR}/build
  14. ## Copy over the source code
  15. (cd ${TOPDIR} && git archive --prefix tigervnc-${VERSION}/ HEAD) | xz > ${CURDIR}/build/tigervnc_${VERSION}.orig.tar.xz
  16. ## Copy over the packaging files
  17. cp -r ${DEBDIR}/debian ${CURDIR}/build/debian
  18. chmod a+x ${CURDIR}/build/debian/rules
  19. # Assemble a fake changelog entry to get the correct version
  20. cat - > ${CURDIR}/build/debian/changelog << EOT
  21. tigervnc (${VERSION}-1ubuntu1) UNRELEASED; urgency=low
  22. * Automated build for TigerVNC
  23. -- Build bot <tigervncbot@tigervnc.org> $(date -R)
  24. EOT
  25. cat ${DEBDIR}/debian/changelog >> ${CURDIR}/build/debian/changelog
  26. ## Start the build
  27. docker run --volume ${CURDIR}/build:/home/deb/build --interactive --rm tigervnc/${DOCKER} \
  28. bash -e -x -c "
  29. tar -C ~/build -axf ~/build/tigervnc_${VERSION}.orig.tar.xz;
  30. cp -a ~/build/debian ~/build/tigervnc-${VERSION}/debian;
  31. sudo apt-get update;
  32. mk-build-deps ~/build/tigervnc-${VERSION}/debian/control;
  33. sudo apt-get install -y ~/tigervnc-build-deps_*.deb;
  34. cd ~/build/tigervnc-${VERSION} && dpkg-buildpackage;
  35. "
  36. mkdir -p ${CURDIR}/result
  37. cp -av ${CURDIR}/build/*.deb ${CURDIR}/result