[perl-Data-Section] Clean up and add EL-5 support

Paul Howarth pghmcfc at fedoraproject.org
Wed Mar 7 10:33:09 UTC 2012


commit eafd37f0773cdc4f0ead5133b1d64812f7c3dbac
Author: Paul Howarth <paul at city-fan.org>
Date:   Wed Mar 7 10:32:10 2012 +0000

    Clean up and add EL-5 support
    
    - Add test suite patch to support building with Test::More < 0.88 so that we
      can build for EPEL-5, only applying the patch when necessary
    - BR: at least version 0.09 of perl(MRO::Compat)
    - BR: perl(Pod::Coverage::TrustPod), perl(Test::Pod) and
      perl(Test::Pod::Coverage) for full test coverage
    - Run the release tests too
    - Drop redundant explicit versioned dependency on perl(Sub::Exporter)
    - Don't need to remove empty directories from buildroot
    - Don't use macros for commands
    - Use DESTDIR rather than PERL_INSTALL_ROOT
    - Drop %defattr, redundant since rpm 4.4
    - Make %files list more explicit

 .gitignore                                 |    3 +-
 Data-Section-0.101620-old-Test::More.patch |   17 ++++++++
 perl-Data-Section.spec                     |   56 +++++++++++++++++++---------
 3 files changed, 56 insertions(+), 20 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 472b6e2..69c49e9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1 @@
-Data-Section-0.101620.tar.gz
-/Data-Section-0.101621.tar.gz
+/Data-Section-[0-9.]*.tar.gz
diff --git a/Data-Section-0.101620-old-Test::More.patch b/Data-Section-0.101620-old-Test::More.patch
new file mode 100644
index 0000000..fee9537
--- /dev/null
+++ b/Data-Section-0.101620-old-Test::More.patch
@@ -0,0 +1,17 @@
+--- Data-Section-0.101620/t/basic.t	2010-06-11 13:14:39.000000000 +0100
++++ Data-Section-0.101620/t/basic.t	2010-06-11 19:24:46.780635972 +0100
+@@ -1,7 +1,7 @@
+ use strict;
+ use warnings;
+ use lib 't/lib';
+-use Test::More;
++use Test::More tests => 36;
+ 
+ use Parent;
+ use Child;
+@@ -168,5 +168,3 @@
+   { n => \"foo$crlf" },
+   "windows newlines work",
+ );
+-
+-done_testing;
diff --git a/perl-Data-Section.spec b/perl-Data-Section.spec
index 362cba6..cf648f3 100644
--- a/perl-Data-Section.spec
+++ b/perl-Data-Section.spec
@@ -1,55 +1,75 @@
+# We need to patch the test suite if we have an old version of Test::More
+%global old_test_more %(perl -MTest::More -e 'print (($Test::More::VERSION < 0.88) ? 1 : 0);' 2>/dev/null || echo 0)
+
 Name:           perl-Data-Section
 Version:        0.101621
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Read multiple hunks of data out of your DATA section
 License:        GPL+ or Artistic
 Group:          Development/Libraries
 URL:            http://search.cpan.org/dist/Data-Section/
 Source0:        http://www.cpan.org/authors/id/R/RJ/RJBS/Data-Section-%{version}.tar.gz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Patch1:         Data-Section-0.101620-old-Test::More.patch
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
 BuildArch:      noarch
 BuildRequires:  perl(ExtUtils::MakeMaker)
+BuildRequires:  perl(MRO::Compat) >= 0.09
+BuildRequires:  perl(Pod::Coverage::TrustPod)
 BuildRequires:  perl(Sub::Exporter) >= 0.979
 BuildRequires:  perl(Test::More)
-BuildRequires:  perl(MRO::Compat)
-Requires:       perl(Sub::Exporter) >= 0.979
-Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
+BuildRequires:  perl(Test::Pod) >= 1.00
+BuildRequires:  perl(Test::Pod::Coverage) >= 1.08
+Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
 
 %description
-Data::Section provides an easy way to access multiple named chunks of line-
-oriented data in your module's DATA section. It was written to allow
+Data::Section provides an easy way to access multiple named chunks of
+line-oriented data in your module's DATA section. It was written to allow
 modules to store their own templates, but probably has other uses.
 
 %prep
 %setup -q -n Data-Section-%{version}
 
+# Hack for old Test::More versions
+%if %{old_test_more}
+%patch1 -p1
+%endif
+
 %build
-%{__perl} Makefile.PL INSTALLDIRS=vendor
+perl Makefile.PL INSTALLDIRS=vendor
 make %{?_smp_mflags}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-
-make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
-
+make pure_install DESTDIR=$RPM_BUILD_ROOT
 find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
-find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;
-
-%{_fixperms} $RPM_BUILD_ROOT/*
+%{_fixperms} $RPM_BUILD_ROOT
 
 %check
-make test
+make test RELEASE_TESTING=1
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
-%defattr(-,root,root,-)
 %doc Changes LICENSE README
-%{perl_vendorlib}/*
-%{_mandir}/man3/*
+%{perl_vendorlib}/Data/
+%{_mandir}/man3/Data::Section.3pm*
 
 %changelog
+* Wed Mar  7 2012 Paul Howarth <paul at city-fan.org> - 0.101621-2
+- Add test suite patch to support building with Test::More < 0.88 so that we
+  can build for EPEL-5, only applying the patch when necessary
+- BR: at least version 0.09 of perl(MRO::Compat)
+- BR: perl(Pod::Coverage::TrustPod), perl(Test::Pod) and
+  perl(Test::Pod::Coverage) for full test coverage
+- Run the release tests too
+- Drop redundant explicit versioned dependency on perl(Sub::Exporter)
+- Don't need to remove empty directories from buildroot
+- Don't use macros for commands
+- Use DESTDIR rather than PERL_INSTALL_ROOT
+- Drop %%defattr, redundant since rpm 4.4
+- Make %%files list more explicit
+
 * Mon Jan 30 2012 Daniel P. Berrange <berrange at redhat.com> - 0.101621-1
 - Update to 0.101621 release (rhbz #785362)
 


More information about the scm-commits mailing list