diff --git a/PyPAM.spec b/PyPAM.spec index b41933e..6f9765e 100644 --- a/PyPAM.spec +++ b/PyPAM.spec @@ -1,6 +1,6 @@ %if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} -%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} +%{!?python_sitelib: %global python_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%{!?python_sitearch: %global python_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif %if 0%{?fedora} @@ -10,7 +10,7 @@ Summary: PAM bindings for Python Name: PyPAM Version: 0.5.0 -Release: 36%{?dist} +Release: 37%{?dist} # Note that the upstream site is dead. Source0: http://www.pangalactic.org/PyPAM/%{name}-%{version}.tar.gz Url: http://www.pangalactic.org/PyPAM @@ -23,7 +23,7 @@ Patch5: PyPAM-python3-support.patch License: LGPLv2 BuildRequires: python2-devel pam-devel BuildRequires: gcc -%filter_provides_in %{python_sitearch}/PAM.so$ +%filter_provides_in %{python2_sitearch}/PAM.so$ %filter_provides_in %{python3_sitearch}/PAM*.so$ %filter_setup @@ -69,7 +69,7 @@ cp -a . %{py3dir} %endif %build -CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %{__python} setup.py build +CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %{__python2} setup.py build %if 0%{with_python3} pushd %{py3dir} @@ -78,7 +78,7 @@ popd %endif %install -%{__python} setup.py install --root=$RPM_BUILD_ROOT +%{__python2} setup.py install --root=$RPM_BUILD_ROOT %if 0%{?with_python3} pushd %{py3dir} @@ -91,7 +91,7 @@ chmod 644 examples/pamtest.py rm -f examples/pamexample %check -PYTHONPATH=build/lib.linux-`uname -m`-%{python_version}/ %{__python} tests/PamTest.py +PYTHONPATH=build/lib.linux-`uname -m`-%{python2_version}/ %{__python2} tests/PamTest.py %if 0%{with_python3} pushd %{py3dir} @@ -100,8 +100,8 @@ popd %endif %files -n python2-pypam -%{python_sitearch}/PAM.so -%{python_sitearch}/*.egg-info +%{python2_sitearch}/PAM.so +%{python2_sitearch}/*.egg-info %license COPYING %doc AUTHORS NEWS README ChangeLog INSTALL %doc examples @@ -116,6 +116,10 @@ popd %endif %changelog +* Sat May 05 2018 Miro Hrončok - 0.5.0-37 +- Update Python macros to new packaging standards + (See https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build) + * Mon Feb 19 2018 Miroslav Suchý 0.5.0-36 - add gcc as buildrequires