From 902d28db9d71db117e99b1159439ecc9851a021b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
Date: Mon, 18 Apr 2016 15:26:04 +0200
Subject: Provide maybe_command independently

---
 ...Utils-MM-methods-as-standalone-ExtUtils-M.patch | 110 +++++++++++++++++++++
 perl-ExtUtils-MakeMaker.spec                       |  30 +++++-
 2 files changed, 139 insertions(+), 1 deletion(-)
 create mode 100644 
ExtUtils-MakeMaker-7.11-Provide-ExtUtils-MM-methods-as-standalone-ExtUtils-M.patch

diff --git 
a/ExtUtils-MakeMaker-7.11-Provide-ExtUtils-MM-methods-as-standalone-ExtUtils-M.patch
 
b/ExtUtils-MakeMaker-7.11-Provide-ExtUtils-MM-methods-as-standalone-ExtUtils-M.patch
new file mode 100644
index 0000000..d7d92c1
--- /dev/null
+++ 
b/ExtUtils-MakeMaker-7.11-Provide-ExtUtils-MM-methods-as-standalone-ExtUtils-M.patch
@@ -0,0 +1,110 @@
+From e6cefdf6744b6068273a7f24956bb20fe82d4007 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
+Date: Mon, 18 Apr 2016 14:46:20 +0200
+Subject: [PATCH] Provide ExtUtils::MM methods as standalone
+ ExtUtils::MM::Utils
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+If you cannot afford depending on ExtUtils::MakeMaker, you can
+depend on ExtUtils::MM::Utils instead.
+
+<https://bugzilla.redhat.com/show_bug.cgi?id=1129443>
+
+Signed-off-by: Petr Písař <ppi...@redhat.com>
+---
+ MANIFEST                 |  1 +
+ lib/ExtUtils/MM/Utils.pm | 68 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 69 insertions(+)
+ create mode 100644 lib/ExtUtils/MM/Utils.pm
+
+diff --git a/MANIFEST b/MANIFEST
+index 452c152..6d05775 100644
+--- a/MANIFEST
++++ b/MANIFEST
+@@ -41,6 +41,7 @@ lib/ExtUtils/MakeMaker/version/vpp.pm
+ lib/ExtUtils/Mkbootstrap.pm
+ lib/ExtUtils/Mksymlists.pm
+ lib/ExtUtils/MM.pm
++lib/ExtUtils/MM/Utils.pm
+ lib/ExtUtils/MM_AIX.pm
+ lib/ExtUtils/MM_Any.pm
+ lib/ExtUtils/MM_BeOS.pm
+diff --git a/lib/ExtUtils/MM/Utils.pm b/lib/ExtUtils/MM/Utils.pm
+new file mode 100644
+index 0000000..6bbc0d8
+--- /dev/null
++++ b/lib/ExtUtils/MM/Utils.pm
+@@ -0,0 +1,68 @@
++package ExtUtils::MM::Utils;
++
++require 5.006;
++
++use strict;
++use vars qw($VERSION);
++$VERSION = '7.11_06';
++$VERSION = eval $VERSION;  ## no critic 
[BuiltinFunctions::ProhibitStringyEval]
++
++=head1 NAME
++
++ExtUtils::MM::Utils - ExtUtils::MM methods without dependency on 
ExtUtils::MakeMaker
++
++=head1 SYNOPSIS
++
++    require ExtUtils::MM::Utils;
++    MM->maybe_command($file);
++
++=head1 DESCRIPTION
++
++This is a collection of L<ExtUtils::MM> subroutines that are used by many
++other modules but that do not need full-featured L<ExtUtils::MakeMaker>. The
++issue with L<ExtUtils::MakeMaker> is it pulls in Perl header files and that is
++an overkill for small subroutines.
++
++An example is the L<IPC::Cmd> that caused installing GCC just because of
++three-line I<maybe_command()> from L<ExtUtils::MM_Unix>.
++
++The intentions is to use L<ExtUtils::MM::Utils> instead of
++L<ExtUtils::MakeMaker> for these trivial methods. You can still call them via
++L<MM> class name.
++
++=head1 METHODS
++
++=over 4
++
++=item maybe_command
++
++Returns true, if the argument is likely to be a command.
++
++=cut
++
++if (!exists $INC{'ExtUtils/MM.pm'}) {
++    *MM::maybe_command = *ExtUtils::MM::maybe_command = \&maybe_command;
++}
++
++sub maybe_command {
++    my($self,$file) = @_;
++    return $file if -x $file && ! -d $file;
++    return;
++}
++
++1;
++
++=back
++
++=head1 BUGS
++
++These methods are copied from L<ExtUtils::MM_Unix>. Other operating systems
++are not supported yet. The reason is this
++L<a hack for Linux
++distributions|https://bugzilla.redhat.com/show_bug.cgi?id=1129443>.
++
++=head1 SEE ALSO
++
++L<ExtUtils::MakeMaker>, L<ExtUtils::MM>
++
++=cut
+-- 
+2.5.5
+
diff --git a/perl-ExtUtils-MakeMaker.spec b/perl-ExtUtils-MakeMaker.spec
index 87d81ca..1efde92 100644
--- a/perl-ExtUtils-MakeMaker.spec
+++ b/perl-ExtUtils-MakeMaker.spec
@@ -3,7 +3,7 @@
 
 Name:           perl-%{cpan_name}
 Version:        %(echo '%{cpan_version}' | tr _ .)
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Create a module Makefile
 License:        GPL+ or Artistic
 Group:          Development/Libraries
