ci: Remove libpaprci/ directory
authorJonathan Lebon <jonathan@jlebon.com>
Wed, 17 Jun 2020 19:48:31 +0000 (15:48 -0400)
committerJonathan Lebon <jonathan@jlebon.com>
Wed, 17 Jun 2020 19:48:31 +0000 (15:48 -0400)
And move everything that was in it directly in `ci/`. There's a bunch
more cleanups here that we need to do (and more changes to upstream from
the rpm-ostree copies of this).

15 files changed:
ci/Makefile.dist-packaging [new file with mode: 0644]
ci/build-check.sh
ci/build-rpm.sh
ci/build.sh
ci/flatpak.sh
ci/installdeps.sh
ci/libbuild.sh [new file with mode: 0644]
ci/libpaprci/Makefile.dist-packaging [deleted file]
ci/libpaprci/libbuild.sh [deleted file]
ci/libpaprci/make-git-snapshot.sh [deleted file]
ci/libpaprci/rpmbuild-cwd [deleted file]
ci/make-git-snapshot.sh [new file with mode: 0755]
ci/provision-prep.sh
ci/rpmbuild-cwd [new file with mode: 0755]
ci/rpmostree.sh

diff --git a/ci/Makefile.dist-packaging b/ci/Makefile.dist-packaging
new file mode 100644 (file)
index 0000000..de77be6
--- /dev/null
@@ -0,0 +1,39 @@
+# -*- mode: Makefile -*-
+
+mypath = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+topsrcdir = $(shell git rev-parse --show-toplevel)
+GITREV = $(shell git describe --always --tags)
+GITREV_FOR_PKG = $(shell echo "$(GITREV)" | sed -e 's,-,\.,g' -e 's,^v,,')
+
+PACKAGE ?= $(shell basename $(topsrcdir))
+DISTGIT_NAME ?= $(PACKAGE)
+DISTGIT ?= https://src.fedoraproject.org/rpms/$(DISTGIT_NAME)
+SPEC ?= $(topsrcdir)/$(DISTGIT_NAME).spec
+
+PKG_VER = $(PACKAGE)-$(GITREV_FOR_PKG)
+PKG_CLIENT_VER = $(PACKAGE)-client-$(GITREV_FOR_PKG)
+
+dist-snapshot:
+       if ! test -f $(PKG_VER).tar.xz; then \
+         $(mypath)/make-git-snapshot.sh "$(topsrcdir)" "$(PKG_VER)" "$(GITREV)" && \
+         rm -f $(PKG_VER).tar.xz && \
+         xz $(PKG_VER).tar; \
+  fi
+
+srpm: dist-snapshot
+       if test -f "$(SPEC)"; then \
+          sed -e "s,^Version:.*,Version: $(GITREV_FOR_PKG)," $(SPEC) > $(DISTGIT_NAME).spec && \
+          $(mypath)/rpmbuild-cwd -bs $(DISTGIT_NAME).spec ; \
+       else \
+         test -d $(DISTGIT_NAME) || git clone --depth=1 $(DISTGIT) && \
+    mv $(PKG_VER).tar.xz $(DISTGIT_NAME) && \
+    origdir=$$(pwd); \
+         cd $(DISTGIT_NAME) && \
+               git stash && git pull -r && \
+         sed -i -e '/^Patch/d' -e "s,^Version:.*,Version: $(GITREV_FOR_PKG)," $(DISTGIT_NAME).spec && \
+    rm -f *.src.rpm && \
+         $(mypath)/rpmbuild-cwd -bs $(DISTGIT_NAME).spec && mv *.src.rpm $${origdir}; \
+       fi
+
+rpm: srpm
+       ./rpmbuild-cwd --rebuild $(PKG_VER)*.src.rpm
index af276ef0c95980e8dbc39fc5505e13072d3d2a4a..aed8ba7e8a289b37135d69558a338f68b61637f4 100755 (executable)
@@ -4,7 +4,7 @@
 set -xeuo pipefail
 
 dn=$(dirname $0)
-. ${dn}/libpaprci/libbuild.sh
+. ${dn}/libbuild.sh
 ${dn}/build.sh
 topdir=$(git rev-parse --show-toplevel)
 resultsdir=$(mktemp -d)
