Remove Git::LoadCPAN to ensure we use only system perl modules

Git tries very hard to rely on as few non-core modules as possible.  The
few that it does (currently Error and Mail::Address) are bundled.  We've
disabled such bundling since it became an option in 2.17.0.

Go a step further and remove the Git::LoadCPAN wrapper.  This allows
rpm's automatic dependency generator to find and add the needed
requirements.

With this change we can remove the manual 'Requires:' for perl(Error)
and perl(Mail::Address).

'Requires: perl(Error)' in the main git package has been unneeded for
many years.  It was added in edddb83 ("Update to latest upstream
release. Fix some bugs at the same time", 2007-11-27), which was
git-1.5.3.6.  It was needed for 'git svn' and 'git remote'.  'git svn'
requires perl(Git), which in turn requires perl(Error).

In git-1.5.5, 'git remote' was converted to a builtin command in C
rather than perl, removing the perl(Error) dependency.

Lastly, move the 'BuildRequires: perl(Error)' from perl-Git to the main
list of BuildRequires.
This commit is contained in:
Todd Zullinger 2018-04-07 19:21:23 -04:00
parent b3c76729a3
commit b5fac2ab8d

View File

@ -139,6 +139,7 @@ BuildRequires: libsecret-devel
BuildRequires: make
BuildRequires: openssl-devel
BuildRequires: pcre2-devel
BuildRequires: perl(Error)
BuildRequires: perl(Test)
%if 0%{?fedora}
BuildRequires: perl-generators
@ -200,7 +201,6 @@ BuildRequires: time
Requires: git-core = %{version}-%{release}
Requires: git-core-doc = %{version}-%{release}
Requires: perl(Error)
%if ! %{defined perl_bootstrap}
Requires: perl(Term::ReadKey)
%endif
@ -304,7 +304,6 @@ Summary: Git tools for sending patches via email
BuildArch: noarch
Requires: git = %{version}-%{release}, perl-Git = %{version}-%{release}
Requires: perl(Authen::SASL)
Requires: perl(Mail::Address)
Requires: perl(Net::SMTP::SSL)
Requires: perl(Git)
%description email
@ -362,9 +361,7 @@ Requires: git = %{version}-%{release}
%package -n perl-Git
Summary: Perl interface to Git
BuildArch: noarch
BuildRequires: perl(Error)
Requires: git = %{version}-%{release}
Requires: perl(Error)
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
%description -n perl-Git
%{summary}.
@ -480,6 +477,11 @@ EOF
chmod +x %{__perl_requires}
%endif
# Remove Git::LoadCPAN to ensure we use only system perl modules. This also
# allows the dependencies to be automatically processed by rpm.
rm -rf perl/Git/LoadCPAN{.pm,/}
grep -rlZ '^use Git::LoadCPAN::' | xargs -r0 sed -i 's/Git::LoadCPAN:://g'
%build
make %{?_smp_mflags} all %{?with_docs:doc}
@ -886,6 +888,9 @@ make test || ./print-failed-test-output
%{?with_docs:%{_pkgdocdir}/git-svn.html}
%changelog
* Sat Apr 07 2018 Todd Zullinger <tmz@pobox.com>
- Remove Git::LoadCPAN to ensure we use only system perl modules
* Mon Apr 02 2018 Todd Zullinger <tmz@pobox.com>
- Allow git-p4 subpackage to be toggled via --with/--without
- Use %%bcond_(with|without) to enable/disable python3