From a4e1f7471cca635b78f92e68b793f5988f2289e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Poho=C5=99elsk=C3=BD?= Date: Fri, 29 Jul 2022 15:18:51 +0200 Subject: [PATCH] New release Mercurial 6.2 Resolves: rhbz#2089849 --- blacklist | 1 + mercurial.spec | 189 ++++++++++++++++++++++++++ sources | 1 + ssl_another_fix_python36_compat.patch | 28 ++++ ssl_fix_python36_compat.patch | 28 ++++ 5 files changed, 247 insertions(+) create mode 100644 blacklist create mode 100644 mercurial.spec create mode 100644 sources create mode 100644 ssl_another_fix_python36_compat.patch create mode 100644 ssl_fix_python36_compat.patch diff --git a/blacklist b/blacklist new file mode 100644 index 0000000..3832492 --- /dev/null +++ b/blacklist @@ -0,0 +1 @@ +test-stdio.py diff --git a/mercurial.spec b/mercurial.spec new file mode 100644 index 0000000..7cee6e2 --- /dev/null +++ b/mercurial.spec @@ -0,0 +1,189 @@ +Summary: A fast, lightweight Source Control Management system +Name: mercurial +Version: 6.2 +Release: 1%{?dist} + +# Release: 1.rc1%%{?dist} + +%define upstreamversion %{version} + +License: GPLv2+ +URL: https://mercurial-scm.org/ +Source0: https://www.mercurial-scm.org/release/%{name}-%{upstreamversion}.tar.gz +Source1: mercurial-site-start.el +Source2: blacklist +# Patch to fix errors in the testsuite with Python 3.6 +Patch0: ssl_fix_python36_compat.patch +Patch1: ssl_another_fix_python36_compat.patch +BuildRequires: make +BuildRequires: bash-completion +BuildRequires: emacs-el +BuildRequires: emacs-nox +BuildRequires: gcc +BuildRequires: gettext +BuildRequires: pkgconfig +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-docutils + +Provides: hg = %{version}-%{release} +Requires: python3 <= 3.9 +Requires: emacs-filesystem +Recommends: python3-fb-re2 + +%description +Mercurial is a fast, lightweight source control management system designed +for efficient handling of very large distributed projects. + +Quick start: https://www.mercurial-scm.org/wiki/QuickStart +Tutorial: https://www.mercurial-scm.org/wiki/Tutorial +Extensions: https://www.mercurial-scm.org/wiki/UsingExtensions + + +%package hgk +Summary: Hgk interface for mercurial +Requires: hg = %{version}-%{release} +Requires: tk + +%description hgk +A Mercurial extension for displaying the change history graphically +using Tcl/Tk. Displays branches and merges in an easily +understandable way and shows diffs for each revision. Based on +gitk for the git SCM. + +Adds the "hg view" command. See +https://www.mercurial-scm.org/wiki/HgkExtension for more +documentation. + + +%package chg +Summary: A fast Mercurial command without slow Python startup +Requires: hg = %{version}-%{release} + +%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 +and the process exits. + +With chg, a Mercurial command server background process is created that runs +Mercurial. When you type chg, a C program connects to that background process +and executes Mercurial commands. + +%prep +%autosetup -p1 -n %{name}-%{upstreamversion} + +# These are shipped as examples in /usr/share/docs and should not be executable +chmod -x hgweb.cgi contrib/hgweb.fcgi + +%build +FORCE_SETUPTOOLS=1 PYTHON=%{python3} make all + +# chg will invoke the 'hg' command - no direct Python dependency +pushd contrib/chg +make +popd + +%install +%{python3} setup.py install -O1 --root %{buildroot} --prefix %{_prefix} --record=%{name}.files +make install-doc DESTDIR=%{buildroot} MANDIR=%{_mandir} + +grep -v -e 'hgk.py*' \ + -e "%{python3_sitearch}/mercurial/" \ + -e "%{python3_sitearch}/hgext/" \ + -e "%{python3_sitearch}/hgext3rd/" \ + -e "%{python3_sitearch}/hgdemandimport/" \ + -e "%{_bindir}" \ + < %{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} + +bash_completion_dir=%{buildroot}$(pkg-config --variable=completionsdir bash-completion) +mkdir -p $bash_completion_dir +install -m 644 contrib/bash_completion $bash_completion_dir/hg + +zsh_completion_dir=%{buildroot}%{_datadir}/zsh/site-functions +mkdir -p $zsh_completion_dir +install -m 644 contrib/zsh_completion $zsh_completion_dir/_mercurial + +mkdir -p %{buildroot}%{_emacs_sitelispdir}/mercurial + +pushd contrib +for file in mercurial.el mq.el; do + #emacs -batch -l mercurial.el --no-site-file -f batch-byte-compile $file + %{_emacs_bytecompile} $file + install -p -m 644 $file ${file}c %{buildroot}%{_emacs_sitelispdir}/mercurial + rm ${file}c +done +popd + +pushd contrib/chg +make install DESTDIR=%{buildroot} PREFIX=%{_usr} MANDIR=%{_mandir}/man1 +popd + + +mkdir -p %{buildroot}%{_sysconfdir}/mercurial/hgrc.d + +mkdir -p %{buildroot}%{_emacs_sitestartdir} && install -m644 %SOURCE1 %{buildroot}%{_emacs_sitestartdir} + +cat >hgk.rc < certs.rc < - 6.2-1 +- New release Mercurial 6.2 +- Resolves: rhbz#2089849 \ No newline at end of file diff --git a/sources b/sources new file mode 100644 index 0000000..de611ef --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (mercurial-6.2.tar.gz) = 0c988a558e60ba456196420dcf720558f6ce63fcc42bf43a8f6af16289b5f2a81738a4c038a620040394215e3e57ba254ee56fa072962f7bd0b3b191d8334fef diff --git a/ssl_another_fix_python36_compat.patch b/ssl_another_fix_python36_compat.patch new file mode 100644 index 0000000..618a4f0 --- /dev/null +++ b/ssl_another_fix_python36_compat.patch @@ -0,0 +1,28 @@ +# HG changeset patch +# User Ondrej Pohorelsky +# Date 1657729660 -7200 +# Wed Jul 13 18:27:40 2022 +0200 +# Node ID 5f95d1ae2fcefd1d6b81cbba9355198fc6bc073f +# Parent 259df3e3152c1fbb4d95c2fab682ca93581cf9ca +# EXP-Topic ssl-another-fix-python36-compat +sslutil: another use proper attribute to select python 3.7+ + +The previous attribute was python 3.6+, but guarded a python 3.7+ block + +Using the correct attribute avoids: ++ File "/tmp/hgtests.bc0_uk2d/install/lib/python/mercurial/sslutil.py", line 577, in wrapserversocket ++ sslcontext.minimum_version = ssl.TLSVersion.TLSv1_1 ++ AttributeError: module 'ssl' has no attribute 'TLSVersion' + +diff -r 259df3e3152c -r 5f95d1ae2fce mercurial/sslutil.py +--- a/mercurial/sslutil.py Mon Jul 11 09:54:40 2022 +0200 ++++ b/mercurial/sslutil.py Wed Jul 13 18:27:40 2022 +0200 +@@ -546,7 +546,7 @@ + _(b'referenced certificate file (%s) does not exist') % f + ) + +- if util.safehasattr(ssl, 'PROTOCOL_TLS_SERVER'): ++ if util.safehasattr(ssl, 'TLSVersion'): + # python 3.7+ + sslcontext = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) + sslcontext.options |= getattr(ssl, 'OP_NO_COMPRESSION', 0) diff --git a/ssl_fix_python36_compat.patch b/ssl_fix_python36_compat.patch new file mode 100644 index 0000000..3956a9a --- /dev/null +++ b/ssl_fix_python36_compat.patch @@ -0,0 +1,28 @@ +# HG changeset patch +# User Mathias De Mare +# Date 1657634393 -7200 +# Tue Jul 12 15:59:53 2022 +0200 +# Node ID eec5e00e782d83228f3f97f88f4bcf3d10b2ea1b +# Parent 259df3e3152c1fbb4d95c2fab682ca93581cf9ca +# EXP-Topic ssl-fix-python36-compat +sslutil: use proper attribute to select python 3.7+ + +The previous attribute was python 3.6+, but guarded a python 3.7+ block. + +Using the correct attribute avoids: + File "/usr/lib64/python3.6/site-packages/mercurial/sslutil.py", line 334, in wrapsocket + sslcontext.minimum_version = ssl.TLSVersion.TLSv1_1 +AttributeError: module 'ssl' has no attribute 'TLSVersion' + +diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py +--- a/mercurial/sslutil.py ++++ b/mercurial/sslutil.py +@@ -312,7 +312,7 @@ + # is loaded and contains that removed CA, you've just undone the user's + # choice. + +- if util.safehasattr(ssl, 'PROTOCOL_TLS_CLIENT'): ++ if util.safehasattr(ssl, 'TLSVersion'): + # python 3.7+ + sslcontext = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) + minimumprotocol = settings[b'minimumprotocol']