@@ -18,6 +18,8 @@ Patch1:         
%{cpan_name}-7.08-Link-to-libperl-explicitly-on-Linux.patch
 Patch2:         %{cpan_name}-7.04-Unbundle-version.patch
 # Unbundle Encode::Locale module
 Patch3:         %{cpan_name}-7.00-Unbundle-Encode-Locale.patch
+# Provide maybe_command independently, bug #1129443
+Patch4:         
%{cpan_name}-7.11-Provide-ExtUtils-MM-methods-as-standalone-ExtUtils-M.patch
 BuildArch:      noarch
 BuildRequires:  coreutils
 BuildRequires:  findutils
@@ -131,12 +133,26 @@ This Perl module is used to replace common UNIX commands. 
In all cases the
 functions work with @ARGV rather than taking arguments. This makes them
 easier to deal with in Makefiles.
 
+%package -n perl-ExtUtils-MM-Utils
+Summary:        ExtUtils::MM methods without dependency on ExtUtils::MakeMaker
+License:        GPL+ or Artistic
+Group:          Development/Libraries
+BuildArch:      noarch
+Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
+
+%description -n perl-ExtUtils-MM-Utils
+This is a collection of ExtUtils::MM subroutines that are used by many
+other modules but that do not need full-featured ExtUtils::MakeMaker. The
+issue with ExtUtils::MakeMaker is it pulls in Perl header files and that
+is an overkill for small subroutines.
+
 %prep
 %setup -q -n ExtUtils-MakeMaker-%{cpan_version}
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 # Remove bundled modules
 rm -rf bundled
 sed -i -e '/^bundled\// d' MANIFEST
@@ -164,16 +180,28 @@ make test
 %{_bindir}/*
 %{perl_vendorlib}/*
 %exclude %{perl_vendorlib}/ExtUtils/Command.pm
+%exclude %dir %{perl_vendorlib}/ExtUtils/MM
+%exclude %{perl_vendorlib}/ExtUtils/MM/Utils.pm
 %{_mandir}/man1/*
 %{_mandir}/man3/*
 %exclude %{_mandir}/man3/ExtUtils::Command.*
+%exclude %{_mandir}/man3/ExtUtils::MM::Utils.*
 
 %files -n perl-ExtUtils-Command
 %dir %{perl_vendorlib}/ExtUtils
 %{perl_vendorlib}/ExtUtils/Command.pm
 %{_mandir}/man3/ExtUtils::Command.*
 
+%files -n perl-ExtUtils-MM-Utils
+%dir %{perl_vendorlib}/ExtUtils
+%dir %{perl_vendorlib}/ExtUtils/MM
+%{perl_vendorlib}/ExtUtils/MM/Utils.pm
+%{_mandir}/man3/ExtUtils::MM::Utils.*
+
 %changelog
+* Fri May 06 2016 Petr Pisar <ppi...@redhat.com> - 7.10-4
+- Provide maybe_command independently (bug #1129443)
+
 * Thu Feb 04 2016 Fedora Release Engineering <rel...@fedoraproject.org> - 
7.10-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
 
-- 
cgit v0.12


        
http://pkgs.fedoraproject.org/cgit/perl-ExtUtils-MakeMaker.git/commit/?h=f24&id=902d28db9d71db117e99b1159439ecc9851a021b
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@lists.fedoraproject.org
http://lists.fedoraproject.org/admin/lists/perl-devel@lists.fedoraproject.org

Reply via email to