index 5d096333658c1e515749efea130850c150b4db4f..1b67285e82f67439e4423ae2c2becdb9a81a63ef 100755 (executable)
@@ -4,8 +4,7 @@
 set -xeuo pipefail
 
 dn=$(dirname $0)
-paprcidir=${dn}/libpaprci
-. ${paprcidir}/libbuild.sh
+. ${dn}/libbuild.sh
 
 # Auto-provision bootstrap resources if run as root (normally in CI)
 if test "$(id -u)" == 0; then
@@ -34,13 +33,13 @@ case "${CONFIGOPTS:-}" in
 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
+make -f ${dn}/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
+if ! ${dn}/rpmbuild-cwd --rebuild *.src.rpm; then
     find . -type f -name config.log -exec cat {} \;
     exit 1
 fi
index 0901507498f2e8df4a10982773feb723dd75b5c2..4ff6eaa53817172a9938fa19cd3a6ae3b6538733 100755 (executable)
@@ -4,7 +4,7 @@
 set -xeuo pipefail
 
 dn=$(dirname $0)
-. ${dn}/libpaprci/libbuild.sh
+. ${dn}/libbuild.sh
 
 ${dn}/installdeps.sh
 
index 989b123560279a75cb71a63ddd295e18b1317238..e155d89743b85077ad5c55f6982e1a68bbcea9b6 100755 (executable)
@@ -9,7 +9,7 @@ set -xeuo pipefail
 FLATPAK_TAG=1.4.1
 
 dn=$(dirname $0)
-. ${dn}/libpaprci/libbuild.sh
+. ${dn}/libbuild.sh
 
 codedir=$(pwd)
 
index 4fc3280f5d1a5a99ea6c5082f838bba56a077873..7d7c723e0a2986d721ad4c999ef603f184bc338b 100755 (executable)
@@ -12,7 +12,7 @@ if [ -n "${SKIP_INSTALLDEPS:-}" ]; then
 fi
 
 dn=$(dirname $0)
-. ${dn}/libpaprci/libbuild.sh
+. ${dn}/libbuild.sh
 
 pkg_upgrade
 pkg_install_buildroot
