diff --git a/mercurial.spec b/mercurial.spec index 1105d61..7338d10 100644 --- a/mercurial.spec +++ b/mercurial.spec @@ -1,9 +1,9 @@ -%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%{!?python2_sitearch: %define python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python2_lib; print get_python2_lib(1)")} Summary: Mercurial -- a distributed SCM Name: mercurial Version: 4.4.2 -Release: 5%{?dist} +Release: 6%{?dist} # Release: 1.rc1%{?dist} @@ -58,16 +58,18 @@ documentation. %setup -q -n %{name}-%{upstreamversion} #%patch0 -p0 #%patch1 -p1 +# Patch files to use python2 instead of (since lately) non existent python binary. +sed -i 's|python|python2|' %{_builddir}/%{name}-%{version}/Makefile %{_builddir}/%{name}-%{version}/doc/Makefile %build make all %install rm -rf $RPM_BUILD_ROOT -%{__python} setup.py install -O1 --root $RPM_BUILD_ROOT --prefix %{_prefix} --record=%{name}.files +%{__python2} setup.py install -O1 --root $RPM_BUILD_ROOT --prefix %{_prefix} --record=%{name}.files make install-doc DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} -grep -v -e 'hgk.py*' -e %{python_sitearch}/mercurial/ -e %{python_sitearch}/hgext/ < %{name}.files > %{name}-base.files +grep -v -e 'hgk.py*' -e %{python2_sitearch}/mercurial/ -e %{python2_sitearch}/hgext/ < %{name}.files > %{name}-base.files grep 'hgk.py*' < %{name}.files > %{name}-hgk.files install -D -m 755 contrib/hgk $RPM_BUILD_ROOT%{_libexecdir}/mercurial/hgk @@ -115,8 +117,8 @@ cacerts = /etc/pki/tls/certs/ca-bundle.crt EOF install -m 644 certs.rc $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d -mv $RPM_BUILD_ROOT%{python_sitearch}/mercurial/locale $RPM_BUILD_ROOT%{_datadir}/locale -rm -rf $RPM_BUILD_ROOT%{python_sitearch}/mercurial/locale +mv $RPM_BUILD_ROOT%{python2_sitearch}/mercurial/locale $RPM_BUILD_ROOT%{_datadir}/locale +rm -rf $RPM_BUILD_ROOT%{python2_sitearch}/mercurial/locale %find_lang hg @@ -134,8 +136,8 @@ grep -v locale %{name}-base.files > %{name}-base-filtered.files %{_datadir}/zsh/site-functions/ %dir %{_sysconfdir}/mercurial %dir %{_sysconfdir}/mercurial/hgrc.d -%{python_sitearch}/mercurial -%{python_sitearch}/hgext +%{python2_sitearch}/mercurial +%{python2_sitearch}/hgext %{_emacs_sitelispdir}/mercurial %{_emacs_sitestartdir}/*.el @@ -149,6 +151,9 @@ grep -v locale %{name}-base.files > %{name}-base-filtered.files ##cd tests && %{__python} run-tests.py %changelog +* Tue Jul 24 2018 Sebastian Kisela - 4.4.2-6 +- Stop using deprecated python macros: https://fedoraproject.org/wiki/Packaging:Python + * Fri Jul 13 2018 Fedora Release Engineering - 4.4.2-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild