-%define perl_sitelib %(eval "`perl -V:installsitelib`"; echo $installsitelib)
-Summary: Net-Whois perl module
-Summary(pl): Modu³ perla Net-Whois
+#
+# Conditional build:
+%bcond_with tests # perform "make test" (uses network!)
+#
+%include /usr/lib/rpm/macros.perl
+%define pdir Net
+%define pnam Whois
+Summary: Net::Whois perl module
+Summary(pl.UTF-8): Moduł perla Net::Whois
Name: perl-Net-Whois
-Version: 0.23
-Release: 3
-Copyright: GPL
+Version: 1.9
+Release: 9
+# 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/Net/Net-Whois-%{version}.tar.gz
-BuildRequires: perl >= 5.005_03-10
-%requires_eq perl
-Requires: %{perl_sitearch}
-BuildRoot: /tmp/%{name}-%{version}-root
+Source0: http://www.cpan.org/modules/by-module/%{pdir}/%{pdir}-%{pnam}-%{version}.tar.gz
+# Source0-md5: c461a0f8991d9df848f66c4189971af7
+BuildRequires: rpm-perlprov >= 4.1-13
+BuildRequires: perl-devel >= 1:5.8.0
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-Net-Whois - Get and parse "whois" data from InterNIC.
+Net::Whois - Get and parse "whois" data from InterNIC.
-%description -l pl
-Net-Whois - wsparcie dla us³ugi "whois".
+%description -l pl.UTF-8
+Net::Whois - wsparcie dla usługi "whois".
%prep
-%setup -q -n Net-Whois-%{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/Net/Whois
- sed -e "s#$RPM_BUILD_ROOT##" .packlist >.packlist.new
- mv .packlist.new .packlist
-)
-gzip -9nf $RPM_BUILD_ROOT%{_mandir}/man3/* \
- README
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc README.gz whois_dom
-
-%{perl_sitelib}/Net/Whois.pm
-%{perl_sitearch}/auto/Net/Whois
-
+%doc README
+%{perl_vendorlib}/Net/Whois.pm
%{_mandir}/man3/*