Merge #4 Fix build failures by depending on gcc and using python2

This commit is contained in:
Petr Stodůlka 2018-08-11 17:52:48 +00:00
commit fea968b61b

View File

@ -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}
@ -20,6 +20,7 @@ Source1: mercurial-site-start.el
#Patch1: docutils-0.8.patch
BuildRequires: python2 python2-devel bash-completion
BuildRequires: emacs-nox emacs-el pkgconfig gettext python2-docutils
BuildRequires: gcc
Requires: python2 emacs-filesystem
Provides: hg = %{version}-%{release}
Obsoletes: emacs-mercurial <= 3.4.1, emacs-mercurial-el <= 3.4.1
@ -58,16 +59,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 +118,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
@ -149,6 +152,10 @@ grep -v locale %{name}-base.files > %{name}-base-filtered.files
##cd tests && %{__python} run-tests.py
%changelog
* Tue Jul 24 2018 Sebastian Kisela <skisela@redhat.com> - 4.4.2-6
- Stop using deprecated python macros: https://fedoraproject.org/wiki/Packaging:Python
- Add gcc build time dependency, as gcc was removed from default buildroot package set.
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.4.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild