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' diff --git a/contrib/osc.spec b/contrib/osc.spec index d1794fb2..1df9d985 100644 --- a/contrib/osc.spec +++ b/contrib/osc.spec @@ -15,31 +15,31 @@ # 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 %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 +110,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