#
# Conditional build:
-# _without_tests - do not perform "make test"
+# _without_tests - do not perform "make test"
+# _with_libresolv - link against libresolv
#
%include /usr/lib/rpm/macros.perl
%define pdir Net
Summary: Net::DNS - Perl interface to the DNS resolver
Summary(pl): Net::DNS - interfejs do resolvera DNS
Name: perl-Net-DNS
-Version: 0.34
+Version: 0.38
Release: 1
License: GPL/Artistic
Group: Development/Languages/Perl
Source0: http://www.cpan.org/modules/by-module/%{pdir}/%{pdir}-%{pnam}-%{version}.tar.gz
-# Source0-md5: ef979460d952665f67d2c8474763156e
+# Source0-md5: b33ebbd53029264816ca9fa894b59419
BuildRequires: perl-devel >= 5.6
%if %{?_without_tests:0}%{!?_without_tests:1}
BuildRequires: perl-Digest-MD5 >= 2.12
BuildRequires: perl-Test-Simple >= 0.18
%endif
BuildRequires: rpm-perlprov >= 4.1-13
+%if %{?_with_libresolv:0}%{!?_with_libresolv:1}
BuildArch: noarch
+%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
%setup -q -n %{pdir}-%{pnam}-%{version}
%build
-%{__perl} -MExtUtils::MakeMaker -e 'WriteMakefile(NAME=>"Net::DNS")' \
- INSTALLDIRS=vendor
+%{__perl} Makefile.PL </dev/null \
+ %{?_with_libresolv: --xs} \
+ %{?!_with_libresolv: --pm} \
+ INSTALLDIRS=vendor
+
%{__make}
%{!?_without_tests:%{__make} test}
%files
%defattr(644,root,root,755)
%doc Changes README TODO
+%if 0%{?_with_libresolv:1}
+%{perl_vendorarch}/Net/DNS.pm
+%{perl_vendorarch}/Net/DNS
+%{perl_vendorarch}/auto/Net/DNS/DNS.bs
+%attr(755,root,root) %{perl_vendorarch}/auto/Net/DNS/DNS.so
+%else
%{perl_vendorlib}/Net/DNS.pm
%{perl_vendorlib}/Net/DNS
+%endif
+
+
%{_mandir}/man3/*
%{_examplesdir}/%{name}-%{version}