From 1e8da7bd1ef65455a2fa54b04cdaeb32b5317c3d Mon Sep 17 00:00:00 2001 From: Carl George Date: Mar 15 2021 20:40:31 +0000 Subject: Make spec file python2 compatible --- diff --git a/centpkg.spec b/centpkg.spec index 445d916..fca1db0 100644 --- a/centpkg.spec +++ b/centpkg.spec @@ -1,3 +1,13 @@ +# In order to use unversioned python macros in the spec file, we need to +# explicitly define %%__python. It is already defined on el7. +%if %{undefined el7} +%if %{defined el8} +%global __python %{_libexecdir}/platform-python +%else +%global __python %{python3} +%endif +%endif + Name: centpkg Version: %{!?devrel:0.4.6}%{?devrel:0.4.7} Release: %{?devrel:0.%{devrel}%{?devsnap:.%{devsnap}}.}1%{?dist} @@ -7,11 +17,12 @@ URL: https://git.centos.org/centos/centpkg Source0: https://git.centos.org/centos/centpkg/archive/%{version}/centpkg-%{version}.tar.gz BuildArch: noarch -BuildRequires: python3-devel -%if 0%{?rhel} > 0 && 0%{?rhel} < 8 +%if %{defined el7} +BuildRequires: python-devel BuildRequires: python-setuptools %else -BuildRequires: %{py3_dist setuptools} +BuildRequires: python3-devel +BuildRequires: python3-setuptools %endif %description @@ -31,11 +42,11 @@ Provides the centpkg-sig command for working with dist-git. %build -%py3_build +%py_build %install -%py3_install +%py_install %files @@ -43,7 +54,8 @@ Provides the centpkg-sig command for working with dist-git. %doc README.md %config(noreplace) %{_sysconfdir}/rpkg/centpkg.conf %{_bindir}/%{name} -%{python3_sitelib}/%{name}* +%{python_sitelib}/%{name} +%{python_sitelib}/%{name}-%{version}-py%{python_version}.egg-info %files sig