diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..55a6f71 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/Monkey-Patch-0.03.tar.gz diff --git a/01_fix_pod.patch b/01_fix_pod.patch new file mode 100644 index 0000000..c39ba79 --- /dev/null +++ b/01_fix_pod.patch @@ -0,0 +1,82 @@ +# Some of the infrastructure clases do not provide proper POD +# documentation, thus preventing the availability of man pages for them. +# This patch adds a minimal POD fragment describing the purpose of these +# infrastructural classes. +# Forwarded: https://rt.cpan.org/Ticket/Display.html?id=125746 +# Author: Ernesto Hernández-Novich +--- a/lib/Monkey/Patch/Handle.pm ++++ b/lib/Monkey/Patch/Handle.pm +@@ -111,6 +111,20 @@ + + 1; + ++=head1 NAME ++ ++Monkey::Patch::Handle - Handle for monkey-patched functions ++ ++=head1 DESCRIPTION ++ ++Monkey::Patch::Handle keeps a stack of subroutine references for ++each name (Foo::bar::baz type name), so that the coderef that lives ++at that name is always the top of the stack, and if the wrappers get ++uninstalled in a funky order all hell doesn't break loose. ++ ++You should never need to use this directly, so read L(Monkey::Patch) ++instead. ++ + =pod + + =begin Pod::Coverage +--- a/lib/Monkey/Patch/Handle/Class.pm ++++ b/lib/Monkey/Patch/Handle/Class.pm +@@ -18,6 +18,18 @@ + + 1; + ++=head1 NAME ++ ++Monkey::Patch::Handle::Class - Handle for monkey-patching classes ++ ++=head1 DESCRIPTION ++ ++Monkey::Patch::Handle::Class provides the default Monkey::Patch::Handle ++for monkey-patching a whole class. ++ ++You should never need to use this directly, so read L(Monkey::Patch) ++instead. ++ + =pod + + =begin Pod::Coverage +--- a/lib/Monkey/Patch/Handle/Object.pm ++++ b/lib/Monkey/Patch/Handle/Object.pm +@@ -15,6 +15,18 @@ + + 1; + ++=head1 NAME ++ ++Monkey::Patch::Handle::Object - Handle for monkey-patching objects ++ ++=head1 DESCRIPTION ++ ++Monkey::Patch::Handle::Object provides the default Monkey::Patch::Handle ++for monkey-patching a particular object. ++ ++You should never need to use this directly, so read L(Monkey::Patch) ++instead. ++ + =pod + + =begin Pod::Coverage +--- a/lib/Monkey/Patch.pm ++++ b/lib/Monkey/Patch.pm +@@ -85,7 +85,7 @@ + =head2 patch_package (package, subname, code) + + Wraps C's subroutine named with your . Your code +-recieves the original subroutine as its first argument, followed by any ++receives the original subroutine as its first argument, followed by any + arguments the subroutine would have normally gotten. You can always call the + subroutine ref your received; if there was no subroutine by that name, the + coderef will simply do nothing. diff --git a/README.md b/README.md deleted file mode 100644 index a8aaf5a..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# perl-Monkey-Patch - -The perl-Monkey-Patch package \ No newline at end of file diff --git a/perl-Monkey-Patch.spec b/perl-Monkey-Patch.spec new file mode 100644 index 0000000..821d8a3 --- /dev/null +++ b/perl-Monkey-Patch.spec @@ -0,0 +1,65 @@ +Name: perl-Monkey-Patch +Version: 0.03 +Release: 1%{?dist} +Summary: Scoped monkey-patching Perl module +License: GPL+ or Artistic +URL: https://metacpan.org/release/Monkey-Patch +Source0: https://cpan.metacpan.org/authors/id/F/FR/FRODWITH/Monkey-Patch-%{version}.tar.gz +BuildArch: noarch +# Module Build +BuildRequires: make +BuildRequires: perl-generators +BuildRequires: perl-interpreter +BuildRequires: perl(ExtUtils::MakeMaker) +# Module Runtime +BuildRequires: perl(strict) +BuildRequires: perl(warnings) +BuildRequires: perl(SUPER) +BuildRequires: perl(Sub::Delete) +# Tests +BuildRequires: perl(Test::More) +# Runtime +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +Requires: perl(SUPER) +Requires: perl(Sub::Delete) +Patch0: 01_fix_pod.patch + +# Avoid doc-file dependency on perl(base) +%{?perl_default_filter} + +%description +Monkey patching is a way to extend or modify the runtime code +of a program or library without altering the original source code. + +Monkey::Patch provides lexical scope monkey-patching so that you can +wrap any other package's subroutine with your own code and still have +access to the original subroutine. + +%prep +%setup -q -n Monkey-Patch-%{version} +%patch0 -p1 + +%build +perl Makefile.PL INSTALLDIRS=vendor +make %{?_smp_mflags} + +%install +make pure_install DESTDIR=%{buildroot} +find %{buildroot} -type f -name .packlist -delete +%{_fixperms} -c %{buildroot} + +%check +make test + +%files +%license LICENSE +%doc CHANGES README +%{perl_vendorlib}/Monkey/ +%{_mandir}/man3/Monkey::Patch.3pm* +%{_mandir}/man3/Monkey::Patch::Handle.3pm* +%{_mandir}/man3/Monkey::Patch::Handle::Class.3pm* +%{_mandir}/man3/Monkey::Patch::Handle::Object.3pm* + +%changelog +* Tue Jul 31 2018 Andrea Veri - 0.03-1 +- Initial package release. diff --git a/sources b/sources new file mode 100644 index 0000000..9049264 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (Monkey-Patch-0.03.tar.gz) = 3f48c9e4ddbba2aef6c451133a00175c9e3c5bbf5fdf50caff25d9be6180fe554e208aa9f20c4e27d2c9fbddce9f910c75b0c9396ec63d313bc276633ebed006