From 8e445cb957ecb6a3b428e8a4088a023300fdbd8b Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Thu, 3 Feb 2022 13:08:22 -0500 Subject: [PATCH 1/5] ci/libbuild.sh: drop yum/CentOS support `dnf` is present in all the platforms we care about now, and the CentOS bit is out of date. We can re-add it if we add e.g. C[89]S support with the updated list of packages. Motivated by noticing that the `yum` symlink isn't always present. --- ci/libbuild.sh | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/ci/libbuild.sh b/ci/libbuild.sh index dece8d09..ffc65585 100644 --- a/ci/libbuild.sh +++ b/ci/libbuild.sh @@ -6,7 +6,7 @@ OS_ID=$(. /etc/os-release; echo $ID) OS_VERSION_ID=$(. /etc/os-release; echo $VERSION_ID) pkg_upgrade() { - yum -y distro-sync + dnf -y distro-sync } make() { @@ -20,7 +20,7 @@ build() { } pkg_install() { - yum -y install "$@" + dnf -y install "$@" } pkg_install_if_os() { @@ -39,25 +39,15 @@ pkg_install_buildroot() { # https://github.com/projectatomic/rpm-ostree/pull/1889/commits/9ff611758bea22b0ad4892cc16182dd1f7f47e89 # https://fedoraproject.org/wiki/Common_F30_bugs#Conflicts_between_fedora-release_packages_when_installing_package_groups if rpm -q fedora-release-container; then - yum -y swap fedora-release{-container,} + dnf -y swap fedora-release{-container,} fi pkg_install dnf-plugins-core @buildsys-build;; - centos) pkg_install yum-utils - # Base buildroot, copied from the mock config sadly - pkg_install bash bzip2 coreutils cpio diffutils system-release findutils gawk gcc gcc-c++ \ - grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar \ - unzip util-linux which xz;; *) fatal "pkg_install_buildroot(): Unhandled OS ${OS_ID}";; esac } pkg_builddep() { - # This is sadly the only case where it's a different command - if test -x /usr/bin/dnf; then - dnf builddep -y "$@" - else - yum-builddep -y "$@" - fi + dnf builddep -y "$@" } # Install both build and runtime dependencies for $pkg From 8d45298a2d4ff77a5d70f871873cd099cd49f489 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Thu, 3 Feb 2022 13:21:54 -0500 Subject: [PATCH 2/5] ci/make-git-snapshot.sh: fix archive name The archive name is libostree even though the project name is ostree, so we can't rely on the directory name. Just hardcode it. --- ci/make-git-snapshot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/make-git-snapshot.sh b/ci/make-git-snapshot.sh index 67cf14c9..391af64d 100755 --- a/ci/make-git-snapshot.sh +++ b/ci/make-git-snapshot.sh @@ -5,7 +5,7 @@ TOP=$(git rev-parse --show-toplevel) GITREV=$(git rev-parse HEAD) gitdescribe=$(git describe --always --tags $GITREV) version=$(echo "$gitdescribe" | sed -e 's,-,\.,g' -e 's,^v,,') -name=$(basename $(pwd)) +name=libostree PKG_VER="${name}-${version}" TARFILE=${PKG_VER}.tar From 92c396c82bb2a4041bac7f5d14c77f7d8c0bf23a Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Thu, 3 Feb 2022 13:22:47 -0500 Subject: [PATCH 3/5] ci/make-git-snapshot.sh: auto-initialize submodules Matches `autogen.sh`. --- ci/make-git-snapshot.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/make-git-snapshot.sh b/ci/make-git-snapshot.sh index 391af64d..1b17b93f 100755 --- a/ci/make-git-snapshot.sh +++ b/ci/make-git-snapshot.sh @@ -11,6 +11,10 @@ PKG_VER="${name}-${version}" TARFILE=${PKG_VER}.tar TARFILE_TMP=${TARFILE}.tmp +if ! test -f ${TOP}/libglnx/README.md || ! test -f ${TOP}/bsdiff/README.md; then + git submodule update --init +fi + echo "Archiving ${PKG_VER} at ${GITREV} to ${TARFILE_TMP}" (cd ${TOP}; git archive --format=tar --prefix=${PKG_VER}/ ${GITREV}) > ${TARFILE_TMP} ls -al ${TARFILE_TMP} From a51ae1ed736c8a3f97de5bc153472c9fd3c265d6 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Thu, 3 Feb 2022 13:23:43 -0500 Subject: [PATCH 4/5] ci/make-git-snapshot.sh: xz the archive This matches `make dist` and what the spec file expects. --- ci/make-git-snapshot.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/make-git-snapshot.sh b/ci/make-git-snapshot.sh index 1b17b93f..acfdd6c2 100755 --- a/ci/make-git-snapshot.sh +++ b/ci/make-git-snapshot.sh @@ -26,3 +26,4 @@ ls -al ${TARFILE_TMP} rm submodule.tar done mv ${TARFILE_TMP} ${TARFILE} +xz "${TARFILE}" From 1e663baad723f4b948b696d7585a4e15bef43461 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Thu, 3 Feb 2022 13:25:07 -0500 Subject: [PATCH 5/5] Add COPR integration Makefile I'd like to enable auto-builds of this repo to https://copr.fedorainfracloud.org/coprs/g/CoreOS/continuous/ so it could eventually feed into https://github.com/coreos/fedora-coreos-tracker/issues/910. --- .copr/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .copr/Makefile diff --git a/.copr/Makefile b/.copr/Makefile new file mode 100644 index 00000000..81a02213 --- /dev/null +++ b/.copr/Makefile @@ -0,0 +1,8 @@ +srpm: + dnf install -y git + ci/make-git-snapshot.sh + curl -LO https://src.fedoraproject.org/rpms/ostree/raw/rawhide/f/ostree.spec + sed -ie "s,^Version:.*,Version: $$(git describe --always --tags | sed -e 's,-,\.,g' -e 's,^v,,')," ostree.spec + sed -ie 's/^Patch/# Patch/g' ostree.spec # we don't want any downstream patches + rpmbuild -bs --define "_sourcedir ${PWD}" --define "_specdir ${PWD}" --define "_builddir ${PWD}" --define "_srcrpmdir ${PWD}" --define "_rpmdir ${PWD}" --define "_buildrootdir ${PWD}/.build" ostree.spec + mv *.src.rpm $$outdir