1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-03-12 10:45:14 +01:00

Merge pull request #1449 from dmach/rhel-macros

Use %{?rhel} macros in spec
This commit is contained in:
Daniel Mach 2023-12-04 13:40:48 +01:00 committed by GitHub
commit 6ed8020c67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 15 deletions

View File

@ -73,6 +73,9 @@ jobs:
- name: 'Install build dependencies (Fedora/CentOS)' - name: 'Install build dependencies (Fedora/CentOS)'
if: ${{ contains(matrix.container, '/fedora:') || contains(matrix.container, '/centos:') }} if: ${{ contains(matrix.container, '/fedora:') || contains(matrix.container, '/centos:') }}
run: | 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 dnf -y builddep contrib/osc.spec
- name: 'Build SRPM and RPMs' - name: 'Build SRPM and RPMs'

View File

@ -15,31 +15,31 @@
# need to override python_sitelib because it is not set as we would expect on many distros # 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'))") %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 # generate manpages on distros where argparse-manpage >= 3 and python3-Sphinx are available
%if 0%{?suse_version} > 1500 || 0%{?fedora} >= 37 # 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 %bcond_without man
%else %else
%bcond_with man %bcond_with man
%endif %endif
# whether to use fdupes to deduplicate python bytecode # 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 %bcond_without fdupes
%else %else
%bcond_with fdupes %bcond_with fdupes
%endif %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 argparse_manpage_pkg argparse-manpage
%define obs_build_pkg obs-build
%define openssh_pkg openssh
%define sphinx_pkg %{use_python_pkg}-sphinx %define sphinx_pkg %{use_python_pkg}-sphinx
%endif
%if 0%{?suse_version} %if 0%{?suse_version}
%define argparse_manpage_pkg %{use_python_pkg}-argparse-manpage
%define obs_build_pkg build %define obs_build_pkg build
%define openssh_pkg openssh-common
%define sphinx_pkg %{use_python_pkg}-Sphinx
%endif %endif
Name: osc Name: osc
@ -110,12 +110,8 @@ Recommends: obs-service-source_validator
Recommends: obs-service-tar_scm Recommends: obs-service-tar_scm
Recommends: obs-service-verify_file Recommends: obs-service-verify_file
%if 0%{?fedora} # needed for ssh signature auth
Recommends: openssh Recommends: %{openssh_pkg}
%endif
%if 0%{?suse_version}
Recommends: openssh-common
%endif
# needed for `osc browse` that calls xdg-open # needed for `osc browse` that calls xdg-open
Recommends: xdg-utils Recommends: xdg-utils