diff --git a/.packit.sh b/.packit.sh deleted file mode 100644 index dc562c4..0000000 --- a/.packit.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -# Packit's default fix-spec-file often doesn't fetch version string correctly. -# This script handles any custom processing of the dist-git spec file and gets used by the -# fix-spec-file action in .packit.yaml - -set -eo pipefail - -# Set path to rpm spec file -SPEC_FILE=rpm/container-selinux.spec - -# Get Version from HEAD -HEAD_VERSION=$(grep '^policy_module' container.te | sed 's/[^0-9.]//g') - -# Generate source tarball -git archive --prefix=container-selinux-$HEAD_VERSION/ -o rpm/container-selinux-$HEAD_VERSION.tar.gz HEAD - -# RPM Spec modifications - -# Update Version in spec with Version from container.te -sed -i "s/^Version:.*/Version: $HEAD_VERSION/" $SPEC_FILE - -# Update Release in spec with Packit's release envvar -sed -i "s/^Release:.*/Release: $PACKIT_RPMSPEC_RELEASE%{?dist}/" $SPEC_FILE - -# Update Source tarball name in spec -sed -i "s/^Source0:.*.tar.gz/Source0: %{name}-$HEAD_VERSION.tar.gz/" $SPEC_FILE diff --git a/.packit.yaml b/.packit.yaml index d49f936..e5121fc 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -19,17 +19,11 @@ jobs: # x86_64 is assumed by default # container-selinux is noarch so we only need to test on one arch targets: &pr_copr_targets - - fedora-rawhide - - fedora-38 - - fedora-37 + - fedora-all - centos-stream-9 - centos-stream-8 srpm_build_deps: - make - - rpkg - actions: - fix-spec-file: - - bash .packit.sh - <<: *copr # Run on commit to main branch @@ -37,18 +31,10 @@ jobs: branch: main project: podman-next targets: - - fedora-rawhide-aarch64 - - fedora-rawhide-ppc64le - - fedora-rawhide-s390x - - fedora-rawhide-x86_64 - - fedora-38-aarch64 - - fedora-38-ppc64le - - fedora-38-s390x - - fedora-38-x86_64 - - fedora-37-aarch64 - - fedora-37-ppc64le - - fedora-37-s390x - - fedora-37-x86_64 + - fedora-all-aarch64 + - fedora-all-ppc64le + - fedora-all-s390x + - fedora-all-x86_64 - centos-stream+epel-next-9-aarch64 - centos-stream+epel-next-9-ppc64le - centos-stream+epel-next-9-s390x diff --git a/rpm/container-selinux.spec b/rpm/container-selinux.spec index 42816ae..b5a3f37 100644 --- a/rpm/container-selinux.spec +++ b/rpm/container-selinux.spec @@ -14,17 +14,11 @@ # Format must contain '$x' somewhere to do anything useful %global _format() export %1=""; for x in %{modulenames}; do %1+=%2; %1+=" "; done; -# copr_username is only set on copr environments, not on others like koji -%if "%{?copr_username}" != "rhcontainerbot" -%bcond_with copr -%else -%bcond_without copr -%endif - # RHEL 8 doesn't allow watch and systemd_chat_resolved -%if 0%{?rhel} == 8 +%if %{defined rhel} && 0%{?rhel} == 8 %bcond_without no_watch %bcond_without no_systemd_chat_resolved +%global _selinux_policy_version 3.14.3-80.el8 %else %bcond_with no_watch %bcond_with no_systemd_chat_resolved @@ -39,8 +33,8 @@ Name: container-selinux # Set different Epochs for copr and koji -%if %{with copr} -Epoch: 101 +%if %{defined copr_username} +Epoch: 102 %else Epoch: 2 %endif @@ -153,9 +147,12 @@ if %{_sbindir}/selinuxenabled ; then fi %changelog -%if 0%{?rhel} <= 8 && ! 0%{?fedora} -* Mon May 01 2023 RH Container Bot -- Dummy changelog for CentOS Stream 8 -%else +%if %{defined autochangelog} %autochangelog +%else +# NOTE: This changelog will be visible on CentOS 8 Stream builds +# Other envs are capable of handling autochangelog +* Tue Jun 13 2023 RH Container Bot +- Placeholder changelog for envs that are not autochangelog-ready. +- Contact upstream if you need to report an issue with the build. %endif