# Detect the distribution in use %global __despace head -n 1 | tr -d '[:space:]' | sed -e 's/[(].*[)]//g' %global __lower4 cut -c 1-4 | tr '[:upper:]' '[:lower:]' %global __distfile %([ -f /etc/SuSE-release ] && echo /etc/SuSE-release || echo /etc/redhat-release) %global __distinit %(sed -e 's/ release .*//' -e 's/\\([A-Za-z]\\)[^ ]*/\\1/g' %{__distfile} | %{__despace} | %{__lower4}) %global __distvers %(sed -e 's/.* release \\([^. ]*\\).*/\\1/' %{__distfile} | %{__despace}) # Identify CentOS Linux and Scientific Linux as rhel %if "%{__distinit}" == "c" || "%{__distinit}" == "cl" || "%{__distinit}" == "sl" || "%{__distinit}" == "sls" %global __distinit rhel %endif # Dist tag for Fedora is still "fc" %if "%{__distinit}" == "f" %global __distinit fc %endif # perl_vendorlib/perl_vendorarch not defined by default prior to F-2 %{!?perl_vendorarch: %global perl_vendorarch %(eval "`perl -V:installvendorarch`"; echo $installvendorarch)} # We need to patch the test suite if we have an old version of Test::More %global old_test_more %(perl -MTest::More -e 'printf "%d\\n", $Test::More::VERSION < 0.88 ? 1 : 0;' 2>/dev/null || echo 0) Summary: Validate method/function parameters Name: perl-Params-Validate Version: 1.00 Release: 3.%{__distinit}%{__distvers} License: Artistic 2.0 Group: Development/Libraries URL: http://search.cpan.org/dist/Params-Validate/ Source0: http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/Params-Validate-%{version}.tar.gz Patch0: Params-Validate-0.99-spelling.patch Patch1: Params-Validate-Perl-5.8.0.patch Patch2: Params-Validate-0.97-old-Test::More.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) BuildRequires: perl(ExtUtils::CBuilder) BuildRequires: perl(Module::Build) BuildRequires: perl(Pod::Man) BuildRequires: perl(Readonly) BuildRequires: perl(Readonly::XS) # Test::CPAN::Changes only available if we have Perl 5.10.0 onwards %if %(perl -e 'print $] >= 5.010000 ? 1 : 0;') BuildRequires: perl(Test::CPAN::Changes) %endif BuildRequires: perl(Test::EOL) BuildRequires: perl(Test::NoTabs) BuildRequires: perl(Test::Pod) # As of 1.00, Pod::Coverage test fails BuildConflicts: perl(Test::Pod::Coverage) BuildRequires: perl(Test::Spelling) %if %(perl -e 'print (($] >= 5.008001) ? 1 : 0)') BuildRequires: aspell-en %else BuildRequires: aspell-en-gb %endif BuildRequires: perl(Test::Taint) Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) # rpm prior to RHEL-5/F-7 cannot grok the module version %if %([ \( "%{__distinit}" = "fc" -a %{__distvers} -lt 7 \) -o \( "%{__distinit}" = "rhel" -a %{__distvers} -lt 5 \) -o "%{__distinit}" = "rhl" ] && echo 1 || echo 0) Provides: perl(Params::Validate) = %{version} %endif # Don't "provide" private Perl libs or redundant unversioned provide %{?filter_from_provides: %filter_from_provides /^perl(Params::Validate)$/d} %{?perl_default_filter} %description The Params::Validate module allows you to validate method or function call parameters to an arbitrary level of specificity. At the simplest level, it is capable of validating the required parameters were given and that no unspecified additional parameters were passed in. It is also capable of determining that a parameter is of a specific type, that it is an object of a certain class hierarchy, that it possesses certain methods, or applying validation callbacks to arguments. %prep %setup -q -n Params-Validate-%{version} # Extra stopwords for the POD spelling test %patch0 -p1 -b .spell # The test suite still passes with 5.8.0, so drop version 5.8.1 requirement %if %(perl -e 'print (($] >= 5.008001) ? 0 : 1)') %patch1 -p1 %endif # Need to patch the test suite if we have Test::More < 0.88 %if %{old_test_more} %patch2 -p1 %endif # Remove redundant unversioned provide if %%{perl_default_filter} not defined %global provfilt /bin/sh -c "%{__perl_provides} | grep -Fvx 'perl(Params::Validate)'" %define __perl_provides %{provfilt} %build perl Build.PL installdirs=vendor optimize="%{optflags}" ./Build %install rm -rf %{buildroot} ./Build install destdir=%{buildroot} create_packlist=0 find %{buildroot} -type f -name '*.bs' -a -size 0 -exec rm -f {} ';' find %{buildroot} -depth -type d -exec rmdir {} \; 2>/dev/null chmod -R u+w %{buildroot} %check LC_ALL=en_US RELEASE_TESTING=1 ./Build test %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc Changes LICENSE README TODO %{perl_vendorarch}/Params/ %{perl_vendorarch}/auto/Params/ %{perl_vendorarch}/Attribute/ %{_mandir}/man3/Attribute::Params::Validate.3pm* %{_mandir}/man3/Params::Validate.3pm* %changelog * Sat Jul 23 2011 Paul Howarth - 1.00-3 - Rebuild for perl 5.14.1 in Rawhide - Fix dist tag for CentOS 6 and Scientific Linux * Sat Jun 11 2011 Paul Howarth - 1.00-1 - Update to 1.00 - Fix documentation indexing on search.cpan.org (CPAN RT#68756) - Disable failing Pod::Coverage test * Sat May 28 2011 Paul Howarth - 0.99-1 - Update to 0.99 - The metadata file - META.{json,yml} - had references to a different distro because of a copy and paste error (CPAN RT#68514) - Update stopwords patch * Tue Apr 26 2011 Paul Howarth - 0.98-2 - Test::Spelling now available everywhere * Sat Apr 23 2011 Paul Howarth - 0.98-1 - Update to 0.98 - Attribute::Params::Validate's $VERSION regressed in 0.96; it is now manually set to 1.07 * Wed Apr 20 2011 Paul Howarth - 0.97-1 - Update to 0.97 - The XS version of the code always called Carp::confess, regardless of whether you provided your own on_fail callback (CPAN RT#66359) - There were a couple of spots that called eval without localizing $@ first (CPAN RT#58087) - Include (but disabled for now) parameter spec validation (CPAN RT#57831) - Lots of little pod fixes (CPAN RT#61002) - This module now requires Perl 5.8.1 - Switched to version 2.0 of the Artistic License - Make %%summary be useful - Add patch with extra stopwords for the new POD spelling test - Add patch to support building with Test::More < 0.88 - Add patch to support use with Perl 5.8.0 - Add new buildreqs perl(Test::CPAN::Changes), perl(Test::EOL), perl(Test::NoTabs), perl(Test::Spelling) and aspell-en - Drop now-unused buildreq perl(Test::Kwalitee) - Manually provide a versioned perl(Params::Validate) if necessary * Wed Mar 23 2011 Paul Howarth - 0.95-4 - BR: perl(Test::Kwalitee) - Nobody else likes macros for commands * Fri Jun 25 2010 Paul Howarth - 0.95-3 - Rebuild for perl 5.12.1 in Rawhide * Wed Jun 2 2010 Paul Howarth - 0.95-2 - Fix dist tag for RHEL-6 Beta * Tue Feb 16 2010 Paul Howarth - 0.95-1 - Update to 0.95 (skip problematic t/29-taint-mode.t entirely) - Fix filter for unversioned provide * Thu Jan 21 2010 Paul Howarth - 0.94-2 - Import from Fedora * Thu Dec 15 2009 Ralf Corsépius - 0.94-1 - Upstream update - Reflect upstream having reworked author tests to using AUTHOR_TESTING=1 * Mon Dec 7 2009 Stepan Kasal - 0.92-2 - Rebuild against perl 5.10.1 * Mon Nov 23 2009 Ralf Corsépius - 0.92-1 - Upstream update - Switch to Build.PL - Disable IS_MAINTAINER test * Sun Jul 26 2009 Fedora Release Engineering - 0.91-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Thu Feb 26 2009 Fedora Release Engineering - 0.91-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Tue Jun 10 2008 Ralf Corsépius - 0.91-1 - Upstream update - Conditionally activate IS_MAINTAINER tests * Wed Feb 27 2008 Tom "spot" Callaway - 0.89-4 - Rebuild for perl 5.10 (again) * Sun Feb 10 2008 Ralf Corsépius - 0.89-3 - Rebuild for gcc43 * Tue Jan 15 2008 Tom "spot" Callaway - 0.89-2 - Rebuild for new perl * Tue Nov 13 2007 Ralf Corsépius - 0.89-1 - Upstream update * Thu Sep 06 2007 Ralf Corsépius - 0.88-3 - Update license tag * Wed Aug 22 2007 Ralf Corsépius - 0.88-2 - Mass rebuild * Mon Mar 12 2007 Ralf Corsépius - 0.88-1 - BR: perl(ExtUtils::MakeMaker) - Upstream update * Sat Jan 20 2007 Ralf Corsépius - 0.87-1 - Upstream update * Tue Sep 05 2006 Ralf Corsépius - 0.86-2 - Mass rebuild * Sun Aug 13 2006 Ralf Corsépius - 0.86-1 - Upstream update * Mon Jun 28 2006 Ralf Corsépius - 0.85-1 - Upstream update * Mon Jun 05 2006 Ralf Corsépius - 0.84-1 - Upstream update * Sun May 21 2006 Ralf Corsépius - 0.82-1 - Upstream update * Wed Apr 04 2006 Ralf Corsépius - 0.81-1 - Upstream update * Wed Feb 20 2006 Ralf Corsépius - 0.80-2 - Rebuild * Wed Feb 01 2006 Ralf Corsépius - 0.80-1 - Upstream update * Sat Jan 14 2006 Ralf Corsépius - 0.79-1 - Upstream update - BR perl(Readonly), perl(Readonly::XS) * Sun Aug 14 2005 Ralf Corsepius - 0.78-2 - Spec file cleanup * Wed Aug 10 2005 Ralf Corsepius - 0.78-1 - FE submission