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

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