File perl-Net-NBName.spec of Package perl-Net-NBName

%define realname Net-NBName
%define realver  0.26
%define srcext   tar.gz

%{!?perl_installarchlib:%define perl_installarchlib %(perl -V:installarchlib | sed "s!.*='!!;s!'.*!!")}

# Common info
Name:           perl-%{realname}
Version:        %{realver}.1
Release:        wiz%{?extraver:0.}1%{?dist}
License:        Artistic-1.0 or GPL-1.0+
Group:          Development/Libraries/Perl
Url:            http://search.cpan.org/dist/Net-NBName/
Summary:        NetBIOS Name Service Requests

# Install-time parameters
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

# Build-time parameters
BuildArch:      noarch
BuildRequires:  perl
BuildRequires:  perl(ExtUtils::MakeMaker) perl(Test::Simple) perl(Test::More)
BuildRequires:  dos2unix
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source:         http://search.cpan.org/CPAN/authors/id/J/JM/JMACFARLA/%{realname}-%{realver}.%{srcext}

%description
Net::NBName is a class that allows you to perform simple NetBIOS Name Service
Requests in your Perl code. It performs these NetBIOS operations over TCP/IP
using Perl's built-in socket support.

%prep
%setup -q -n %{realname}-%{realver}
find . -type f -exec dos2unix {} \;
%{__sed} -ri '1 i\#!/usr/bin/env perl' bin/*.pl

%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
%{__make} %{?_smp_mflags}

%check
%{__make} test

%install
%{__make} DESTDIR=%{buildroot} install_vendor

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files
%defattr(644,root,root,755)
%doc Changes README
%doc %{_mandir}/man3/*
%attr(0755,root,root) %{_bindir}/*
%dir %{perl_vendorlib}/Net/NBName/NameQuery
%dir %{perl_vendorlib}/Net/NBName/NodeStatus
%dir %{perl_vendorlib}/Net/NBName
%dir %{perl_vendorlib}/Net
%{perl_vendorlib}/Net/NBName/NameQuery/*.pm
%{perl_vendorlib}/Net/NBName/NodeStatus/*.pm
%{perl_vendorlib}/Net/NBName/*.pm
%{perl_vendorlib}/Net/*.pm
%exclude %{perl_vendorarch}/auto/Net/NBName/.packlist
%exclude %{perl_installarchlib}/perllocal.pod

%changelog