diff --git a/bdii.spec b/bdii.spec index 53054a5..300d633 100644 --- a/bdii.spec +++ b/bdii.spec @@ -1,3 +1,9 @@ +%if %{?fedora}%{!?fedora:0} >= 31 || %{?rhel}%{!?rhel:0} >= 8 +%global use_python3 1 +%else +%global use_python3 0 +%endif + %if %{?fedora}%{!?fedora:0} >= 25 || %{?rhel}%{!?rhel:0} >= 8 %global use_systemd 1 %else @@ -6,7 +12,7 @@ Name: bdii Version: 5.2.26 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Berkeley Database Information Index (BDII) License: ASL 2.0 @@ -20,7 +26,11 @@ Source3: %{name}-slapd-start Patch0: %{name}-py3.patch BuildArch: noarch BuildRequires: make +%if %{use_python3} BuildRequires: python3-devel +%else +BuildRequires: python2-devel +%endif %if %{use_systemd} BuildRequires: systemd %endif @@ -57,7 +67,9 @@ differences. This is then used to update the database. %prep %setup -q +%if %{use_python3} %patch0 -p1 +%endif %build @@ -65,7 +77,11 @@ differences. This is then used to update the database. make install prefix=%{buildroot} # Don't use /usr/bin/env shebang +%if %{use_python3} sed 's!%{_bindir}/env .*!%{__python3}!' -i %{buildroot}%{_sbindir}/bdii-update +%else +sed 's!%{_bindir}/python!%{__python2}!' -i %{buildroot}%{_sbindir}/bdii-update +%endif rm -rf %{buildroot}%{_docdir}/%{name} @@ -151,6 +167,9 @@ fi %license COPYRIGHT LICENSE.txt %changelog +* Mon Jan 25 2021 Mattias Ellert - 5.2.26-3 +- Revert use of python3 for EPEL 7 + * Wed Jan 06 2021 Mattias Ellert - 5.2.26-2 - Use python3 also for EPEL 7 (following upsteam)