[perl-Sub-Name: 14/15] Spec clean-up and reinstate EPEL-4/5 compatibility

Paul Howarth pghmcfc at fedoraproject.org
Sat Feb 18 14:04:07 UTC 2012


commit 519bcbb15441e7787840c3dd2462083dd190d603
Author: Paul Howarth <paul at city-fan.org>
Date:   Sat Feb 18 13:49:26 2012 +0000

    Spec clean-up and reinstate EPEL-4/5 compatibility
    
    - Reinstate compatibility with old distributions like EL-5
      - Add BuildRoot definition
      - Clean buildroot in %install
      - Restore %clean section
      - Restore %defattr
      - Don't use + to terminate find -exec commands
    - Spec clean-up
      - Make %files list more explicit
      - Use DESTDIR rather than PERL_INSTALL_ROOT
      - Don't use macros for commands
      - Use tabs
      - Add buildreqs for Perl core modules that might be dual-lived
      - Explicit requires for "use base XXX;" only required prior to rpm 4.9

 .gitignore         |    3 +-
 perl-Sub-Name.spec |  123 +++++++++++++++++++++++++++++++---------------------
 2 files changed, 75 insertions(+), 51 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index acd0c90..27ea2f9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1 @@
-Sub-Name-0.04.tar.gz
-/Sub-Name-0.05.tar.gz
+/Sub-Name-[0-9.]*.tar.gz
diff --git a/perl-Sub-Name.spec b/perl-Sub-Name.spec
index aa08b68..5567913 100644
--- a/perl-Sub-Name.spec
+++ b/perl-Sub-Name.spec
@@ -1,20 +1,29 @@
-Name:           perl-Sub-Name
-Version:        0.05
-Release:        5%{?dist}
-Summary:        Name -- or rename -- a sub
-License:        GPL+ or Artistic
-Group:          Development/Libraries
-URL:            http://search.cpan.org/dist/Sub-Name/
-Source0:        http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/Sub-Name-%{version}.tar.gz
-Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
-
-BuildRequires:  perl(ExtUtils::MakeMaker)
-BuildRequires:  perl(Test::More)
-
-# use base
-Requires:       perl(Exporter)
-Requires:       perl(DynaLoader)
-
+# Only need manual requires for "use base XXX;" prior to rpm 4.9
+%global rpm49 %(rpm --version | perl -pi -e 's/^.* (\\d+)\\.(\\d+).*/sprintf("%d.%03d",$1,$2) ge 4.009 ? 1 : 0/e')
+
+Name:		perl-Sub-Name
+Version:	0.05
+Release:	6%{?dist}
+Summary:	Name - or rename - a sub
+License:	GPL+ or Artistic
+Group:		Development/Libraries
+URL:		http://search.cpan.org/dist/Sub-Name/
+Source0:	http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/Sub-Name-%{version}.tar.gz
+BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
+BuildRequires:	perl(base)
+BuildRequires:	perl(DynaLoader)
+BuildRequires:	perl(Exporter)
+BuildRequires:	perl(ExtUtils::MakeMaker)
+BuildRequires:	perl(strict)
+BuildRequires:	perl(Test::More)
+BuildRequires:	perl(warnings)
+Requires:	perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
+%if ! %{rpm49}
+Requires:	perl(DynaLoader)
+Requires:	perl(Exporter)
+%endif
+
+# Don't "provide" private perl objects
 %{?perl_default_filter}
 
 %description
@@ -22,36 +31,52 @@ This module allows one to "name" or rename subroutines, including anonymous
 ones.
 
 Note that this is mainly for aid in debugging; you still cannot call the sub
-by the new name (w/o some deep magic).
-
+by the new name (without some deep magic).
 
 %prep
 %setup -q -n Sub-Name-%{version}
 
 %build
-%{__perl} Makefile.PL INSTALLDIRS=vendor optimize="%{optflags}"
+perl Makefile.PL INSTALLDIRS=vendor optimize="%{optflags}"
 make %{?_smp_mflags}
 
 %install
-make pure_install PERL_INSTALL_ROOT=%{buildroot}
-
-find %{buildroot} -type f -name .packlist -exec rm -f {} +
-find %{buildroot} -type f -name '*.bs' -size 0 -exec rm -f {} +
-find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null \;
-
-%{_fixperms} %{buildroot}/*
+rm -rf %{buildroot}
+make pure_install DESTDIR=%{buildroot}
+find %{buildroot} -type f -name .packlist -exec rm -f {} \;
+find %{buildroot} -type f -name '*.bs' -size 0 -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_vendorarch}/auto/*
-%{perl_vendorarch}/Sub*
-%{_mandir}/man3/*
+%{perl_vendorarch}/auto/Sub/
+%{perl_vendorarch}/Sub/
+%{_mandir}/man3/Sub::Name.3pm*
 
 %changelog
+* Sat Feb 18 2012 Paul Howarth <paul at city-fan.org> - 0.05-6
+- Reinstate compatibility with old distributions like EL-5
+  - Add BuildRoot definition
+  - Clean buildroot in %%install
+  - Restore %%clean section
+  - Restore %%defattr
+  - Don't use + to terminate find -exec commands
+- Spec clean-up
+  - Make %%files list more explicit
+  - Use DESTDIR rather than PERL_INSTALL_ROOT
+  - Don't use macros for commands
+  - Use tabs
+  - Add buildreqs for Perl core modules that might be dual-lived
+  - Explicit requires for "use base XXX;" only required prior to rpm 4.9
+
 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.05-5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 
@@ -62,11 +87,11 @@ make test
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 
 * Wed Dec 22 2010 Marcela Maslanova <mmaslano at redhat.com> - 0.05-2
-- 661697 rebuild for fixing problems with vendorach/lib
+- Rebuild to fix problems with vendorarch/lib (#661697)
 
-* Sat Dec 18 2010 Iain Arnell <iarnell at gmail.com> 0.05-1
-- update to latest upstream version
-- clean up spec for modern rpmbuild
+* Sat Dec 18 2010 Iain Arnell <iarnell at gmail.com> - 0.05-1
+- Update to latest upstream version
+- Clean up spec for modern rpmbuild
 - BR perl(Test::More)
 - Requires perl(DynaLoader) and perl(Exporter)
 
@@ -74,7 +99,7 @@ make test
 - Mass rebuild with perl-5.12.0
 
 * Mon Dec  7 2009 Stepan Kasal <skasal at redhat.com> - 0.04-5
-- rebuild against perl 5.10.1
+- Rebuild against perl 5.10.1
 
 * Thu Aug 27 2009 Chris Weyl <cweyl at alumni.drew.edu> - 0.04-4
 - Filtering errant private provides
@@ -85,27 +110,27 @@ make test
 * Thu Feb 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.04-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 
-* Sun Aug 03 2008 Chris Weyl <cweyl at alumni.drew.edu> 0.04-1
-- update to 0.04
+* Sun Aug 03 2008 Chris Weyl <cweyl at alumni.drew.edu> - 0.04-1
+- Update to 0.04
 
-* Sat Mar 15 2008 Chris Weyl <cweyl at alumni.drew.edu> 0.03-1
-- update to 0.03
+* Sat Mar 15 2008 Chris Weyl <cweyl at alumni.drew.edu> - 0.03-1
+- Update to 0.03
 
 * Tue Mar  4 2008 Tom "spot" Callaway <tcallawa at redhat.com> - 0.02-5
-- rebuild for new perl
+- Rebuild for new perl
 
 * Mon Feb 18 2008 Fedora Release Engineering <rel-eng at fedoraproject.org> - 0.02-4.1
 - Autorebuild for GCC 4.3
 
-* Tue Oct 16 2007 Tom "spot" Callaway <tcallawa at redhat.com> 0.02-3.1
-- correct license tag
-- add BR: perl(ExtUtils::MakeMaker)
+* Tue Oct 16 2007 Tom "spot" Callaway <tcallawa at redhat.com> - 0.02-3.1
+- Correct license tag
+- Add BR: perl(ExtUtils::MakeMaker)
 
-* Tue Aug 21 2007 Chris Weyl <cweyl at alumni.drew.edu> 0.02-3
-- bump
+* Tue Aug 21 2007 Chris Weyl <cweyl at alumni.drew.edu> - 0.02-3
+- Bump
 
-* Wed Sep 06 2006 Chris Weyl <cweyl at alumni.drew.edu> 0.02-2
-- bump
+* Wed Sep 06 2006 Chris Weyl <cweyl at alumni.drew.edu> - 0.02-2
+- Bump
 
-* Sat Sep 02 2006 Chris Weyl <cweyl at alumni.drew.edu> 0.02-1
-- Specfile autogenerated by cpanspec 1.69.1.
+* Sat Sep 02 2006 Chris Weyl <cweyl at alumni.drew.edu> - 0.02-1
+- Specfile autogenerated by cpanspec 1.69.1


More information about the scm-commits mailing list