# 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_vendorlib: %global perl_vendorlib %(eval "`perl -V:installvendorlib`"; echo $installvendorlib)} Name: perl-SUPER Version: 1.01 Release: 3.%{__distinit}%{__distvers} Summary: Sane super-class method dispatcher License: GPL+ or Artistic Group: Development/Libraries URL: http://search.cpan.org/dist/SUPER/ Source0: http://search.cpan.org/CPAN/authors/id/S/SI/SIMON/SUPER-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) BuildArch: noarch BuildRequires: perl(Carp) BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(Test::More) BuildRequires: perl(Test::Simple) < 0.61 Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %description When sub-classing a class, you occasionally want to dispatch control to the super-class - at least conditionally and temporarily. This module provides an easier, cleaner way for class methods to access their ancestor's implementation. %prep %setup -q -n SUPER-%{version} # Filter out bogus provides %global provfilt /bin/sh -c "%{__perl_provides} | grep -Evx 'perl[(](DB|UNIVERSAL)[)]'" %define __perl_provides %{provfilt} %build perl Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %install rm -rf %{buildroot} make pure_install PERL_INSTALL_ROOT=%{buildroot} find %{buildroot} -type f -name .packlist -exec rm -f {} \; find %{buildroot} -depth -type d -exec rmdir {} \; 2>/dev/null %{_fixperms} %{buildroot} %check make test %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc Changes README %{perl_vendorlib}/SUPER.pm %{_mandir}/man3/SUPER.3pm* %changelog * Wed Oct 19 2011 Paul Howarth 1.01-3 - BR: perl(Carp) - Nobody else likes macros for commands - Fix dist tag for CentOS 6 and Scientific Linux - Use %%{_fixperms} macro rather than our own chmod incantation * Mon May 17 2010 Paul Howarth 1.01-2 - Fix dist tag for RHEL-6 Beta * Fri Nov 27 2009 Paul Howarth 1.01-1 - Initial RPM version