# 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)} Summary: FileHandle that supports multi-byte unget Name: perl-FileHandle-Unget Version: 0.14 Release: 10.%{__distinit}%{__distvers} License: GPL+ Group: Development/Libraries Url: http://search.cpan.org/dist/FileHandle-Unget Source0: http://backpan.perl.org/authors/id/D/DC/DCOPPIT/FileHandle-Unget-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) BuildArch: noarch BuildRequires: perl(Devel::Leak), perl(ExtUtils::MakeMaker), perl(WeakRef) Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %description FileHandle::Unget is a drop-in replacement for FileHandle that allows more than one byte to be placed back on the input. It supports an ungetc(ORD), which can be called more than once in a row, and an ungets(SCALAR), which places a string of bytes back on the input. %prep %setup -q -n FileHandle-Unget-%{version} chmod -x lib/FileHandle/Unget.pm %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} -type d -depth -exec rmdir {} ';' 2>/dev/null %{_fixperms} %{buildroot} %check make test %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc README* CHANGES LICENSE %{perl_vendorlib}/FileHandle/ %{_mandir}/man3/FileHandle::Unget.3pm* %changelog * Tue Oct 18 2011 Paul Howarth 0.14-10 - Update source URL to point at BackPan - Nobody else likes macros for commands - Fix dist tag for CentOS 6 and Scientific Linux * Thu May 27 2010 Paul Howarth 0.14-9 - Fix dist tag for RHEL-6 Beta * Thu Feb 18 2010 Paul Howarth 0.14-8 - Add buildreq perl(Devel::Leak) for additional test coverage - Dist tag for Rawhide no longer needs special-casing - Use %%{_fixperms} macro instead of our own %%{__chmod} incantation * Mon Mar 10 2008 Paul Howarth 0.14-7 - Clarify license as GPL (unspecified version) - Fix dist tag for development releases, CentOS, and Fedora 7 onwards - Fix argument order for find with -depth - Define %%{__id_u} in a more portable way - Fix directory ownership issues - Add buildreq perl(ExtUtils::MakeMaker) - Change perl-WeakRef buildreq to perl(WeakRef) * Mon Jan 16 2006 Paul Howarth 0.14-6 - Remove redundant compiler optimization settings, not needed for noarch pkg - Use search.cpan.org URLs - Don't use macros in paths for build-time commands, hardcode them instead - Simplify distribution-detection - Remove %%__perl_package and %%perl_version macros for simplicity - Remove buildroot unconditionally in %%clean and %%install - Change Group: from Applications/CPAN to Development/Libraries - Fix permissions * Tue May 17 2005 Paul Howarth 0.14-5 - Rewrite spec file in (mainly) Fedora Extras style - Include full URL for source - Fix URL - Use MODULE_COMPAT dependency style and remove explicit perl dependency - Remove MANIFEST from %%doc * Thu Dec 23 2004 Paul Howarth 0.14-4 - Tidy up spec file * Thu Apr 15 2004 Paul Howarth 0.14-3 - Added explicit perl dependency to ensure that an RPM built on a system with an updated version of perl (and hence having files installed in a place that a non-updated system won't find them) will not install on the non-updated system. In such cases, just rebuild from the source RPM. - Changed distribution-identifying macros for greater portability. * Mon Feb 16 2004 Paul Howarth 0.14-2 - Unified spec file for Red Hat and Fedora Core * Tue Feb 10 2004 Paul Howarth 0.14-1.fc1 - Update to 0.14, requires perl-WeakRef * Fri Dec 12 2003 Paul Howarth 0.11-1.fc1 - Used more macros, added current Fedora Core version to RPM release ID. * Tue Nov 25 2003 Paul Howarth 0.11-1 - Initial build