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