[perl-MRO-Compat] Spec clean-up

Paul Howarth pghmcfc at fedoraproject.org
Thu Jan 26 16:14:28 UTC 2012


commit 0e740da195d4b4a40556367cefb42668eaf1d64e
Author: Paul Howarth <paul at city-fan.org>
Date:   Thu Jan 26 15:49:50 2012 +0000

    Spec clean-up
    
    - Only require Class::C3 with perl < 5.9.5
    - Require Class::C3::XS for performance and consistency, but only with
      perl < 5.9.5
    - Use DESTDIR rather than PERL_INSTALL_ROOT
    - Make %files list more explicit
    - Classify buildreqs by build/module/test
    - Don't use macros for commands
    - Use tabs

 .gitignore           |    2 +-
 perl-MRO-Compat.spec |  131 ++++++++++++++++++++++++++++----------------------
 2 files changed, 74 insertions(+), 59 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 5f7ab0f..d74ce24 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-MRO-Compat-0.11.tar.gz
+/MRO-Compat-[0-9.]*.tar.gz
diff --git a/perl-MRO-Compat.spec b/perl-MRO-Compat.spec
index 6180bb2..4b3890e 100644
--- a/perl-MRO-Compat.spec
+++ b/perl-MRO-Compat.spec
@@ -1,27 +1,33 @@
-Name:           perl-MRO-Compat
-Version:        0.11
-Release:        8%{?dist}
-Summary:        Mro::* interface compatibility for Perls < 5.9.5
-License:        GPL+ or Artistic
-Group:          Development/Libraries
-URL:            http://search.cpan.org/dist/MRO-Compat/
-Source0:        http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/MRO-Compat-%{version}.tar.gz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildArch:      noarch
-Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
-
-# core
-BuildRequires:  perl(ExtUtils::MakeMaker) >= 6.42
-BuildRequires:  perl(Test::More) >= 0.47
-# cpan
-BuildRequires:  perl(Class::C3) >= 0.20
-BuildRequires:  perl(Class::C3::XS) >= 0.08
-# test
-BuildRequires:  perl(Test::Pod)
-BuildRequires:  perl(Test::Pod::Coverage)
-
-# not automatically picked up
-Requires:       perl(Class::C3) >= 0.19
+# MRO is part of the Perl core since 5.9.5
+%global mro_in_core %(perl -e 'print $] > 5.009005 ? 1 : 0;')
+
+Name:		perl-MRO-Compat
+Version:	0.11
+Release:	9%{?dist}
+Summary:	Mro::* interface compatibility for Perls < 5.9.5
+License:	GPL+ or Artistic
+Group:		Development/Libraries
+URL:		http://search.cpan.org/dist/MRO-Compat/
+Source0:	http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/MRO-Compat-%{version}.tar.gz
+BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
+BuildArch:	noarch
+# Build
+BuildRequires:	perl(ExtUtils::MakeMaker) >= 6.42
+# Module
+%if ! %{mro_in_core}
+BuildRequires:	perl(Class::C3) >= 0.20
+BuildRequires:	perl(Class::C3::XS) >= 0.08
+%endif
+# Test
+BuildRequires:	perl(Test::More) >= 0.47
+BuildRequires:	perl(Test::Pod)
+BuildRequires:	perl(Test::Pod::Coverage)
+# Runtime
+Requires:	perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
+%if ! %{mro_in_core}
+Requires:	perl(Class::C3) >= 0.20
+Requires:	perl(Class::C3::XS) >= 0.08
+%endif
 
 %description
 The "mro" namespace provides several utilities for dealing with method
@@ -40,21 +46,19 @@ compatibility with older Perls, this is the module for you.
 %prep
 %setup -q -n MRO-Compat-%{version}
 
+# Fix script interpreter
 perl -pi -e 's|^#!./perl|#!/usr/bin/perl|' t/15pkg_gen.t
 
 %build
