diff --git a/.gitignore b/.gitignore index e69de29..5195040 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/Unix-Process-1.3101.tar.gz diff --git a/Unix-Process-1.3101-Replace-bin-ps.patch b/Unix-Process-1.3101-Replace-bin-ps.patch new file mode 100644 index 0000000..e421d44 --- /dev/null +++ b/Unix-Process-1.3101-Replace-bin-ps.patch @@ -0,0 +1,78 @@ +From 03428d8d7441ed0d6150ea6194bf4cb0ec3c6f12 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Fri, 21 Jul 2017 13:47:58 +0200 +Subject: [PATCH] Replace /bin/ps +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Petr Písař +--- + Makefile.PL | 4 ++-- + Process.pm | 8 ++++---- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/Makefile.PL b/Makefile.PL +index dc1c433..c4081f5 100644 +--- a/Makefile.PL ++++ b/Makefile.PL +@@ -2,7 +2,7 @@ + + use ExtUtils::MakeMaker; + +-my $ps = $ENV{PS_PATH} || "/bin/ps"; ++my $ps = $ENV{PS_PATH} || "XXX"; + + my $worked = 0; + if( -x $ps ) { +@@ -15,7 +15,7 @@ if( -x $ps ) { + } + + unless( $worked ) { +- warn "this module assumes you have a ps program in /bin/ps\n"; ++ warn "this module assumes you have a ps program in XXX\n"; + warn "you can override it by setting an environment variable,\n"; + warn " e.g. PS_PATH=/usr/local/bin/ps; export PS_PATH\n"; + exit 0; +diff --git a/Process.pm b/Process.pm +index 5b36fdc..109d6eb 100644 +--- a/Process.pm ++++ b/Process.pm +@@ -6,7 +6,7 @@ use Carp; + use IPC::System::Simple qw(capturex); + + our $VERSION = '1.3101'; +-our $PS_PROGRAM = $ENV{PS_PATH} || '/bin/ps'; ++our $PS_PROGRAM = $ENV{PS_PATH} || 'XXX'; + our $AUTOLOAD; + + 1; +@@ -38,7 +38,7 @@ __END__ + + =head1 NAME + +-Unix::Process - Perl extension to get pid info from (/bin/ps). ++Unix::Process - Perl extension to get pid info from (XXX). + + =head1 SYNOPSIS + +@@ -53,14 +53,14 @@ All fields from the ps command can be fetched by calling a function of their + name (see SYNOPSIS). If the pid is not given as an argument to the function, + $$ (cur pid) is assumed. + +-This module is really just a giant AUTOLOAD to interact with the /bin/ps ++This module is really just a giant AUTOLOAD to interact with the XXX + command. I suppose I could be talked into doing something real with it some + day. + + You can manually set the C<$Unix::Process::PS_PROGRAM = "/opt/bin/ps"> by hand, + or you can set C<$ENV{PS_PATH} = "/usr/local/bin/ps">, but you must somehow + instruct Unix::Process on the location of ps. Otherwise, it will guess +-C<"/bin/ps">. ++C<"XXX">. + + =head1 AUTHOR + +-- +2.9.4 + diff --git a/perl-Unix-Process.spec b/perl-Unix-Process.spec new file mode 100644 index 0000000..19bf366 --- /dev/null +++ b/perl-Unix-Process.spec @@ -0,0 +1,55 @@ +Name: perl-Unix-Process +Version: 1.3101 +Release: 1%{?dist} +Summary: Perl extension to get PID information from ps command +License: LGPLv2+ +URL: http://search.cpan.org/dist/Unix-Process/ +Source0: http://www.cpan.org/authors/id/J/JE/JETTERO/Unix-Process-%{version}.tar.gz +# Mark occurrences of /bin/ps +Patch0: Unix-Process-1.3101-Replace-bin-ps.patch +BuildArch: noarch +BuildRequires: make +BuildRequires: perl-generators +BuildRequires: perl-interpreter +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 +BuildRequires: sed +# Run-time: +BuildRequires: perl(Carp) +BuildRequires: perl(IPC::System::Simple) +BuildRequires: perl(strict) +BuildRequires: perl(warnings) +BuildRequires: procps-ng +# Tests: +BuildRequires: perl(Test) +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +Requires: procps-ng + +%description +This is a Perl module that can fetch ps command output fields. + +%prep +%setup -q -n Unix-Process-%{version} +# Correct ps command location +%patch0 -p1 +sed -i -e 's|XXX|%{_bindir}/ps|g' Makefile.PL Process.pm + +%build +perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 +make %{?_smp_mflags} + +%install +make pure_install DESTDIR=$RPM_BUILD_ROOT +%{_fixperms} $RPM_BUILD_ROOT/* + +%check +make test + +%files +# The README does not belong to this distribution +%doc Changes +%{perl_vendorlib}/* +%{_mandir}/man3/* + +%changelog +* Fri Jul 21 2017 Petr Pisar 1.3101-1 +- Specfile autogenerated by cpanspec 1.78. diff --git a/sources b/sources index e69de29..fdaaf6c 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +SHA512 (Unix-Process-1.3101.tar.gz) = 7446a554736f03cbe308de42ad25e2e16489bb74688eda680666bb2b705ef910d413bdb401fefe28f90ecf43df90b9f6487da3f661c59f6f1c098a7ad8e77e8e