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