3 %bcond_without tests # do not perform "make test"
6 %define pnam System-Simple
7 Summary: IPC::System::Simple - Run commands simply, with detailed diagnostics
8 Summary(pl.UTF-8): IPC::System::Simple - proste uruchamianie poleceń ze szczegółową diagnostyką
9 Name: perl-IPC-System-Simple
13 License: GPL v1+ or Artistic
14 Group: Development/Languages/Perl
15 Source0: http://www.cpan.org/modules/by-module/IPC/%{pdir}-%{pnam}-%{version}.tar.gz
16 # Source0-md5: e68341fd958fd013b3521d909904f675
17 URL: https://metacpan.org/release/IPC-System-Simple
18 BuildRequires: perl-ExtUtils-MakeMaker >= 6.30
19 BuildRequires: perl-devel >= 1:5.8.0
20 BuildRequires: rpm-perlprov >= 4.1-13
21 BuildRequires: rpmbuild(macros) >= 1.745
23 BuildRequires: perl-Scalar-List-Utils
24 BuildRequires: perl-Test-Simple
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 Calling Perl's in-built system() function is easy, determining if it
31 was successful is hard. Let's face it, $? isn't the nicest variable in
32 the world to play with, and even if you do check it, producing a
33 well-formatted error string takes a lot of work.
35 IPC::System::Simple takes the hard work out of calling external
36 commands. In fact, if you want to be really lazy, you can just write:
38 use IPC::System::Simple qw(system);
40 and all of your system commands will either succeed (run to completion
41 and return a zero exit value), or die with rich diagnostic messages.
43 The IPC::System::Simple module also provides a simple replacement to
44 Perl's backticks operator.
46 %description -l pl.UTF-8
47 Wywołanie wbudowanej funkcji Perla system() jest łatwe, ale
48 stwierdzenie, czy się powiodło, jest trudne. $? nie jest najładniejszą
49 zmienną do obsługi, a nawet jeśli się ją sprawdzi, przygotowanie
50 dobrze sformatowanej informacji o błędzie wymaga dużo pracy.
52 IPC::System::Simple bierze na siebie tę ciężką pracę przy wywoływaniu
53 poleceń zewnętrznych. Będąc naprawdę leniwym, wystarczy napisać:
55 use IPC::System::Simple qw(system);
57 i wszystkie wywołania systemowe albo się powiodą (zakończą i zwrócą
58 zerowy kod wyjścia), albo zakończą śmiercią ze szczegółowym
59 komunikatem diagnostycznym.
61 Moduł IPC::System::Simple udostępnia także prosty zamiennik operatora
65 %setup -q -n %{pdir}-%{pnam}-%{version}
68 %{__perl} Makefile.PL \
72 %{?with_tests:%{__make} test}
75 rm -rf $RPM_BUILD_ROOT
77 %{__make} pure_install \
78 DESTDIR=$RPM_BUILD_ROOT
80 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
81 cp -a examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
84 rm -rf $RPM_BUILD_ROOT
87 %defattr(644,root,root,755)
89 %{perl_vendorlib}/IPC/System/Simple.pm
90 %{_mandir}/man3/IPC::System::Simple.3pm*
91 %{_examplesdir}/%{name}-%{version}