8
0

Accepting request 178995 from home:coolo:update-perl

update

OBS-URL: https://build.opensuse.org/request/show/178995
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Proc-Simple?expand=0&rev=3
This commit is contained in:
Stephan Kulow
2013-06-15 05:57:58 +00:00
committed by Git OBS Bridge
parent 5f692d0013
commit 827e405183
4 changed files with 79 additions and 19 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package shutter
# spec file for package perl-Proc-Simple
#
# Copyright (c) 2011 open-slx GmbH <Sascha.Manns@open-slx.de>
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -15,32 +15,77 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: perl-Proc-Simple
Version: 1.30
Release: 1
License: GPL-1.0+ or Artistic-1.0
Version: 1.31
Release: 0
%define cpan_name Proc-Simple
Summary: Proc::Simple Perl module
Url: http://search.cpan.org/dist/Proc-Simple/
Summary: unknown
License: GPL-1.0+ or Artistic-1.0
Group: Development/Libraries/Perl
#Source: http://www.cpan.org/authors/id/M/MS/MSCHILLI/Proc-Simple-%{version}.tar.gz
Source0: Proc-Simple-%{version}.tar.gz
#BuildArch: noarch
Url: http://search.cpan.org/dist/Proc-Simple/
Source: http://www.cpan.org/authors/id/M/MS/MSCHILLI/%{cpan_name}-%{version}.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
%if 0%{?suse_version} < 1140
Requires: perl = %{perl_version}
%else
#BuildRequires: perl(Proc::Simple)
%{perl_requires}
%endif
%description
Proc::Simple Perl module
The Proc::Simple package provides objects mimicing real-life processes from
a user's point of view. A new process object is created by
$myproc = Proc::Simple->new();
Either external programs or perl subroutines can be launched and controlled
as processes in the background.
A 10-second sleep process, for example, can be launched as an external
program as in
$myproc->start("/bin/sleep 10"); # or
$myproc->start("/bin/sleep", "10");
or as a perl subroutine, as in
sub mysleep { sleep(shift); } # Define mysleep()
$myproc->start(\&mysleep, 10); # Launch it.
or even as
$myproc->start(sub { sleep(10); });
The _start_ Method returns immediately after starting the specified process
in background, i.e. there's no blocking. It returns _1_ if the process has
been launched successfully and _0_ if not.
The _poll_ method checks if the process is still running
$running = $myproc->poll();
and returns _1_ if it is, _0_ if it's not. Finally,
$myproc->kill();
terminates the process by sending it the SIGTERM signal. As an option,
another signal can be specified.
$myproc->kill("SIGUSR1");
sends the SIGUSR1 signal to the running process. _kill_ returns _1_ if it
succeeds in sending the signal, _0_ if it doesn't.
The methods are discussed in more detail in the next section.
A destructor is provided so that a signal can be sent to the forked
processes automatically should the process object be destroyed or if the
process exits. By default this behaviour is turned off (see the
kill_on_destroy and signal_on_destroy methods).
%prep
%setup -q -n %{cpan_name}-%{version}
find . -type f -print0 | xargs -0 chmod 644
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
@@ -56,5 +101,6 @@ Proc::Simple Perl module
%files -f %{name}.files
%defattr(-,root,root,755)
%doc Changes README
%changelog