diff --git a/ci/libbuild.sh b/ci/libbuild.sh
new file mode 100644 (file)
index 0000000..a8ade0d
--- /dev/null
@@ -0,0 +1,69 @@
+#!/usr/bin/bash
+
+dn=$(cd $(dirname $0) && pwd)
+
+OS_ID=$(. /etc/os-release; echo $ID)
+OS_VERSION_ID=$(. /etc/os-release; echo $VERSION_ID)
+
+pkg_upgrade() {
+    yum -y distro-sync
+}
+
+make() {
+    /usr/bin/make -j $(getconf _NPROCESSORS_ONLN) "$@"
+}
+
+build() {
+    env NOCONFIGURE=1 ./autogen.sh
+    ./configure --sysconfdir=/etc --prefix=/usr --libdir=/usr/lib64 "$@"
+    make V=1
+}
+
+pkg_install() {
+    yum -y install "$@"
+}
+
+pkg_install_if_os() {
+    local os=$1
+    shift
+    if test "${os}" = "${OS_ID}"; then
+        pkg_install "$@"
+    else
+        echo "Skipping installation targeted for ${os} (current OS: ${OS_ID}): $@"
+    fi
+}
+
+pkg_install_buildroot() {
+    case "${OS_ID}" in
+        fedora)
+            # 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,}
+            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
+}
+
+# Install both build and runtime dependencies for $pkg
+pkg_builddep_runtimedep() {
+    local pkg=$1
+    pkg_builddep $pkg
+    pkg_install $pkg
+    rpm -e $pkg
+}
diff --git a/ci/libpaprci/Makefile.dist-packaging b/ci/libpaprci/Makefile.dist-packaging
deleted file mode 100644 (file)
index de77be6..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- mode: Makefile -*-
-
-mypath = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
-topsrcdir = $(shell git rev-parse --show-toplevel)
-GITREV = $(shell git describe --always --tags)
-GITREV_FOR_PKG = $(shell echo "$(GITREV)" | sed -e 's,-,\.,g' -e 's,^v,,')
-
-PACKAGE ?= $(shell basename $(topsrcdir))
-DISTGIT_NAME ?= $(PACKAGE)
-DISTGIT ?= https://src.fedoraproject.org/rpms/$(DISTGIT_NAME)
-SPEC ?= $(topsrcdir)/$(DISTGIT_NAME).spec
-
-PKG_VER = $(PACKAGE)-$(GITREV_FOR_PKG)
-PKG_CLIENT_VER = $(PACKAGE)-client-$(GITREV_FOR_PKG)
-
-dist-snapshot:
-       if ! test -f $(PKG_VER).tar.xz; then \
-         $(mypath)/make-git-snapshot.sh "$(topsrcdir)" "$(PKG_VER)" "$(GITREV)" && \
-         rm -f $(PKG_VER).tar.xz && \
-         xz $(PKG_VER).tar; \
-  fi
-
-srpm: dist-snapshot
-       if test -f "$(SPEC)"; then \
-          sed -e "s,^Version:.*,Version: $(GITREV_FOR_PKG)," $(SPEC) > $(DISTGIT_NAME).spec && \
-          $(mypath)/rpmbuild-cwd -bs $(DISTGIT_NAME).spec ; \
-       else \
-         test -d $(DISTGIT_NAME) || git clone --depth=1 $(DISTGIT) && \
-    mv $(PKG_VER).tar.xz $(DISTGIT_NAME) && \
-    origdir=$$(pwd); \
-         cd $(DISTGIT_NAME) && \
-               git stash && git pull -r && \
-         sed -i -e '/^Patch/d' -e "s,^Version:.*,Version: $(GITREV_FOR_PKG)," $(DISTGIT_NAME).spec && \
-    rm -f *.src.rpm && \
-         $(mypath)/rpmbuild-cwd -bs $(DISTGIT_NAME).spec && mv *.src.rpm $${origdir}; \
-       fi
-
-rpm: srpm
-       ./rpmbuild-cwd --rebuild $(PKG_VER)*.src.rpm
diff --git a/ci/libpaprci/libbuild.sh b/ci/libpaprci/libbuild.sh
deleted file mode 100644 (file)
index a8ade0d..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/bash
-
-dn=$(cd $(dirname $0) && pwd)
-
-OS_ID=$(. /etc/os-release; echo $ID)
-OS_VERSION_ID=$(. /etc/os-release; echo $VERSION_ID)
-
-pkg_upgrade() {
-    yum -y distro-sync
-}
-
-make() {
-    /usr/bin/make -j $(getconf _NPROCESSORS_ONLN) "$@"
-}
-
-build() {
-    env NOCONFIGURE=1 ./autogen.sh
-    ./configure --sysconfdir=/etc --prefix=/usr --libdir=/usr/lib64 "$@"
-    make V=1
-}
-
-pkg_install() {
-    yum -y install "$@"
-}
-
-pkg_install_if_os() {
-    local os=$1
-    shift
-    if test "${os}" = "${OS_ID}"; then
-        pkg_install "$@"
-    else
-        echo "Skipping installation targeted for ${os} (current OS: ${OS_ID}): $@"
-    fi
-}
-
-pkg_install_buildroot() {
-    case "${OS_ID}" in
-        fedora)
-            # 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,}
-            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
-}
-
-# Install both build and runtime dependencies for $pkg
-pkg_builddep_runtimedep() {
-    local pkg=$1
-    pkg_builddep $pkg
-    pkg_install $pkg
-    rpm -e $pkg
-}
diff --git a/ci/libpaprci/make-git-snapshot.sh b/ci/libpaprci/make-git-snapshot.sh
deleted file mode 100755 (executable)
index 1a137bf..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-srcdir=$1
-shift
-PKG_VER=$1
-shift
-GITREV=$1
-shift
-
-TARFILE=${PKG_VER}.tar
-TARFILE_TMP=${TARFILE}.tmp
-
-set -x
-set -e
-
-test -n "${srcdir}"
-test -n "${PKG_VER}"
-test -n "${GITREV}"
-
-TOP=$(git rev-parse --show-toplevel)
-
-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}
-(cd ${TOP}; git submodule status) | while read line; do
-    rev=$(echo ${line} | cut -f 1 -d ' '); path=$(echo ${line} | cut -f 2 -d ' ')
-    echo "Archiving ${path} at ${rev}"
-    (cd ${srcdir}/${path}; git archive --format=tar --prefix=${PKG_VER}/${path}/ ${rev}) > submodule.tar
-    tar -A -f ${TARFILE_TMP} submodule.tar
-    rm submodule.tar
-done
-mv ${TARFILE_TMP} ${TARFILE}
diff --git a/ci/libpaprci/rpmbuild-cwd b/ci/libpaprci/rpmbuild-cwd
deleted file mode 100755 (executable)
index d0805bb..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-# rpmbuild-cwd:
-# Run "rpmbuild", defining all RPM variables to use the current directory.
-# This matches Fedora's system.
-#
-# Licensed under the new-BSD license (http://www.opensource.org/licenses/bsd-license.php)
-# Copyright (C) 2010 Red Hat, Inc.
-# Written by Colin Walters <walters@verbum.org>
-
-pwd=$(pwd)
-exec rpmbuild --define "_sourcedir ${pwd}" --define "_specdir ${pwd}" --define "_builddir ${pwd}" --define "_srcrpmdir ${pwd}" --define "_rpmdir ${pwd}" --define "_buildrootdir ${pwd}/.build" "$@"
diff --git a/ci/make-git-snapshot.sh b/ci/make-git-snapshot.sh
new file mode 100755 (executable)
index 0000000..1a137bf
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+srcdir=$1
+shift
+PKG_VER=$1
+shift
+GITREV=$1
+shift
+
+TARFILE=${PKG_VER}.tar
+TARFILE_TMP=${TARFILE}.tmp
+
+set -x
+set -e
+
+test -n "${srcdir}"
+test -n "${PKG_VER}"
+test -n "${GITREV}"
+
+TOP=$(git rev-parse --show-toplevel)
+
+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}
+(cd ${TOP}; git submodule status) | while read line; do
+    rev=$(echo ${line} | cut -f 1 -d ' '); path=$(echo ${line} | cut -f 2 -d ' ')
+    echo "Archiving ${path} at ${rev}"
+    (cd ${srcdir}/${path}; git archive --format=tar --prefix=${PKG_VER}/${path}/ ${rev}) > submodule.tar
+    tar -A -f ${TARFILE_TMP} submodule.tar
+    rm submodule.tar
+done
+mv ${TARFILE_TMP} ${TARFILE}
index 30825802d31be36216273b05b948e7ae5e03e432..96a2041e5b15d609779df58daa9bb0538019122f 100755 (executable)
@@ -4,7 +4,7 @@
 set -xeuo pipefail
 
 dn=$(dirname $0)
