File perl-UNIVERSAL-require.spec of Package perl-UNIVERSAL-require

%define realname UNIVERSAL-require
%define realver  0.18
%define srcext   tar.gz

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

# Common info
Name:           perl-%{realname}
Version:        %{realver}
Release:        wiz%{?extraver:0.}1%{?dist}
License:        Artistic-1.0 or GPL-1.0+
Group:          Development/Libraries/Perl
Url:            http://search.cpan.org/dist/UNIVERSAL-require/
Summary:        require() modules from a variable

# 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)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source:         http://search.cpan.org/CPAN/authors/id/N/NE/NEILB/%{realname}-%{realver}.%{srcext}

%description
If you've ever had to do this...

    eval "require $module";

to get around the bareword caveats on require(), this module is for you.
It creates a universal require() class method that will work with every Perl
module and its secure. So instead of doing some arcane eval() work,
you can do this:

    $module->require;

It doesn't save you much typing, but it'll make a lot more sense to someone
who's not a ninth level Perl acolyte.

%prep
%setup -q -n %{realname}-%{realver}

%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)
%dir %{perl_vendorlib}/UNIVERSAL
%{perl_vendorlib}/UNIVERSAL/require.pm
%doc %{_mandir}/man3/*
%exclude %{perl_installarchlib}/perllocal.pod
%exclude %{perl_vendorarch}/auto/UNIVERSAL/require/.packlist

%changelog
openSUSE Build Service is sponsored by