diff --git a/python-simplevisor.spec b/python-simplevisor.spec index 284fa0f..5ec489b 100644 --- a/python-simplevisor.spec +++ b/python-simplevisor.spec @@ -1,15 +1,12 @@ %if 0%{?fedora} > 12 || 0%{?rhel} > 7 %global with_python3 1 %endif -%if 0%{?rhel} == 5 -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} -%endif %global srcname simplevisor Name: python-simplevisor Version: 1.2 -Release: 11%{?dist} +Release: 12%{?dist} Summary: Python simple daemons supervisor Group: Development/Libraries License: ASL 2.0 @@ -72,7 +69,7 @@ find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' %endif # with_python3 %build -%{__python} setup.py build +%{__python2} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build @@ -81,7 +78,7 @@ popd %install rm -fr $RPM_BUILD_ROOT -%{__python} setup.py install --with-data-files --skip-build --root $RPM_BUILD_ROOT +%{__python2} setup.py install --with-data-files --skip-build --root $RPM_BUILD_ROOT install -D -m 644 man/%{srcname}.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{srcname}.1; install -D -m 644 man/%{srcname}-control.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{srcname}-control.1; install -D -m 644 man/%{srcname}-loop.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{srcname}-loop.1; @@ -100,16 +97,7 @@ mv $RPM_BUILD_ROOT/usr/bin/simplevisor2 $RPM_BUILD_ROOT/usr/bin/simplevisor %endif # with_python3 %check -%if 0%{?rhel} == 5 -# syslog in el5 is not configured, workaround for simplevisor-loop -# in order to pass the tests, does not affect functionality during test -mkdir Sys -cp `find %{_libdir}/perl5/5*/ -name "Syslog.pm"` Sys/Syslog.pm -sed -i "s/^.*grep { \$_ ne 'udp' }.*$/# noop/" Sys/Syslog.pm -sed -i "s/^.*udp connect: nobody listening.*$/return 1;/g" Sys/Syslog.pm -export PERL5LIB=.:${PERL5LIB} -%endif -%{__python} setup.py test +%{__python2} setup.py test # And remove compiled documentation. rm -f test/*.pyc %if 0%{?with_python3} @@ -127,10 +115,8 @@ popd %attr(755, root, root) /usr/bin/simplevisor %attr(755, root, root) /usr/bin/simplevisor-control %attr(755, root, root) /usr/bin/simplevisor-loop -%{python_sitelib}/%{srcname}/ -%if 0%{?rhel} != 5 -%{python_sitelib}/%{srcname}-%{version}-py?.?.egg-info -%endif +%{python2_sitelib}/%{srcname}/ +%{python2_sitelib}/%{srcname}-%{version}-py?.?.egg-info %if 0%{?with_python3} %files -n python3-simplevisor @@ -146,6 +132,9 @@ popd %endif # with_python3 %changelog +* Mon Jul 23 2018 Lionel Cons - 1.2-12 +- Fixed building using Python 2 (#1605914). + * Sat Jul 14 2018 Fedora Release Engineering - 1.2-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild