# 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)} # This old version of MailTools is built for Red Hat Enterprise Linux 3 # and Red Hat Linux 9, as current releases work on anything more recent. Summary: Various mail-related perl modules Name: perl-MailTools Version: 1.77 Release: 5.%{__distinit}%{__distvers} License: GPL+ or Artistic Group: Development/Libraries URL: http://search.cpan.org/dist/MailTools/ Source0: http://search.cpan.org/CPAN/authors/id/M/MA/MARKOV/MailTools-%{version}.tar.gz Patch0: MailTools-1.77-CPAN-20726.patch Patch1: MailTools-1.77-utf8.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) BuildArch: noarch BuildRequires: perl(ExtUtils::MakeMaker) Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %description MailTools is a set of Perl modules related to mail applications. %prep %setup -q -n MailTools-%{version} # This patch addresses CPAN RT#20726 (http://rt.cpan.org/Public/Bug/Display.html?id=20726) # which is about handling filenames with trailing spaces. %patch0 -p0 # Set up example scripts cd examples for file in *.PL; do perl $file done chmod -x *_demo # Remove example-generation scripts, no longer needed # It causes warnings from MakeMaker, but we don't care rm *.PL cd - # Fix character encodings %patch1 -p1 # Remove unversioned provides for which a versioned version exists %global provfilt /bin/sh -c "%{__perl_provides} | grep -Evx 'perl[(]Mail::(Internet|Util)[)]'" %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 ChangeLog README* examples/ %{perl_vendorlib}/Mail/ %{perl_vendorlib}/auto/Mail/ %{_mandir}/man3/Mail::Address.3pm* %{_mandir}/man3/Mail::Cap.3pm* %{_mandir}/man3/Mail::Field.3pm* %{_mandir}/man3/Mail::Field::AddrList.3pm* %{_mandir}/man3/Mail::Filter.3pm* %{_mandir}/man3/Mail::Header.3pm* %{_mandir}/man3/Mail::Internet.3pm* %{_mandir}/man3/Mail::Mailer.3pm* %{_mandir}/man3/Mail::Send.3pm* %{_mandir}/man3/Mail::Util.3pm* %changelog * Tue Oct 18 2011 Paul Howarth 1.77-5 - Use a patch rather than scripted iconv to fix character encoding - Nobody else likes macros for commands - Fix dist tag for CentOS 6 and Scientific Linux * Fri Jun 4 2010 Paul Howarth 1.77-4 - Fix dist tag for RHEL-6 Beta - Use %%{_fixperms} macro instead of our own %%{__chmod} incantation * Mon Sep 21 2009 Paul Howarth 1.77-3 - Define RPM macros in global scope * Wed Jul 30 2008 Paul Howarth 1.77-2 - Clarify license as GPL version 1 or later, or Artistic (i.e. same as perl) - Remove buildreqs perl(Net::SMTP) and perl(Net::Domain), bundled with perl - Tweak dist tag macros to work on current Rawhide with three-part releasenum - Update patch for CPAN RT#20726 to apply without fuzz - Fix character encoding for ChangeLog - Remove unversioned provides for which a versioned version exists - Use tabs rather than spaces * Fri May 11 2007 Paul Howarth 1.77-1 - Update to 1.77 * Tue Apr 10 2007 Paul Howarth 1.76-1 - Update to 1.76 - Add comment text about the patch for fixing CPAN RT#20726 * Sun Mar 18 2007 Paul Howarth 1.74-3 - Fix dist tag for CentOS and development builds - Fix argument order for find with -depth - Buildrequire perl(ExtUtils::MakeMaker) * Fri Jul 28 2006 Paul Howarth 1.74-2 - Define %%{__id_u} in a more portable way - Make the demo scripts - Fix CPAN RT#20726 (RH #200450), allowing Mail::Util::read_mbox() to open files with weird names * Tue Feb 28 2006 Paul Howarth 1.74-1 - Update to 1.74 * Mon Jan 23 2006 Paul Howarth 1.73-1 - Update to 1.73 * Tue Jan 17 2006 Paul Howarth 1.72-1 - Update to 1.72 - Remove execute permissions on example scripts to shut rpmlint up * Thu Jan 5 2006 Paul Howarth 1.71-1 - Update to 1.71 - Remove unused macro perl_vendorarch - Remove buildroot unconditionally in %%clean and %%install - Manually replace use of macros __perl_package and __perl_version - Simplify distribution detection - Don't use macros in build-time command paths, hardcode them instead - Use search.cpan.org URLs * Mon Jul 4 2005 Paul Howarth 1.67-2 - 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 - Include examples * Fri Apr 1 2005 Paul Howarth 1.67-1 - Update to 1.67. * Wed Feb 2 2005 Paul Howarth 1.66-1 - Update to 1.66. * Mon Oct 25 2004 Paul Howarth 1.64-1 - Update to 1.64. - General tidy-up of spec file. * Thu Apr 15 2004 Paul Howarth 1.62-1 - Update to 1.62. - 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 1.60-2 - Unified spec file for Red Hat and Fedora Core - Added requirement for perl-TimeDate * Fri Dec 12 2003 Paul Howarth 1.60-1.fc1 - More macros - Expanded description - Added Fedora Core version into RPM release ID * Tue Nov 25 2003 Paul Howarth 1.60-1 - Update to 1.60 * Mon Nov 24 2003 Paul Howarth 1.50-2 - Build for Fedora Core 1 * Tue Oct 15 2002 Paul Howarth 1.50-1 - Upgrade to 1.50 - Build for RHL 8.0 * Sun Aug 26 2001 Ramiro Morales - Build on RHL 6.2 - Buildarch noarch - Include docs - s/Copyright/License/ - {Build,}Requires perl-libnet * Sun Aug 26 2001 root - Spec file was autogenerated.