%define pkg_name UNIVERSAL-can %define pkg_version 1.12 %define rpm_pkg_version 1.12 %define rpm_pkg_release 2.n0i.5 Summary: Hack around people calling UNIVERSAL::can() as a function Name: perl-%{pkg_name} Version: %{rpm_pkg_version} Release: %{rpm_pkg_release}%{?cpan_version}%{?dist} Group: Development/Libraries License: Artistic URL: http://search.cpan.org/dist/%{pkg_name}/ Source0: http://www.cpan.org/authors/id/C/CH/CHROMATIC/%{pkg_name}-%{pkg_version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: reb00t-rpmdevtools BuildRequires: perl(ExtUtils::MakeMaker) %{!?_without_test:BuildRequires: perl(Scalar::Util)} %{!?_without_test:BuildRequires: perl(Test::Simple) >= 0.60} %description Some authors call methods in the UNIVERSAL class on potential invocants as functions, bypassing any possible overriding. This is wrong and you should not do it. Unfortunately, not everyone heeds this warning and their bad code can break your good code. Fortunately, this module replaces "UNIVERSAL::can()" with a method that checks to see if the first argument is a valid invocant (whether an object -- a blessed referent -- or the name of a class). If so, and if the invocant's class has its own "can()" method, it calls that as a method. Otherwise, everything works as you might expect. %prep %setup -q -n %{pkg_name}-%{pkg_version} %build %{perl_build} %{!?_without_test:%{__make} test} %install %{__rm} -rf $RPM_BUILD_ROOT %{perl_install} %clean %{__rm} -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %{perl_files} %doc Changes README %changelog * Tue May 22 2007 Marius Feraru - 1.12-2.n0i.5 - spec file (re)created using N0i::CPAN::RPMizer 804.027 - rebuild * Sat Apr 01 2006 Marius Feraru - 1.12-1.n0i.4 - version 1.12 * Sat Mar 04 2006 Marius Feraru - 1.11-1.n0i.3 - version 1.11 * Fri Feb 03 2006 Marius Feraru - 1.03-1.n0i.2 - version 1.03 * Thu Sep 01 2005 Marius Feraru 1.00-1.n0i.1 - spec file (re)created using N0i::CPAN::RPMizer/1.10 - rebuild on perl 5.8.7