Merged update from upstream sources
This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/mercurial.git#29a0f126385e67addf87f93de3c9856d4f661ff6
This commit is contained in:
parent
5731ea600b
commit
324ec9a80d
112
mercurial.spec
112
mercurial.spec
@ -1,7 +1,7 @@
|
||||
Summary: Mercurial -- a distributed SCM
|
||||
Name: mercurial
|
||||
Version: 5.6.1
|
||||
Release: 3%{?dist}
|
||||
Release: 4%{?dist}
|
||||
|
||||
# Release: 1.rc1%%{?dist}
|
||||
|
||||
@ -13,13 +13,12 @@ URL: https://mercurial-scm.org/
|
||||
Source0: https://www.mercurial-scm.org/release/%{name}-%{upstreamversion}.tar.gz
|
||||
Source1: mercurial-site-start.el
|
||||
Patch2: 0001-setup-hg3.patch
|
||||
BuildRequires: python2-devel python3-devel bash-completion
|
||||
BuildRequires: python3-devel bash-completion
|
||||
BuildRequires: emacs-nox emacs-el pkgconfig gettext python3-docutils
|
||||
BuildRequires: gcc
|
||||
|
||||
# Priorities for the alternatives system
|
||||
%global py3_priority 30
|
||||
%global py2_priority 20
|
||||
|
||||
%description
|
||||
Mercurial is a fast, lightweight source control management system designed
|
||||
@ -34,32 +33,6 @@ Extensions: http://www.selenic.com/mercurial/wiki/index.cgi/CategoryExtension
|
||||
# If the emacs-el package has installed a pkgconfig file, use that to determine
|
||||
|
||||
|
||||
%package py2
|
||||
Summary: Mercurial -- a distributed SCM (Python 2 version)
|
||||
Provides: hg2 = %{version}-%{release}
|
||||
Provides: hg = %{version}-%{release}
|
||||
Provides: %{name} = %{version}-%{release}
|
||||
Provides: %{name}%{?_isa} = %{version}-%{release}
|
||||
Requires: python2 emacs-filesystem
|
||||
Requires: %{name}-lang = %{version}-%{release}
|
||||
Obsoletes: emacs-mercurial <= 3.4.1, emacs-mercurial-el <= 3.4.1
|
||||
Obsoletes: %{name} < 5.2-2
|
||||
Conflicts: %{name}-py3 < %{version}-%{release}
|
||||
Requires(post): %{_sbindir}/update-alternatives
|
||||
Requires(preun): %{_sbindir}/update-alternatives
|
||||
|
||||
%description py2
|
||||
Mercurial is a fast, lightweight source control management system designed
|
||||
for efficient handling of very large distributed projects.
|
||||
|
||||
Quick start: http://www.selenic.com/mercurial/wiki/index.cgi/QuickStart
|
||||
Tutorial: http://www.selenic.com/mercurial/wiki/index.cgi/Tutorial
|
||||
Extensions: http://www.selenic.com/mercurial/wiki/index.cgi/CategoryExtension
|
||||
|
||||
This Mercurial runs on Python 2. It's expected to be obsoleted when
|
||||
dependent packages are prepared to use Python 3 by default.
|
||||
|
||||
|
||||
%package py3
|
||||
Summary: Mercurial -- a distributed SCM (Python 3 version)
|
||||
Provides: hg3 = %{version}-%{release}
|
||||
@ -69,7 +42,7 @@ Provides: %{name}%{?_isa} = %{version}-%{release}
|
||||
Requires: python3 emacs-filesystem
|
||||
Requires: %{name}-lang = %{version}-%{release}
|
||||
Obsoletes: emacs-mercurial <= 3.4.1, emacs-mercurial-el <= 3.4.1
|
||||
Conflicts: %{name}-py2 < %{version}-%{release}
|
||||
Obsoletes: %{name}-py2 < %{version}-%{release}
|
||||
Requires(post): %{_sbindir}/update-alternatives
|
||||
Requires(preun): %{_sbindir}/update-alternatives
|
||||
|
||||
@ -81,16 +54,14 @@ Quick start: http://www.selenic.com/mercurial/wiki/index.cgi/QuickStart
|
||||
Tutorial: http://www.selenic.com/mercurial/wiki/index.cgi/Tutorial
|
||||
Extensions: http://www.selenic.com/mercurial/wiki/index.cgi/CategoryExtension
|
||||
|
||||
This Mercurial runs on Python 3. It's expected to obsolete the Python 2 version
|
||||
when dependent packages are prepared to use Python 3 by default.
|
||||
This Mercurial runs on Python 3 and is obsoleting the Python 2 version.
|
||||
|
||||
|
||||
%package hgk
|
||||
Summary: Hgk interface for mercurial
|
||||
Requires: hg = %{version}-%{release}, tk
|
||||
|
||||
# Currently, only installs to python2_sitearch, TODO fix
|
||||
Requires: hg2 = %{version}-%{release}, tk
|
||||
Requires: hg3 = %{version}-%{release}, tk
|
||||
|
||||
%description hgk
|
||||
A Mercurial extension for displaying the change history graphically
|
||||
@ -128,20 +99,16 @@ Locales for mercurial.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{upstreamversion}
|
||||
# NOTE: Use PYTHON envar instead of pathing Makefiles
|
||||
# sed -ri 's|python\b|python2|' %{_builddir}/%{name}-%{version}/Makefile %{_builddir}/%{name}-%{version}/doc/Makefile
|
||||
|
||||
%patch2 -p1 -b .create_hg3
|
||||
|
||||
%build
|
||||
# copy hg to hg2/hg3 to be able to create /usr/bin/hg(2|3) script
|
||||
cp -a hg hg2
|
||||
cp -a hg hg3
|
||||
rm hg
|
||||
PYTHON=%{python3} make all
|
||||
PYTHON=%{python2} make all
|
||||
|
||||
#TODO: Now just for Py2, version for Py3 will need probably more fixes
|
||||
# in installer - and possibly some renames..
|
||||
# chg will invoke the 'hg' command - no direct Python dependency
|
||||
pushd contrib/chg
|
||||
make
|
||||
popd
|
||||
@ -150,7 +117,6 @@ popd
|
||||
# NOTE: this is nasty, but if we want to have parallel Py2/Py3 mercurial..
|
||||
# ignoring now stuff related to *_completion, extensions
|
||||
%{python3} setup.py install -O1 --root %{buildroot} --prefix %{_prefix} --record=%{name}3.files
|
||||
%{python2} setup.py install -O1 --root %{buildroot} --prefix %{_prefix} --record=%{name}2.files
|
||||
make install-doc DESTDIR=%{buildroot} MANDIR=%{_mandir}
|
||||
|
||||
grep -v -e 'hgk.py*' \
|
||||
@ -160,15 +126,7 @@ grep -v -e 'hgk.py*' \
|
||||
-e "%{python3_sitearch}/hgdemandimport/" \
|
||||
-e "%{_bindir}" \
|
||||
< %{name}3.files > %{name}3-base.files
|
||||
grep -v -e 'hgk.py*' \
|
||||
-e "%{python2_sitearch}/mercurial/" \
|
||||
-e "%{python2_sitearch}/hgext/" \
|
||||
-e "%{python2_sitearch}/hgext3rd/" \
|
||||
-e "%{python2_sitearch}/hgdemandimport/" \
|
||||
-e "%{_bindir}" \
|
||||
< %{name}2.files > %{name}2-base.files
|
||||
grep 'hgk.py*' < %{name}3.files > %{name}3-hgk.files
|
||||
grep 'hgk.py*' < %{name}2.files > %{name}2-hgk.files
|
||||
|
||||
install -D -m 755 contrib/hgk %{buildroot}%{_libexecdir}/mercurial/hgk
|
||||
install -m 755 contrib/hg-ssh %{buildroot}%{_bindir}
|
||||
@ -218,22 +176,18 @@ cacerts = /etc/pki/tls/certs/ca-bundle.crt
|
||||
EOF
|
||||
install -m 644 certs.rc %{buildroot}%{_sysconfdir}/mercurial/hgrc.d
|
||||
|
||||
# Despite the original path, locales can be used for Python3 as well
|
||||
mv %{buildroot}%{python2_sitearch}/mercurial/locale %{buildroot}%{_datadir}/locale
|
||||
mv %{buildroot}%{python3_sitearch}/mercurial/locale %{buildroot}%{_datadir}/locale
|
||||
rm -rf %{buildroot}%{python3_sitearch}/mercurial/locale
|
||||
rm -rf %{buildroot}%{python2_sitearch}/mercurial/locale
|
||||
|
||||
%find_lang hg
|
||||
|
||||
grep -v locale %{name}2-base.files > %{name}2-base-filtered.files
|
||||
grep -v locale %{name}3-base.files > %{name}3-base-filtered.files
|
||||
|
||||
|
||||
# Move hg-ssh aside
|
||||
cp -p %{buildroot}%{_bindir}/hg-ssh %{buildroot}%{_bindir}/hg-ssh2
|
||||
cp -p %{buildroot}%{_bindir}/hg-ssh %{buildroot}%{_bindir}/hg-ssh3
|
||||
rm %{buildroot}%{_bindir}/hg-ssh
|
||||
pathfix.py -pni "%{python2}" %{buildroot}%{_bindir}/hg-ssh2
|
||||
pathfix.py -pni "%{python3}" %{buildroot}%{_bindir}/hg-ssh3
|
||||
|
||||
|
||||
@ -241,22 +195,6 @@ pathfix.py -pni "%{python3}" %{buildroot}%{_bindir}/hg-ssh3
|
||||
touch %{buildroot}%{_bindir}/hg
|
||||
touch %{buildroot}%{_bindir}/hg-ssh
|
||||
|
||||
%post py2
|
||||
for fname in %{_bindir}/{hg,hg-ssh}; do
|
||||
if [ ! -L "$fname" ]; then
|
||||
rm -f "$fname"
|
||||
fi
|
||||
done
|
||||
%{_sbindir}/update-alternatives --install %{_bindir}/hg \
|
||||
hg %{_bindir}/hg2 %{py2_priority} \
|
||||
--slave %{_bindir}/hg-ssh hg-ssh %{_bindir}/hg-ssh2 || :
|
||||
|
||||
%preun py2
|
||||
if [ $1 -eq 0 ]; then
|
||||
%{_sbindir}/update-alternatives --remove \
|
||||
hg %{_bindir}/hg2 || :
|
||||
fi
|
||||
|
||||
%post py3
|
||||
for fname in %{_bindir}/{hg,hg-ssh}; do
|
||||
if [ ! -L "$fname" ]; then
|
||||
@ -273,29 +211,6 @@ if [ $1 -eq 0 ]; then
|
||||
hg %{_bindir}/hg3 || :
|
||||
fi
|
||||
|
||||
%files py2 -f %{name}2-base-filtered.files
|
||||
%doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi contrib/*.wsgi
|
||||
%doc %attr(644,root,root) %{_mandir}/man?/hg*.gz
|
||||
%doc %attr(644,root,root) contrib/*.svg
|
||||
%dir %{_datadir}/zsh/
|
||||
%dir %{_datadir}/zsh/site-functions/
|
||||
%dir %{_sysconfdir}/mercurial
|
||||
%dir %{_sysconfdir}/mercurial/hgrc.d
|
||||
%{_datadir}/bash-completion/
|
||||
%{_datadir}/zsh/site-functions/_mercurial
|
||||
%{python2_sitearch}/mercurial/
|
||||
%{python2_sitearch}/hgext/
|
||||
%{python2_sitearch}/hgext3rd/
|
||||
%{python2_sitearch}/hgdemandimport/
|
||||
%{_emacs_sitelispdir}/mercurial
|
||||
%{_emacs_sitestartdir}/*.el
|
||||
%ghost %{_bindir}/hg
|
||||
%ghost %{_bindir}/hg-ssh
|
||||
%{_bindir}/hg2
|
||||
%{_bindir}/hg-ssh2
|
||||
|
||||
%config(noreplace) %{_sysconfdir}/mercurial/hgrc.d/certs.rc
|
||||
|
||||
%files py3 -f %{name}3-base-filtered.files
|
||||
%doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi contrib/*.wsgi
|
||||
%doc %attr(644,root,root) %{_mandir}/man?/hg*.gz
|
||||
@ -319,7 +234,7 @@ fi
|
||||
|
||||
%config(noreplace) %{_sysconfdir}/mercurial/hgrc.d/certs.rc
|
||||
|
||||
%files hgk -f %{name}2-hgk.files
|
||||
%files hgk -f %{name}3-hgk.files
|
||||
%{_libexecdir}/mercurial/
|
||||
%{_sysconfdir}/mercurial/hgrc.d/hgk.rc
|
||||
|
||||
@ -331,7 +246,6 @@ fi
|
||||
|
||||
|
||||
#%%check
|
||||
#cd tests && %%{python2} run-tests.py
|
||||
# This will now fail everytime. Mercurial is not ported properly for Python3
|
||||
# and current split of mercurial for Py2 and Py3 brings additional problems
|
||||
# for extensions then pure Python3 packaging.
|
||||
@ -339,6 +253,14 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Dec 8 17:14:14 CET 2020 Mads Kiilerich <mads@kiilerich.com> - 5.6.1-4
|
||||
- Change mercurial-hgk to use py3
|
||||
- Use py3 for locales - py2 is going away
|
||||
- Clarify in comment that chg has no py2/py3 concerns
|
||||
- Drop comment left over from 53899096 when it introduced use of PYTHON=
|
||||
- Let mercurial-py3 obsolete mercurial-py2 - it is going away soon
|
||||
- Trivial removal of py2 package - no cleanup
|
||||
|
||||
* Sat Dec 5 14:50:30 CET 2020 Mads Kiilerich <mads@kiilerich.com> - 5.6.1-3
|
||||
- Fix ownership of hgext3rd and hgdemandimport (#1897681)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user