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