[perl-Test-DistManifest/el6] Changes for EPEL 4/5 compatibility

Paul Howarth pghmcfc at fedoraproject.org
Wed Aug 10 17:47:42 UTC 2011


commit ffe0670781a4723ab64f936c51538e02ead4871f
Author: Paul Howarth <paul at city-fan.org>
Date:   Wed Aug 10 13:22:10 2011 +0100

    Changes for EPEL 4/5 compatibility
    
    - Changes for EPEL 4/5 compatibility:
      - Add buildroot
      - Add %clean section and clean buildroot at start of %install
      - Patch out requirement for ExtUtils::MakeMaker ≥ 6.31 if necessary;
        ExtUtils::MakeMaker 6.17 in RHEL-4 works just fine
      - Drop Test::More ≥ 0.62 version requirement; Test::More 0.47 in RHEL-4
        works just fine
      - Drop Test::NoWarnings ≥ 0.084 version requirement; Test::NoWarnings 0.083
        in EPEL-4 works just fine
      - Add traditional dependency filtering scheme
    - Disable debug package rather than removing its temporary files to avoid
      breaking the manifest test
    - No need to set compiler optimization flags for noarch package
    - Drop redundant explicit runtime dependency on perl(Test::Builder)
    - Simplify dependency filtering
    - Run the release tests too
    - BR: perl(Pod::Coverage::TrustPod), perl(Test::Kwalitee), perl(Test::Pod),
      perl(Test::Pod::Coverage) and perl(Test::Portability::Files) for the
      release tests

 Test-DistManifest-1.011-old-eu::mm.patch |   30 +++++++++++
 perl-Test-DistManifest.spec              |   78 +++++++++++++++++++++++-------
 2 files changed, 90 insertions(+), 18 deletions(-)
---
diff --git a/Test-DistManifest-1.011-old-eu::mm.patch b/Test-DistManifest-1.011-old-eu::mm.patch
new file mode 100644
index 0000000..1d42281
--- /dev/null
+++ b/Test-DistManifest-1.011-old-eu::mm.patch
@@ -0,0 +1,30 @@
+--- Test-DistManifest/Makefile.PL
++++ Test-DistManifest/Makefile.PL
+@@ -4,7 +4,7 @@
+ 
+ BEGIN { require 5.008; }
+ 
+-use ExtUtils::MakeMaker 6.31;
++use ExtUtils::MakeMaker;
+ 
+ 
+ 
+@@ -16,7 +16,7 @@
+     'Test::NoWarnings' => '0.084'
+   },
+   'CONFIGURE_REQUIRES' => {
+-    'ExtUtils::MakeMaker' => '6.31'
++    'ExtUtils::MakeMaker' => '0'
+   },
+   'DISTNAME' => 'Test-DistManifest',
+   'EXE_FILES' => [],
+@@ -49,6 +49,9 @@
+ delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
+   unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
+ 
++delete $WriteMakefileArgs{LICENSE}
++  unless eval { ExtUtils::MakeMaker->VERSION(6.31) };
++
+ WriteMakefile(%WriteMakefileArgs);
+ 
+ 
diff --git a/perl-Test-DistManifest.spec b/perl-Test-DistManifest.spec
index f45ba99..42dd561 100644
--- a/perl-Test-DistManifest.spec
+++ b/perl-Test-DistManifest.spec
@@ -1,36 +1,46 @@
+# We don't really need ExtUtils::MakeMaker ≥ 6.31
+%global old_eumm %(perl -MExtUtils::MakeMaker -e 'printf "%d\\n", $ExtUtils::MakeMaker::VERSION < 6.31 ? 1 : 0;' 2>/dev/null || echo 0)
+
+# noarch, but to avoid debug* files interfering with manifest test:
+%global debug_package %{nil}
+
 Name:           perl-Test-DistManifest
 Version:        1.011
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Author test that validates a package MANIFEST
 License:        GPL+ or Artistic
 Group:          Development/Libraries
 URL:            http://search.cpan.org/dist/Test-DistManifest/
 Source0:        http://www.cpan.org/authors/id/J/JA/JAWNSY/Test-DistManifest-%{version}.tar.gz
+Patch0:         Test-DistManifest-1.011-old-eu::mm.patch
 BuildArch:      noarch
-BuildRequires:  perl(ExtUtils::MakeMaker) >= 6.31
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
+BuildRequires:  perl(ExtUtils::MakeMaker)
 BuildRequires:  perl(File::Spec)
 BuildRequires:  perl(File::Spec::Unix)
 BuildRequires:  perl(Module::Manifest) >= 0.07
 BuildRequires:  perl(Test::Builder)