-%{__perl} Makefile.PL INSTALLDIRS=vendor
+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}/*
+make pure_install DESTDIR=%{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
@@ -65,10 +69,21 @@ rm -rf %{buildroot}
 %files
 %defattr(-,root,root,-)
 %doc ChangeLog README t/
-%{perl_vendorlib}/*
-%{_mandir}/man3/*
+%{perl_vendorlib}/MRO/
+%{_mandir}/man3/MRO::Compat.3pm*
 
 %changelog
+* Thu Jan 26 2012 Paul Howarth <paul at city-fan.org> - 0.11-9
+- Spec clean-up:
+  - Only require Class::C3 with perl < 5.9.5
+  - Require Class::C3::XS for performance and consistency, but only with
+    perl < 5.9.5
+  - Use DESTDIR rather than PERL_INSTALL_ROOT
+  - Make %%files list more explicit
+  - Classify buildreqs by build/module/test
+  - Don't use macros for commands
+  - Use tabs
+
 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.11-8
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 
@@ -79,48 +94,48 @@ rm -rf %{buildroot}
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 
 * Tue Dec 21 2010 Marcela Maslanova <mmaslano at redhat.com> - 0.11-5
-- 661697 rebuild for fixing problems with vendorach/lib
+- Rebuild to fix problems with vendorarch/lib (#661697)
 
 * Tue May 04 2010 Marcela Maslanova <mmaslano at redhat.com> - 0.11-4
 - Mass rebuild with perl-5.12.0
 
 * Mon Dec  7 2009 Stepan Kasal <skasal at redhat.com> - 0.11-3
-- rebuild against perl 5.10.1
+- Rebuild against perl 5.10.1
 
 * Sun Jul 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.11-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 
-* Tue Jun 02 2009 Chris Weyl <cweyl at alumni.drew.edu> 0.11-1
-- auto-update to 0.11 (by cpan-spec-update 0.01)
-- altered br on perl(ExtUtils::MakeMaker) (0 => 6.42)
-- altered br on perl(Class::C3) (0.19 => 0.20)
+* Tue Jun 02 2009 Chris Weyl <cweyl at alumni.drew.edu> - 0.11-1
+- Auto-update to 0.11 (by cpan-spec-update 0.01)
+- Altered br on perl(ExtUtils::MakeMaker) (0 => 6.42)
+- Altered br on perl(Class::C3) (0.19 => 0.20)
 
-* Thu Apr 02 2009 Chris Weyl <cweyl at alumni.drew.edu> 0.10-1
-- update to 0.10
+* Thu Apr 02 2009 Chris Weyl <cweyl at alumni.drew.edu> - 0.10-1
+- Update to 0.10
 
 * Thu Feb 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.09-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 
-* Sat Jun 28 2008 Chris Weyl <cweyl at alumni.drew.edu> 0.09
-- update to 0.09
+* Sat Jun 28 2008 Chris Weyl <cweyl at alumni.drew.edu> - 0.09
+- Update to 0.09
 
-* Wed May 28 2008 Chris Weyl <cweyl at alumni.drew.edu> 0.07-1
-- update to 0.07
+* Wed May 28 2008 Chris Weyl <cweyl at alumni.drew.edu> - 0.07-1
+- Update to 0.07
 
-* Wed Mar 05 2008 Tom "spot" Callaway <tcallawa at redhat.com> 0.05-6
-- rebuild for new perl
+* Wed Mar 05 2008 Tom "spot" Callaway <tcallawa at redhat.com> - 0.05-6
+- Rebuild for new perl
 
-* Thu Dec 06 2007 Chris Weyl <cweyl at alumni.drew.edu> 0.05-5
-- bump
+* Thu Dec 06 2007 Chris Weyl <cweyl at alumni.drew.edu> - 0.05-5
+- Bump
 
-* Wed Dec 05 2007 Chris Weyl <cweyl at alumni.drew.edu> 0.05-4
-- update INstall -> install
+* Wed Dec 05 2007 Chris Weyl <cweyl at alumni.drew.edu> - 0.05-4
+- Update INstall -> install
 
-* Wed Dec 05 2007 Chris Weyl <cweyl at alumni.drew.edu> 0.05-3
-- add Test::Pod deps
+* Wed Dec 05 2007 Chris Weyl <cweyl at alumni.drew.edu> - 0.05-3
+- Add Test::Pod deps
 
-* Tue Dec 04 2007 Chris Weyl <cweyl at alumni.drew.edu> 0.05-2
-- make Class::C3 dep explicit
+* Tue Dec 04 2007 Chris Weyl <cweyl at alumni.drew.edu> - 0.05-2
+- Make Class::C3 dep explicit
 
-* Tue Sep 18 2007 Chris Weyl <cweyl at alumni.drew.edu> 0.05-1
-- Specfile autogenerated by cpanspec 1.71.
+* Tue Sep 18 2007 Chris Weyl <cweyl at alumni.drew.edu> - 0.05-1
+- Specfile autogenerated by cpanspec 1.71



More information about the perl-devel mailing list