From a9db22d555e3b9dcbe041321b3fff74c16e69756 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Thu, 23 Nov 2023 14:50:41 +0100 Subject: [PATCH 1/3] spec: Simplify distro-specific macros --- contrib/osc.spec | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/contrib/osc.spec b/contrib/osc.spec index d1794fb2..e7b3deaf 100644 --- a/contrib/osc.spec +++ b/contrib/osc.spec @@ -29,17 +29,16 @@ %bcond_with fdupes %endif -%define argparse_manpage_pkg %{use_python_pkg}-argparse-manpage -%define obs_build_pkg obs-build -%define sphinx_pkg %{use_python_pkg}-Sphinx - -%if 0%{?fedora} %define argparse_manpage_pkg argparse-manpage +%define obs_build_pkg obs-build +%define openssh_pkg openssh %define sphinx_pkg %{use_python_pkg}-sphinx -%endif %if 0%{?suse_version} +%define argparse_manpage_pkg %{use_python_pkg}-argparse-manpage %define obs_build_pkg build +%define openssh_pkg openssh-common +%define sphinx_pkg %{use_python_pkg}-Sphinx %endif Name: osc @@ -110,12 +109,8 @@ Recommends: obs-service-source_validator Recommends: obs-service-tar_scm Recommends: obs-service-verify_file -%if 0%{?fedora} -Recommends: openssh -%endif -%if 0%{?suse_version} -Recommends: openssh-common -%endif +# needed for ssh signature auth +Recommends: %{openssh_pkg} # needed for `osc browse` that calls xdg-open Recommends: xdg-utils From 41cbd5f505c9f0a69f61b6d9ab3e7ce63a2244fe Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Thu, 23 Nov 2023 14:53:13 +0100 Subject: [PATCH 2/3] spec: Use %{?rhel} macros Backport of https://build.opensuse.org/request/show/1123605 --- contrib/osc.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/osc.spec b/contrib/osc.spec index e7b3deaf..1df9d985 100644 --- a/contrib/osc.spec +++ b/contrib/osc.spec @@ -15,15 +15,16 @@ # need to override python_sitelib because it is not set as we would expect on many distros %define python_sitelib %(RPM_BUILD_ROOT= %{use_python} -Ic "import sysconfig; print(sysconfig.get_path('purelib'))") -# generate manpages on distros where argparse-manpage >= 3 is available -%if 0%{?suse_version} > 1500 || 0%{?fedora} >= 37 +# generate manpages on distros where argparse-manpage >= 3 and python3-Sphinx are available +# please note that RHEL build requires packages from CRB and EPEL repositories +%if 0%{?suse_version} > 1500 || 0%{?fedora} >= 37 || 0%{?rhel} >= 9 %bcond_without man %else %bcond_with man %endif # whether to use fdupes to deduplicate python bytecode -%if 0%{?suse_version} || 0%{?fedora} +%if 0%{?suse_version} || 0%{?fedora} || 0%{?rhel} >= 8 %bcond_without fdupes %else %bcond_with fdupes From 921942d15d3b8ce60ce8cace28a557a9e0b9de61 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Thu, 23 Nov 2023 15:39:00 +0100 Subject: [PATCH 3/3] GHA: Install epel-release on RHEL and its clones in the rpmbuild test --- .github/workflows/build-install.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-install.yaml b/.github/workflows/build-install.yaml index 62662d82..58460c0f 100644 --- a/.github/workflows/build-install.yaml +++ b/.github/workflows/build-install.yaml @@ -73,6 +73,9 @@ jobs: - name: 'Install build dependencies (Fedora/CentOS)' if: ${{ contains(matrix.container, '/fedora:') || contains(matrix.container, '/centos:') }} run: | + RHEL_VERSION=$(rpm --eval '%{?rhel}') + [ -n "${RHEL_VERSION}" ] && rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-${RHEL_VERSION}.noarch.rpm + [ -n "${RHEL_VERSION}" ] && /usr/bin/crb enable dnf -y builddep contrib/osc.spec - name: 'Build SRPM and RPMs'