diff --git a/.copr/Makefile b/.copr/Makefile deleted file mode 100644 index 4f56b81..0000000 --- a/.copr/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -.PHONY: installdeps srpm git_config_pre - -installdeps: - dnf install -y $(shell cat automation/build-artifacts.packages) - -git_config_pre: - # From git 2.35.2 we need to mark temporary directory, where the project is cloned to, as safe, otherwise - # git commands won't work - $(eval REPO_DIR=$(shell pwd)) - git config --global --add safe.directory ${REPO_DIR} - -prepare: installdeps git_config_pre - # Calling 'eval' in 'srpm:' is done when parsing that target, - # so we need to have this 'prepare' separate target for - # preparing stuff so that the 'eval' call will work. - autopoint - autoreconf -ivf - ./configure - -srpm: installdeps git_config_pre prepare - $(eval SUFFIX=$(shell sh -c ' . automation/config.sh; [ -n "$${RELEASE_SUFFIX}" ] && echo ".$$(date -u +%Y%m%d%H%M%S).git$$(git rev-parse --short HEAD)"')) - mkdir -p tmp.repos - # changing the spec file as passing -D won't preserve the suffix when rebuilding in mock - sed "s:%{?release_suffix}:${SUFFIX}:" -i otopi.spec.in - make dist - rpmbuild \ - -D "_topdir tmp.repos" \ - -ts ./*.tar.gz - cp tmp.repos/SRPMS/*.src.rpm $(outdir) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7e66b1f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,100 @@ +--- +name: build + +on: + push: + branches: [master] + tags: ['*'] + pull_request: + branches: [master] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - name: almalinux-9 + shortcut: el9 + container-name: almalinux9 + - name: almalinux-10 + shortcut: el10 + container-name: almalinux10 + - name: centos-stream-9 + shortcut: el9s + container-name: el9stream + - name: centos-stream-10 + shortcut: el10s + container-name: el10stream + + name: Build and test on ${{ matrix.name }} + container: + image: quay.io/ovirt/buildcontainer:${{ matrix.container-name }} + + steps: + - name: Checkout sources + uses: actions/checkout@v7 + + - name: Mark repository as safe + run: git config --global --add safe.directory "$(pwd)" + + - name: Install dependencies + run: | + dnf install -y epel-release + dnf config-manager --set-enabled epel || true + dnf install -y autoconf automake gcc gettext-devel git libtool make rpm-build \ + python3-devel python3-pyflakes python3-pycodestyle python3-coverage \ + rpm-sign createrepo_c dnf-plugin-versionlock dnf-utils makeself + + - name: Set build environment + run: | + TAG=$(git tag --points-at HEAD | head -1) + if [[ -n "$TAG" ]]; then + if [[ "$TAG" =~ -([0-9]+)$ ]]; then + echo "PACKAGE_RPM_RELEASE=${BASH_REMATCH[1]}" >> $GITHUB_ENV + else + echo "PACKAGE_RPM_RELEASE=1" >> $GITHUB_ENV + fi + else + echo "RELEASE_SUFFIX=.$(date --utc +%Y%m%d%H%M%S).git$(git rev-parse --short HEAD)" >> $GITHUB_ENV + fi + + - name: Autopoint + run: autopoint + + - name: Autoreconf + run: autoreconf -ivf + + - name: Configure + run: ./configure + + - name: Run distcheck + run: make -j distcheck + + - name: Build RPM + run: make -j rpm + + - name: Collect artifacts + run: | + mkdir -p exported-artifacts + find tmp.repos -iname \*rpm -exec mv "{}" exported-artifacts/ \; + mv ./*tar.gz exported-artifacts/ + + - name: Run checks + run: automation/run-checks.sh + + - name: Upload artifacts + uses: actions/upload-artifact@v7 + with: + name: rpm-${{ matrix.shortcut }} + path: exported-artifacts + + publish-rpms: + permissions: + artifact-metadata: read + needs: build + if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} + uses: ovirt/ovirt-workflows/.github/workflows/publish-rpms.yml@main + secrets: inherit diff --git a/.github/workflows/check-patch.yml b/.github/workflows/check-patch.yml deleted file mode 100644 index 7505227..0000000 --- a/.github/workflows/check-patch.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Check patch - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - name: centos-stream-9 - shortcut: cs9 - container-name: el9stream - - name: centos-stream-10 - shortcut: cs10 - container-name: el10stream - name: ${{ matrix.name }} - container: - image: quay.io/ovirt/buildcontainer:${{ matrix.container-name }} - env: - ARTIFACTS_DIR: exported-artifacts - steps: - - name: Enable EPEL - run: dnf install -y epel-release && dnf config-manager --set-enabled epel - - - name: Install dependencies - run: dnf install -y --setopt=tsflags=nodocs rpm-sign dnf-plugin-versionlock dnf-utils python3-coverage python3-pycodestyle python3-pyflakes python3-devel python3-coverage gettext-devel - - - uses: ovirt/checkout-action@main - - - name: autopoint - run: autopoint - - - name: autoreconf -ivf - run: autoreconf -ivf - - - name: configure - run: ./configure - - - name: run distcheck - run: make -j distcheck - - - name: make dist - run: make dist - - - name: mkdir tmp.repos - run: mkdir -p tmp.repos - - - name: rpmbuild - run: rpmbuild -D "_topdir $PWD/tmp.repos" -D "release_suffix .$(date -u +%Y%m%d%H%M%S).git$(git rev-parse --short HEAD)" -ta otopi-*.tar.gz - - - name: Collect artifacts - run: | - mkdir -p ${ARTIFACTS_DIR} - find tmp.repos -iname \*rpm -exec mv "{}" ${ARTIFACTS_DIR} \; - mv ./*tar.gz ${ARTIFACTS_DIR} - - - name: Run checks - run: automation/run-checks.sh - - - name: Upload artifacts - uses: ovirt/upload-rpms-action@main - with: - directory: ${{ env.ARTIFACTS_DIR }} diff --git a/.gitignore b/.gitignore index c5f2d46..6754ede 100644 --- a/.gitignore +++ b/.gitignore @@ -31,8 +31,5 @@ intl src/otopi/config.py src/otopi/config.py.in target -automation/config.sh m4/extern-inline.m4 -# Not autogenerated! -\!.copr/Makefile \ No newline at end of file diff --git a/Makefile.am b/Makefile.am index 2ea1dd5..81c1fd5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,6 +5,10 @@ AUTOMAKE_OPTIONS = foreign 1.9 ACLOCAL_AMFLAGS = -I m4 +TMPREPOS = tmp.repos +RPMBUILD_ARGS := --define="_topdir `pwd`/$(TMPREPOS)" +RPMBUILD_ARGS += $(if $(RELEASE_SUFFIX),--define="release_suffix $(RELEASE_SUFFIX)") + MAINTAINERCLEANFILES = \ config.log config.status \ $(srcdir)/Makefile.in \ @@ -68,3 +72,17 @@ POTFILES.in: update-po: POTFILES.in $(MAKE) -C po update-po + +rpm: srpm + rpmbuild $(RPMBUILD_ARGS) --rebuild "$(TMPREPOS)"/SRPMS/*.src.rpm + @echo + @echo "rpm available at '$(TMPREPOS)'" + @echo + +srpm: dist + rm -rf "$(TMPREPOS)" + mkdir -vp $(TMPREPOS)/{SPECS,RPMS,SRPMS,SOURCES} + rpmbuild $(RPMBUILD_ARGS) -ts $(distdir).tar.gz + @echo + @echo "srpm available at '$(TMPREPOS)'" + @echo diff --git a/README.md b/README.md index 9bbe335..52e9348 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # otopi -- oVirt Task Oriented Pluggable Installer/Implementation -[![Copr build status](https://copr.fedorainfracloud.org/coprs/ovirt/ovirt-master-snapshot/package/otopi/status_image/last_build.png)](https://copr.fedorainfracloud.org/coprs/ovirt/ovirt-master-snapshot/package/otopi/) Standalone plugin based installation framework to be used to setup system components. The plugin nature provides simplicity to diff --git a/automation/build-artifacts-manual.packages b/automation/build-artifacts-manual.packages deleted file mode 120000 index 1903cac..0000000 --- a/automation/build-artifacts-manual.packages +++ /dev/null @@ -1 +0,0 @@ -build-artifacts.packages \ No newline at end of file diff --git a/automation/build-artifacts-manual.sh b/automation/build-artifacts-manual.sh deleted file mode 120000 index 5969703..0000000 --- a/automation/build-artifacts-manual.sh +++ /dev/null @@ -1 +0,0 @@ -build-artifacts.sh \ No newline at end of file diff --git a/automation/build-artifacts.packages b/automation/build-artifacts.packages deleted file mode 100644 index 16366fd..0000000 --- a/automation/build-artifacts.packages +++ /dev/null @@ -1,11 +0,0 @@ -autoconf -automake -dnf -dnf-utils -gcc -gettext-devel -git -make -python3-devel -python3-pyflakes -rpm-build diff --git a/automation/build-artifacts.sh b/automation/build-artifacts.sh deleted file mode 100755 index 15cca6f..0000000 --- a/automation/build-artifacts.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -xe -[[ -d exported-artifacts ]] \ -|| mkdir -p exported-artifacts - -[[ -d tmp.repos ]] \ -|| mkdir -p tmp.repos - -# stdci seems to ignore build-artifacts.packages -dnf install -y $(cat automation/build-artifacts.packages) -autopoint -autoreconf -ivf -./configure - -SUFFIX= -. automation/config.sh -[ -n "${RELEASE_SUFFIX}" ] && SUFFIX=".$(date -u +%Y%m%d%H%M%S).git$(git rev-parse --short HEAD)" - -make dist - -if [ -e /etc/fedora-release ]; then - dnf builddep --spec otopi.spec -else - yum-builddep otopi.spec -fi - -rpmbuild \ - -D "_topdir $PWD/tmp.repos" \ - ${SUFFIX:+-D "release_suffix ${SUFFIX}"} \ - -ta otopi-*.tar.gz - -mv *.tar.gz exported-artifacts -find \ - "$PWD/tmp.repos" \ - -iname \*.rpm \ - -exec mv {} exported-artifacts/ \; diff --git a/automation/build-srpm.sh b/automation/build-srpm.sh deleted file mode 100755 index 6cfbe35..0000000 --- a/automation/build-srpm.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -xe -[[ -d tmp.repos ]] \ -|| mkdir -p tmp.repos - -# stdci seems to ignore build-artifacts.packages -dnf install -y $(cat automation/build-artifacts.packages) -autopoint -autoreconf -ivf -./configure - -SUFFIX= -. automation/config.sh -[ -n "${RELEASE_SUFFIX}" ] && SUFFIX=".$(date -u +%Y%m%d%H%M%S).git$(git rev-parse --short HEAD)" - -make dist - -if [ -e /etc/fedora-release ]; then - dnf builddep --spec otopi.spec -else - yum-builddep otopi.spec -fi - -rpmbuild \ - -D "_topdir $PWD/tmp.repos" \ - ${SUFFIX:+-D "release_suffix ${SUFFIX}"} \ - -ts otopi-*.tar.gz diff --git a/automation/check-patch.packages b/automation/check-patch.packages deleted file mode 100644 index cbccbc9..0000000 --- a/automation/check-patch.packages +++ /dev/null @@ -1,17 +0,0 @@ -autoconf -automake -createrepo_c -dnf -dnf-plugins-core -dnf-plugin-versionlock -dnf-utils -gettext-devel -git -make -makeself -python3-coverage -python3-distro -python3-libselinux -python3-pycodestyle -python3-pyflakes -rpm-build diff --git a/automation/check-patch.req b/automation/check-patch.req deleted file mode 120000 index 3858aae..0000000 --- a/automation/check-patch.req +++ /dev/null @@ -1 +0,0 @@ -check-patch.packages \ No newline at end of file diff --git a/automation/check-patch.sh b/automation/check-patch.sh deleted file mode 100755 index 46ad58d..0000000 --- a/automation/check-patch.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -ex -DISTVER="$(rpm --eval "%dist"|cut -c2-4)" -installer=dnf - -# stdci seems to ignore check-patch.packages -${installer} install -y $(cat automation/check-patch.packages) - -autopoint -autoreconf -ivf -./configure -make distcheck - -automation/build-artifacts.sh -automation/run-checks.sh diff --git a/automation/config.sh.in b/automation/config.sh.in deleted file mode 100644 index 44200f0..0000000 --- a/automation/config.sh.in +++ /dev/null @@ -1 +0,0 @@ -RELEASE_SUFFIX="@RELEASE_SUFFIX@" diff --git a/configure.ac b/configure.ac index 845df9e..0b5145c 100644 --- a/configure.ac +++ b/configure.ac @@ -8,15 +8,17 @@ define([VERSION_MAJOR], [1]) define([VERSION_MINOR], [10]) define([VERSION_FIX], [6]) define([VERSION_NUMBER], VERSION_MAJOR[.]VERSION_MINOR[.]VERSION_FIX) -define([VERSION_SUFFIX], [_master]) -AC_INIT([otopi], VERSION_NUMBER[]VERSION_SUFFIX) +AC_INIT([otopi], VERSION_NUMBER) PACKAGE_RPM_VERSION="VERSION_NUMBER" -PACKAGE_RPM_RELEASE="0.0.$(echo VERSION_SUFFIX | sed 's/^_//')" -RELEASE_SUFFIX="VERSION_SUFFIX" + +AC_ARG_VAR([PACKAGE_RPM_RELEASE], + [RPM release field (default: 0.master for development, release number for release builds)]) +AS_IF([test -z "$PACKAGE_RPM_RELEASE"], + [PACKAGE_RPM_RELEASE="0.master"]) + AC_SUBST([PACKAGE_RPM_VERSION]) AC_SUBST([PACKAGE_RPM_RELEASE]) -AC_SUBST([RELEASE_SUFFIX]) AC_CONFIG_AUX_DIR([.]) AC_CONFIG_SRCDIR([src/otopi/__init__.py]) @@ -89,7 +91,6 @@ AC_CONFIG_FILES([ src/plugins/otopi/debug/test_note/Makefile src/plugins/otopi/debug/wait_on_error/Makefile src/plugins/otopi/debug/packages/Makefile - automation/config.sh automation/testRPMs/testpackage1/testpackage1.spec automation/testRPMs/testpackage2/testpackage2.spec automation/testRPMsUpdates/testpackage1/testpackage1.spec