/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
- #!/usr/bin/bash
- # Generate a src.rpm, then binary rpms in the current directory
- set -xeuo pipefail
- dn=$(dirname $0)
- paprcidir=${dn}/libpaprci
- . ${paprcidir}/libbuild.sh
- # Auto-provision bootstrap resources if run as root (normally in CI)
- if test "$(id -u)" == 0; then
- pkg_install_buildroot
- pkg_install make /usr/bin/rpmbuild git
- fi
- # PAPR really should do this
- if ! test -f libglnx/README.md || ! test -f bsdiff/README.md; then
- git submodule update --init
- fi
- # Default libcurl on by default in fedora unless libsoup is enabled
- if test "${OS_ID}" = 'fedora'; then
- case "${CONFIGOPTS:-}" in
- *--with-soup*|*--without-curl*) ;;
- *) CONFIGOPTS="${CONFIGOPTS:-} --with-curl"
- esac
- fi
- case "${CONFIGOPTS:-}" in
- *--with-curl*|*--with-soup*)
- if test -x /usr/bin/gnome-desktop-testing-runner; then
- CONFIGOPTS="${CONFIGOPTS} --enable-installed-tests=exclusive"
- fi
- ;;
- esac
- # TODO: Use some form of rpm's --build-in-place to skip archive-then-unpack?
- make -f ${paprcidir}/Makefile.dist-packaging srpm PACKAGE=libostree DISTGIT_NAME=ostree
- if test "$(id -u)" == 0; then
- pkg_builddep *.src.rpm
- else
- echo "NOTE: Running as non-root, assuming build dependencies are installed"
- fi
- if ! ${paprcidir}/rpmbuild-cwd --rebuild *.src.rpm; then
- find . -type f -name config.log -exec cat {} \;
- exit 1
- fi