/ci/build-rpm.sh

https://gitlab.com/unofficial-mirrors/ostree · Shell · 46 lines · 34 code · 6 blank · 6 comment · 9 complexity · 97bd8a7f00809ab346905b6a3a23f05d MD5 · raw file

  1. #!/usr/bin/bash
  2. # Generate a src.rpm, then binary rpms in the current directory
  3. set -xeuo pipefail
  4. dn=$(dirname $0)
  5. paprcidir=${dn}/libpaprci
  6. . ${paprcidir}/libbuild.sh
  7. # Auto-provision bootstrap resources if run as root (normally in CI)
  8. if test "$(id -u)" == 0; then
  9. pkg_install_buildroot
  10. pkg_install make /usr/bin/rpmbuild git
  11. fi
  12. # PAPR really should do this
  13. if ! test -f libglnx/README.md || ! test -f bsdiff/README.md; then
  14. git submodule update --init
  15. fi
  16. # Default libcurl on by default in fedora unless libsoup is enabled
  17. if test "${OS_ID}" = 'fedora'; then
  18. case "${CONFIGOPTS:-}" in
  19. *--with-soup*|*--without-curl*) ;;
  20. *) CONFIGOPTS="${CONFIGOPTS:-} --with-curl"
  21. esac
  22. fi
  23. case "${CONFIGOPTS:-}" in
  24. *--with-curl*|*--with-soup*)
  25. if test -x /usr/bin/gnome-desktop-testing-runner; then
  26. CONFIGOPTS="${CONFIGOPTS} --enable-installed-tests=exclusive"
  27. fi
  28. ;;
  29. esac
  30. # TODO: Use some form of rpm's --build-in-place to skip archive-then-unpack?
  31. make -f ${paprcidir}/Makefile.dist-packaging srpm PACKAGE=libostree DISTGIT_NAME=ostree
  32. if test "$(id -u)" == 0; then
  33. pkg_builddep *.src.rpm
  34. else
  35. echo "NOTE: Running as non-root, assuming build dependencies are installed"
  36. fi
  37. if ! ${paprcidir}/rpmbuild-cwd --rebuild *.src.rpm; then
  38. find . -type f -name config.log -exec cat {} \;
  39. exit 1
  40. fi