Blame SOURCES/ExtUtils-MakeMaker-7.11-Provide-ExtUtils-MM-methods-as-standalone-ExtUtils-M.patch

3970c2
From e6cefdf6744b6068273a7f24956bb20fe82d4007 Mon Sep 17 00:00:00 2001
3970c2
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
3970c2
Date: Mon, 18 Apr 2016 14:46:20 +0200
3970c2
Subject: [PATCH] Provide ExtUtils::MM methods as standalone
3970c2
 ExtUtils::MM::Utils
3970c2
MIME-Version: 1.0
3970c2
Content-Type: text/plain; charset=UTF-8
3970c2
Content-Transfer-Encoding: 8bit
3970c2
3970c2
If you cannot afford depending on ExtUtils::MakeMaker, you can
3970c2
depend on ExtUtils::MM::Utils instead.
3970c2
3970c2
<https://bugzilla.redhat.com/show_bug.cgi?id=1129443>
3970c2
3970c2
Signed-off-by: Petr Písař <ppisar@redhat.com>
3970c2
---
3970c2
 MANIFEST                 |  1 +
3970c2
 lib/ExtUtils/MM/Utils.pm | 68 ++++++++++++++++++++++++++++++++++++++++++++++++
3970c2
 2 files changed, 69 insertions(+)
3970c2
 create mode 100644 lib/ExtUtils/MM/Utils.pm
3970c2
3970c2
diff --git a/MANIFEST b/MANIFEST
3970c2
index 452c152..6d05775 100644
3970c2
--- a/MANIFEST
3970c2
+++ b/MANIFEST
3970c2
@@ -41,6 +41,7 @@ lib/ExtUtils/MakeMaker/version/vpp.pm
3970c2
 lib/ExtUtils/Mkbootstrap.pm
3970c2
 lib/ExtUtils/Mksymlists.pm
3970c2
 lib/ExtUtils/MM.pm
3970c2
+lib/ExtUtils/MM/Utils.pm
3970c2
 lib/ExtUtils/MM_AIX.pm
3970c2
 lib/ExtUtils/MM_Any.pm
3970c2
 lib/ExtUtils/MM_BeOS.pm
3970c2
diff --git a/lib/ExtUtils/MM/Utils.pm b/lib/ExtUtils/MM/Utils.pm
3970c2
new file mode 100644
3970c2
index 0000000..6bbc0d8
3970c2
--- /dev/null
3970c2
+++ b/lib/ExtUtils/MM/Utils.pm
3970c2
@@ -0,0 +1,68 @@
3970c2
+package ExtUtils::MM::Utils;
3970c2
+
3970c2
+require 5.006;
3970c2
+
3970c2
+use strict;
3970c2
+use vars qw($VERSION);
3970c2
+$VERSION = '7.11_06';
3970c2
+$VERSION = eval $VERSION;  ## no critic [BuiltinFunctions::ProhibitStringyEval]
3970c2
+
3970c2
+=head1 NAME
3970c2
+
3970c2
+ExtUtils::MM::Utils - ExtUtils::MM methods without dependency on ExtUtils::MakeMaker
3970c2
+
3970c2
+=head1 SYNOPSIS
3970c2
+
3970c2
+    require ExtUtils::MM::Utils;
3970c2
+    MM->maybe_command($file);
3970c2
+
3970c2
+=head1 DESCRIPTION
3970c2
+
3970c2
+This is a collection of L<ExtUtils::MM> subroutines that are used by many
3970c2
+other modules but that do not need full-featured L<ExtUtils::MakeMaker>. The
3970c2
+issue with L<ExtUtils::MakeMaker> is it pulls in Perl header files and that is
3970c2
+an overkill for small subroutines.
3970c2
+
3970c2
+An example is the L<IPC::Cmd> that caused installing GCC just because of
3970c2
+three-line I<maybe_command()> from L<ExtUtils::MM_Unix>.
3970c2
+
3970c2
+The intentions is to use L<ExtUtils::MM::Utils> instead of
3970c2
+L<ExtUtils::MakeMaker> for these trivial methods. You can still call them via
3970c2
+L<MM> class name.
3970c2
+
3970c2
+=head1 METHODS
3970c2
+
3970c2
+=over 4
3970c2
+
3970c2
+=item maybe_command
3970c2
+
3970c2
+Returns true, if the argument is likely to be a command.
3970c2
+
3970c2
+=cut
3970c2
+
3970c2
+if (!exists $INC{'ExtUtils/MM.pm'}) {
3970c2
+    *MM::maybe_command = *ExtUtils::MM::maybe_command = \&maybe_command;
3970c2
+}
3970c2
+
3970c2
+sub maybe_command {
3970c2
+    my($self,$file) = @_;
3970c2
+    return $file if -x $file && ! -d $file;
3970c2
+    return;
3970c2
+}
3970c2
+
3970c2
+1;
3970c2
+
3970c2
+=back
3970c2
+
3970c2
+=head1 BUGS
3970c2
+
3970c2
+These methods are copied from L<ExtUtils::MM_Unix>. Other operating systems
3970c2
+are not supported yet. The reason is this
3970c2
+L
3970c2
+distributions|https://bugzilla.redhat.com/show_bug.cgi?id=1129443>.
3970c2
+
3970c2
+=head1 SEE ALSO
3970c2
+
3970c2
+L<ExtUtils::MakeMaker>, L<ExtUtils::MM>
3970c2
+
3970c2
+=cut
3970c2
-- 
3970c2
2.5.5
3970c2