Trivial removal of py2 package - no cleanup

This commit is contained in:
Mads Kiilerich 2020-12-08 16:50:45 +01:00
parent 016642fa7a
commit 5e341538a4

View File

@ -13,13 +13,12 @@ URL: https://mercurial-scm.org/
Source0: https://www.mercurial-scm.org/release/%{name}-%{upstreamversion}.tar.gz Source0: https://www.mercurial-scm.org/release/%{name}-%{upstreamversion}.tar.gz
Source1: mercurial-site-start.el Source1: mercurial-site-start.el
Patch2: 0001-setup-hg3.patch 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: emacs-nox emacs-el pkgconfig gettext python3-docutils
BuildRequires: gcc BuildRequires: gcc
# Priorities for the alternatives system # Priorities for the alternatives system
%global py3_priority 30 %global py3_priority 30
%global py2_priority 20
%description %description
Mercurial is a fast, lightweight source control management system designed 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 # 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 %package py3
Summary: Mercurial -- a distributed SCM (Python 3 version) Summary: Mercurial -- a distributed SCM (Python 3 version)
Provides: hg3 = %{version}-%{release} Provides: hg3 = %{version}-%{release}
@ -131,11 +104,9 @@ Locales for mercurial.
%build %build
# copy hg to hg2/hg3 to be able to create /usr/bin/hg(2|3) script # copy hg to hg2/hg3 to be able to create /usr/bin/hg(2|3) script
cp -a hg hg2
cp -a hg hg3 cp -a hg hg3
rm hg rm hg
PYTHON=%{python3} make all PYTHON=%{python3} make all
PYTHON=%{python2} make all
# chg will invoke the 'hg' command - no direct Python dependency # chg will invoke the 'hg' command - no direct Python dependency
pushd contrib/chg pushd contrib/chg
@ -146,7 +117,6 @@ popd
# NOTE: this is nasty, but if we want to have parallel Py2/Py3 mercurial.. # NOTE: this is nasty, but if we want to have parallel Py2/Py3 mercurial..
# ignoring now stuff related to *_completion, extensions # 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}3.files
%{python2} setup.py install -O1 --root %{buildroot} --prefix %{_prefix} --record=%{name}2.files
make install-doc DESTDIR=%{buildroot} MANDIR=%{_mandir} make install-doc DESTDIR=%{buildroot} MANDIR=%{_mandir}
grep -v -e 'hgk.py*' \ grep -v -e 'hgk.py*' \
@ -156,15 +126,7 @@ grep -v -e 'hgk.py*' \
-e "%{python3_sitearch}/hgdemandimport/" \ -e "%{python3_sitearch}/hgdemandimport/" \
-e "%{_bindir}" \ -e "%{_bindir}" \
< %{name}3.files > %{name}3-base.files < %{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}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 -D -m 755 contrib/hgk %{buildroot}%{_libexecdir}/mercurial/hgk
install -m 755 contrib/hg-ssh %{buildroot}%{_bindir} install -m 755 contrib/hg-ssh %{buildroot}%{_bindir}
@ -220,15 +182,12 @@ rm -rf %{buildroot}%{python2_sitearch}/mercurial/locale
%find_lang hg %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 grep -v locale %{name}3-base.files > %{name}3-base-filtered.files
# Move hg-ssh aside # Move hg-ssh aside
cp -p %{buildroot}%{_bindir}/hg-ssh %{buildroot}%{_bindir}/hg-ssh2
cp -p %{buildroot}%{_bindir}/hg-ssh %{buildroot}%{_bindir}/hg-ssh3 cp -p %{buildroot}%{_bindir}/hg-ssh %{buildroot}%{_bindir}/hg-ssh3
rm %{buildroot}%{_bindir}/hg-ssh rm %{buildroot}%{_bindir}/hg-ssh
pathfix.py -pni "%{python2}" %{buildroot}%{_bindir}/hg-ssh2
pathfix.py -pni "%{python3}" %{buildroot}%{_bindir}/hg-ssh3 pathfix.py -pni "%{python3}" %{buildroot}%{_bindir}/hg-ssh3
@ -236,22 +195,6 @@ pathfix.py -pni "%{python3}" %{buildroot}%{_bindir}/hg-ssh3
touch %{buildroot}%{_bindir}/hg touch %{buildroot}%{_bindir}/hg
touch %{buildroot}%{_bindir}/hg-ssh 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 %post py3
for fname in %{_bindir}/{hg,hg-ssh}; do for fname in %{_bindir}/{hg,hg-ssh}; do
if [ ! -L "$fname" ]; then if [ ! -L "$fname" ]; then
@ -268,29 +211,6 @@ if [ $1 -eq 0 ]; then
hg %{_bindir}/hg3 || : hg %{_bindir}/hg3 || :
fi 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 %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 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) %{_mandir}/man?/hg*.gz
@ -326,7 +246,6 @@ fi
#%%check #%%check
#cd tests && %%{python2} run-tests.py
# This will now fail everytime. Mercurial is not ported properly for Python3 # This will now fail everytime. Mercurial is not ported properly for Python3
# and current split of mercurial for Py2 and Py3 brings additional problems # and current split of mercurial for Py2 and Py3 brings additional problems
# for extensions then pure Python3 packaging. # for extensions then pure Python3 packaging.