2012-12-29 22:54:37 +01:00
|
|
|
#
|
|
|
|
# spec file for package perl-IPC-System-Simple
|
|
|
|
#
|
2020-01-27 16:17:16 +01:00
|
|
|
# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
|
2012-12-29 22:54:37 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2020-01-27 16:17:16 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2012-12-29 22:54:37 +01:00
|
|
|
#
|
|
|
|
|
2010-11-20 14:10:47 +01:00
|
|
|
|
|
|
|
Name: perl-IPC-System-Simple
|
2020-01-27 16:17:16 +01:00
|
|
|
Version: 1.26
|
2010-11-20 14:10:47 +01:00
|
|
|
Release: 0
|
2013-11-25 12:00:36 +01:00
|
|
|
%define cpan_name IPC-System-Simple
|
2010-11-20 14:10:47 +01:00
|
|
|
Summary: Run commands simply, with detailed diagnostics
|
2020-01-27 16:17:16 +01:00
|
|
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
2010-11-20 14:10:47 +01:00
|
|
|
Group: Development/Libraries/Perl
|
2020-01-27 16:17:16 +01:00
|
|
|
Url: https://metacpan.org/release/%{cpan_name}
|
|
|
|
Source0: https://cpan.metacpan.org/authors/id/J/JK/JKEENAN/%{cpan_name}-%{version}.tar.gz
|
|
|
|
Source1: cpanspec.yml
|
2013-11-25 12:00:36 +01:00
|
|
|
BuildArch: noarch
|
2012-12-29 22:54:37 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2010-11-20 14:10:47 +01:00
|
|
|
BuildRequires: perl
|
2010-12-03 15:39:13 +01:00
|
|
|
BuildRequires: perl-macros
|
2013-11-25 12:00:36 +01:00
|
|
|
%{perl_requires}
|
2010-11-20 14:10:47 +01:00
|
|
|
|
|
|
|
%description
|
2013-11-25 12:00:36 +01:00
|
|
|
Calling Perl's in-built 'system()' function is easy, determining if it was
|
|
|
|
successful is _hard_. Let's face it, '$?' isn't the nicest variable in the
|
|
|
|
world to play with, and even if you _do_ check it, producing a
|
2010-11-20 14:10:47 +01:00
|
|
|
well-formatted error string takes a lot of work.
|
2013-11-25 12:00:36 +01:00
|
|
|
|
|
|
|
'IPC::System::Simple' takes the hard work out of calling external commands.
|
|
|
|
In fact, if you want to be really lazy, you can just write:
|
|
|
|
|
|
|
|
use IPC::System::Simple qw(system);
|
|
|
|
|
|
|
|
and all of your 'system' commands will either succeed (run to completion
|
|
|
|
and return a zero exit value), or die with rich diagnostic messages.
|
|
|
|
|
|
|
|
The 'IPC::System::Simple' module also provides a simple replacement to
|
|
|
|
Perl's backticks operator. Simply write:
|
|
|
|
|
|
|
|
use IPC::System::Simple qw(capture);
|
|
|
|
|
2020-01-27 16:17:16 +01:00
|
|
|
and then use the capture() command just like you'd use backticks. If
|
|
|
|
there's an error, it will die with a detailed description of what went
|
|
|
|
wrong. Better still, you can even use 'capturex()' to run the equivalent of
|
|
|
|
backticks, but without the shell:
|
2013-11-25 12:00:36 +01:00
|
|
|
|
|
|
|
use IPC::System::Simple qw(capturex);
|
|
|
|
|
|
|
|
my $result = capturex($command, @args);
|
|
|
|
|
|
|
|
If you want more power than the basic interface, including the ability to
|
|
|
|
specify which exit values are acceptable, trap errors, or process
|
|
|
|
diagnostics, then read on!
|
2010-11-20 14:10:47 +01:00
|
|
|
|
|
|
|
%prep
|
2013-11-25 12:00:36 +01:00
|
|
|
%setup -q -n %{cpan_name}-%{version}
|
2020-01-27 16:17:16 +01:00
|
|
|
find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644
|
2010-11-20 14:10:47 +01:00
|
|
|
|
|
|
|
%build
|
2020-01-27 16:17:16 +01:00
|
|
|
perl Makefile.PL INSTALLDIRS=vendor
|
|
|
|
make %{?_smp_mflags}
|
2013-11-25 12:00:36 +01:00
|
|
|
|
|
|
|
%check
|
2020-01-27 16:17:16 +01:00
|
|
|
make test
|
2010-11-20 14:10:47 +01:00
|
|
|
|
|
|
|
%install
|
|
|
|
%perl_make_install
|
|
|
|
%perl_process_packlist
|
2013-11-25 12:00:36 +01:00
|
|
|
%perl_gen_filelist
|
2010-11-20 14:10:47 +01:00
|
|
|
|
2013-11-25 12:00:36 +01:00
|
|
|
%files -f %{name}.files
|
|
|
|
%defattr(-,root,root,755)
|
2020-01-27 16:17:16 +01:00
|
|
|
%doc Changes examples README
|
|
|
|
%license LICENSE
|
2010-11-20 14:10:47 +01:00
|
|
|
|
2012-12-29 22:54:37 +01:00
|
|
|
%changelog
|