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#9195f4bdc9a1fbd734f13e65898c6cd336952ca7
This commit is contained in:
parent
449de718b1
commit
2964d173dc
@ -1,38 +0,0 @@
|
||||
From 65b6aac48e167645a1aa75d6a724811fb7e5c775 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
||||
Date: Tue, 26 Nov 2019 11:10:12 +0100
|
||||
Subject: [PATCH] Create hg2/hg3 bin/scripts to keep Py2 & Py3 mercurial
|
||||
co-installable
|
||||
|
||||
This can be removed completely once the mercurial for Python 2 is removed.
|
||||
|
||||
Co-Authored-By: Petr Stodulka <pstodulk@redhat.com>
|
||||
---
|
||||
setup.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 932608b..8663e01 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -196,7 +196,7 @@ def write_if_changed(path, content):
|
||||
fh.write(content)
|
||||
|
||||
|
||||
-scripts = ['hg']
|
||||
+scripts = ['hg' + str(sys.version_info[0])]
|
||||
if os.name == 'nt':
|
||||
# We remove hg.bat if we are able to build hg.exe.
|
||||
scripts.append('contrib/win32/hg.bat')
|
||||
@@ -317,7 +317,7 @@ def findhg():
|
||||
# and disable localization for the same reasons.
|
||||
hgenv['HGPLAIN'] = '1'
|
||||
hgenv['LANGUAGE'] = 'C'
|
||||
- hgcmd = ['hg']
|
||||
+ hgcmd = ['hg' + str(sys.version_info[0])]
|
||||
# Run a simple "hg log" command just to see if using hg from the user's
|
||||
# path works and can successfully interact with this repository. Windows
|
||||
# gives precedence to hg.exe in the current directory, so fall back to the
|
||||
--
|
||||
2.23.0
|
||||
|
121
mercurial.spec
121
mercurial.spec
@ -1,7 +1,7 @@
|
||||
Summary: Mercurial -- a distributed SCM
|
||||
Name: mercurial
|
||||
Version: 5.6.1
|
||||
Release: 4%{?dist}
|
||||
Release: 5%{?dist}
|
||||
|
||||
# Release: 1.rc1%%{?dist}
|
||||
|
||||
@ -12,13 +12,22 @@ License: GPLv2+
|
||||
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: python3-devel bash-completion
|
||||
BuildRequires: emacs-nox emacs-el pkgconfig gettext python3-docutils
|
||||
BuildRequires: bash-completion
|
||||
BuildRequires: emacs-el
|
||||
BuildRequires: emacs-nox
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gettext
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-docutils
|
||||
|
||||
# Priorities for the alternatives system
|
||||
%global py3_priority 30
|
||||
Provides: hg = %{version}-%{release}
|
||||
Requires: python3
|
||||
Requires: emacs-filesystem
|
||||
# TODO: drop these obsoletes in F36
|
||||
Obsoletes: %{name}-py2 < %{version}-%{release}
|
||||
Obsoletes: %{name}-py3 < %{version}-%{release}
|
||||
Obsoletes: %{name}-lang < %{version}-%{release}
|
||||
|
||||
%description
|
||||
Mercurial is a fast, lightweight source control management system designed
|
||||
@ -28,40 +37,11 @@ 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
|
||||
|
||||
%define pkg mercurial
|
||||
|
||||
# If the emacs-el package has installed a pkgconfig file, use that to determine
|
||||
|
||||
|
||||
%package py3
|
||||
Summary: Mercurial -- a distributed SCM (Python 3 version)
|
||||
Provides: hg3 = %{version}-%{release}
|
||||
Provides: hg = %{version}-%{release}
|
||||
Provides: %{name} = %{version}-%{release}
|
||||
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
|
||||
Obsoletes: %{name}-py2 < %{version}-%{release}
|
||||
Requires(post): %{_sbindir}/update-alternatives
|
||||
Requires(preun): %{_sbindir}/update-alternatives
|
||||
|
||||
%description py3
|
||||
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 3 and is obsoleting the Python 2 version.
|
||||
|
||||
|
||||
%package hgk
|
||||
Summary: Hgk interface for mercurial
|
||||
Requires: hg = %{version}-%{release}, tk
|
||||
|
||||
Requires: hg3 = %{version}-%{release}, tk
|
||||
Requires: hg = %{version}-%{release}
|
||||
Requires: tk
|
||||
|
||||
%description hgk
|
||||
A Mercurial extension for displaying the change history graphically
|
||||
@ -78,9 +58,6 @@ documentation.
|
||||
Summary: A fast client for Mercurial command server running on Unix. It saves time of slow Python startup.
|
||||
Requires: hg = %{version}-%{release}
|
||||
|
||||
# Let's default to Python 2, but allow some experiments
|
||||
Suggests: hg3
|
||||
|
||||
%description chg
|
||||
chg is a C wrapper for the hg command. Typically, when you type hg, a new
|
||||
Python process is created, Mercurial is loaded, and your requested command runs
|
||||
@ -91,21 +68,10 @@ Mercurial. When you type chg, a C program connects to that background process
|
||||
and executes Mercurial commands.
|
||||
|
||||
|
||||
%package lang
|
||||
Summary: Locales for mercurial
|
||||
|
||||
%description lang
|
||||
Locales for mercurial.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{upstreamversion}
|
||||
|
||||
%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 hg3
|
||||
rm hg
|
||||
PYTHON=%{python3} make all
|
||||
|
||||
# chg will invoke the 'hg' command - no direct Python dependency
|
||||
@ -116,7 +82,7 @@ popd
|
||||
%install
|
||||
# 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
|
||||
%{python3} setup.py install -O1 --root %{buildroot} --prefix %{_prefix} --record=%{name}.files
|
||||
make install-doc DESTDIR=%{buildroot} MANDIR=%{_mandir}
|
||||
|
||||
grep -v -e 'hgk.py*' \
|
||||
@ -125,8 +91,8 @@ grep -v -e 'hgk.py*' \
|
||||
-e "%{python3_sitearch}/hgext3rd/" \
|
||||
-e "%{python3_sitearch}/hgdemandimport/" \
|
||||
-e "%{_bindir}" \
|
||||
< %{name}3.files > %{name}3-base.files
|
||||
grep 'hgk.py*' < %{name}3.files > %{name}3-hgk.files
|
||||
< %{name}.files > %{name}-base.files
|
||||
grep 'hgk.py*' < %{name}.files > %{name}-hgk.files
|
||||
|
||||
install -D -m 755 contrib/hgk %{buildroot}%{_libexecdir}/mercurial/hgk
|
||||
install -m 755 contrib/hg-ssh %{buildroot}%{_bindir}
|
||||
@ -178,40 +144,13 @@ install -m 644 certs.rc %{buildroot}%{_sysconfdir}/mercurial/hgrc.d
|
||||
|
||||
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}3-base.files > %{name}3-base-filtered.files
|
||||
pathfix.py -pni "%{python3}" %{buildroot}%{_bindir}/hg-ssh
|
||||
|
||||
|
||||
# Move hg-ssh aside
|
||||
cp -p %{buildroot}%{_bindir}/hg-ssh %{buildroot}%{_bindir}/hg-ssh3
|
||||
rm %{buildroot}%{_bindir}/hg-ssh
|
||||
pathfix.py -pni "%{python3}" %{buildroot}%{_bindir}/hg-ssh3
|
||||
|
||||
|
||||
# Touch the base executables for alternatives
|
||||
touch %{buildroot}%{_bindir}/hg
|
||||
touch %{buildroot}%{_bindir}/hg-ssh
|
||||
|
||||
%post py3
|
||||
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}/hg3 %{py3_priority} \
|
||||
--slave %{_bindir}/hg-ssh hg-ssh %{_bindir}/hg-ssh3 || :
|
||||
|
||||
%preun py3
|
||||
if [ $1 -eq 0 ]; then
|
||||
%{_sbindir}/update-alternatives --remove \
|
||||
hg %{_bindir}/hg3 || :
|
||||
fi
|
||||
|
||||
%files py3 -f %{name}3-base-filtered.files
|
||||
%files -f %{name}-base.files -f hg.lang
|
||||
%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
|
||||
@ -227,14 +166,12 @@ fi
|
||||
%{python3_sitearch}/hgdemandimport/
|
||||
%{_emacs_sitelispdir}/mercurial
|
||||
%{_emacs_sitestartdir}/*.el
|
||||
%ghost %{_bindir}/hg
|
||||
%ghost %{_bindir}/hg-ssh
|
||||
%{_bindir}/hg3
|
||||
%{_bindir}/hg-ssh3
|
||||
%{_bindir}/hg
|
||||
%{_bindir}/hg-ssh
|
||||
|
||||
%config(noreplace) %{_sysconfdir}/mercurial/hgrc.d/certs.rc
|
||||
|
||||
%files hgk -f %{name}3-hgk.files
|
||||
%files hgk -f %{name}-hgk.files
|
||||
%{_libexecdir}/mercurial/
|
||||
%{_sysconfdir}/mercurial/hgrc.d/hgk.rc
|
||||
|
||||
@ -242,8 +179,6 @@ fi
|
||||
%{_bindir}/chg
|
||||
%doc %attr(644,root,root) %{_mandir}/man?/chg.*.gz
|
||||
|
||||
%files lang -f hg.lang
|
||||
|
||||
|
||||
#%%check
|
||||
# This will now fail everytime. Mercurial is not ported properly for Python3
|
||||
@ -253,6 +188,12 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Sun Jan 3 03:39:35 CET 2021 Mads Kiilerich <mads@kiilerich.com> - 5.6.1-5
|
||||
- Stop providing hg3 - that is the only hg we have
|
||||
- Drop alternatives - there is no alternative
|
||||
- Move main package back to mercurial without py3 suffix
|
||||
- Drop the -lang package
|
||||
|
||||
* 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
|
||||
|
Loading…
Reference in New Issue
Block a user