+#
+# Conditional build:
+%bcond_with tests # perform "make test" - working database connection required
+#
%include /usr/lib/rpm/macros.perl
-Summary: Proc-WaitStat perl module
-Summary(pl): Modu³ perla Proc-WaitStat
+%define pdir Proc
+%define pnam WaitStat
+Summary: Proc::WaitStat perl module
+Summary(pl): Modu³ perla Proc::WaitStat
Name: perl-Proc-WaitStat
Version: 1.00
-Release: 1
-License: GPL
+Release: 7
+# same as perl
+License: GPL v1+ or Artistic
Group: Development/Languages/Perl
-Group(pl): Programowanie/Jêzyki/Perl
-Source: ftp://ftp.perl.org/pub/CPAN/modules/by-module/Proc/Proc-WaitStat-%{version}.tar.gz
-BuildRequires: rpm-perlprov >= 3.0.3-16
-BuildRequires: perl >= 5.005_03-14
+Source0: http://www.cpan.org/modules/by-module/%{pdir}/%{pdir}-%{pnam}-%{version}.tar.gz
+# Source0-md5: b911bd579b6b142391b21de1efa30c95
+BuildRequires: rpm-perlprov >= 4.1-13
+BuildRequires: perl-devel >= 5.6
BuildRequires: perl-IPC-Signal
-%requires_eq perl
-Requires: %{perl_sitearch}
-BuildRoot: /tmp/%{name}-%{version}-root
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-Proc-WaitStat module contains functions for interpreting and acting on wait
-status values.
+Proc::WaitStat module contains functions for interpreting and acting on
+wait status values.
%description -l pl
-Modu³ Proc-WaitStat zawiera funkcje do interpretowania warto¶ci zwracanych
-przez wait() i podejmowania okre¶lonych dzia³añ.
-
+Modu³ Proc::WaitStat zawiera funkcje do interpretowania warto¶ci
+zwracanych przez wait() i podejmowania okre¶lonych dzia³añ.
%prep
-%setup -q -n Proc-WaitStat-%{version}
+%setup -q -n %{pdir}-%{pnam}-%{version}
%build
-perl Makefile.PL
-make
+%{__perl} Makefile.PL \
+ INSTALLDIRS=vendor
+%{__make}
+
+%{?with_tests:%{__make} test}
%install
rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-
-(
- cd $RPM_BUILD_ROOT%{perl_sitearch}/auto/Proc/WaitStat
- sed -e "s#$RPM_BUILD_ROOT##" .packlist >.packlist.new
- mv .packlist.new .packlist
-)
-gzip -9nf $RPM_BUILD_ROOT%{_mandir}/man3/* \
- Changes README
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc {Changes,README}.gz
-
-%{perl_sitelib}/Proc/WaitStat.pm
-%{perl_sitearch}/auto/Proc/WaitStat
-
+%doc Changes README
+%{perl_vendorlib}/Proc/WaitStat.pm
%{_mandir}/man3/*