-BuildRequires:  perl(Test::More) >= 0.62
+BuildRequires:  perl(Test::More)
 # Tests only:
 BuildRequires:  perl(Test::Builder::Tester)
-BuildRequires:  perl(Test::NoWarnings) >= 0.084
+BuildRequires:  perl(Test::NoWarnings)
+# Release tests
+BuildRequires:  perl(Pod::Coverage::TrustPod)
+%if 0%{?fedora} || 0%{?rhel} > 5
+BuildRequires:  perl(Test::Kwalitee)
+%endif
+BuildRequires:  perl(Test::Pod)
+BuildRequires:  perl(Test::Pod::Coverage)
+BuildRequires:  perl(Test::Portability::Files)
+# Runtime requirements
 Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
 Requires:       perl(Module::Manifest) >= 0.07
-Requires:       perl(Test::Builder)
 # This is a plug-in into Test::More. Depend on it even if not mentioned in the
 # code
-Requires:       perl(Test::More) >= 0.62
+Requires:       perl(Test::More)
 
-%{?perl_default_filter:
-# Filter underspecifed dependencies
-%filter_from_requires /^perl(Module::Manifest)$/d
-# Filter multiple dependencies
-%filter_from_requires /^perl(Test::Builder)$/d
-%perl_default_filter
-}
-%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}perl\\((Module::Manifest|Test::Builder)\\)$
+# Filter underspecified dependency (rpm 4.9 onwards)
+%global __requires_exclude ^perl\\(Module::Manifest\\)$
 
 %description
 This module provides a simple method of testing that a MANIFEST matches the
@@ -39,11 +49,21 @@ distribution.
 %prep
 %setup -q -n Test-DistManifest-%{version}
 
+# We don't really need ExtUtils::MakeMaker ≥ 6.31
+%if %{old_eumm}
+%patch0 -p1
+%endif
+
+# Filter underspecified dependency (prior to rpm 4.9)
+%global reqfilt /bin/sh -c "%{__perl_requires} | grep -Fvx 'perl(Module::Manifest)'"
+%define __perl_requires %{reqfilt}
+
 %build
-%{__perl} Makefile.PL INSTALLDIRS=perl OPTIMIZE="$RPM_OPT_FLAGS"
+%{__perl} Makefile.PL INSTALLDIRS=perl
 make %{?_smp_mflags}
 
 %install
+rm -rf $RPM_BUILD_ROOT
 make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
 find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
 find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -exec rm -f {} \;
@@ -51,9 +71,10 @@ find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;
 %{_fixperms} $RPM_BUILD_ROOT/*
 
 %check
-# post-install rpmbuild scripts contaminates RPM_BUILD_ROOT (bug #672538).
-rm debug*.list
-make test
+make test RELEASE_TESTING=1
+
+%clean
+rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
@@ -62,6 +83,27 @@ make test
 %{_mandir}/man3/*
 
 %changelog
+* Wed Aug 10 2011 Paul Howarth <paul at city-fan.org> - 1.011-4
+- Changes for EPEL 4/5 compatibility:
+  - Add buildroot
+  - Add %%clean section and clean buildroot at start of %%install
+  - Patch out requirement for ExtUtils::MakeMaker ≥ 6.31 if necessary;
+    ExtUtils::MakeMaker 6.17 in RHEL-4 works just fine
+  - Drop Test::More ≥ 0.62 version requirement; Test::More 0.47 in RHEL-4
+    works just fine
+  - Drop Test::NoWarnings ≥ 0.084 version requirement; Test::NoWarnings 0.083
+    in EPEL-4 works just fine
+  - Add traditional dependency filtering scheme
+- Disable debug package rather than removing its temporary files to avoid
+  breaking the manifest test
+- No need to set compiler optimization flags for noarch package
+- Drop redundant explicit runtime dependency on perl(Test::Builder)
+- Simplify dependency filtering
+- Run the release tests too
+- BR: perl(Pod::Coverage::TrustPod), perl(Test::Kwalitee), perl(Test::Pod),
+  perl(Test::Pod::Coverage) and perl(Test::Portability::Files) for the
+  release tests
+
 * Mon Jul 25 2011 Iain Arnell <iarnell at gmail.com> 1.011-3
 - update filtering for rpm 4.9
 



More information about the perl-devel mailing list