-. ${dn}/libpaprci/libbuild.sh
+. ${dn}/libbuild.sh
 pkg_upgrade
 pkg_install_buildroot
 pkg_install sudo which attr fuse strace \
diff --git a/ci/rpmbuild-cwd b/ci/rpmbuild-cwd
new file mode 100755 (executable)
index 0000000..d0805bb
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+# rpmbuild-cwd:
+# Run "rpmbuild", defining all RPM variables to use the current directory.
+# This matches Fedora's system.
+#
+# Licensed under the new-BSD license (http://www.opensource.org/licenses/bsd-license.php)
+# Copyright (C) 2010 Red Hat, Inc.
+# Written by Colin Walters <walters@verbum.org>
+
+pwd=$(pwd)
+exec rpmbuild --define "_sourcedir ${pwd}" --define "_specdir ${pwd}" --define "_builddir ${pwd}" --define "_srcrpmdir ${pwd}" --define "_rpmdir ${pwd}" --define "_buildrootdir ${pwd}/.build" "$@"
index 27fefaf6caeee98afc8e1ecefd9f2d8fa5bac73d..0a5f5df9a945c23c08fd514bc307983eb1a63628 100755 (executable)
@@ -9,7 +9,7 @@ set -xeuo pipefail
 RPMOSTREE_TAG=v2019.4
 
 dn=$(dirname $0)
-. ${dn}/libpaprci/libbuild.sh
+. ${dn}/libbuild.sh
 
 codedir=$(pwd)