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
- Drop redundant versioned requirements of XXX >= 0.000
- Drop BR: perl ≥ 1:5.6.0; even EL-3 could have satisfied that
- BR: perl(base) and perl(Carp), which could be dual-lived
- BR: perl(Test::Pod) for full test coverage
- Run the release tests too
- 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
This commit is contained in:
Paul Howarth 2012-03-07 15:02:25 +00:00
parent 1ee55348e8
commit dec5cbf542
2 changed files with 88 additions and 18 deletions

View File

@ -0,0 +1,48 @@
diff -up Software-License-0.103001/t/custom.t.orig Software-License-0.103001/t/custom.t
--- Software-License-0.103001/t/custom.t.orig 2011-04-28 12:20:57.000000000 +0100
+++ Software-License-0.103001/t/custom.t 2011-04-28 15:41:09.821742581 +0100
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 8;
use Software::License::Custom;
@@ -40,5 +40,3 @@ Well... this is only some sample text. I
Yes, spanning more lines and more paragraphs.
END_OF_FULLTEXT
-
-done_testing;
diff -up Software-License-0.103001/t/meta-names.t.orig Software-License-0.103001/t/meta-names.t
--- Software-License-0.103001/t/meta-names.t.orig 2011-04-28 12:20:57.000000000 +0100
+++ Software-License-0.103001/t/meta-names.t 2011-04-28 15:40:17.974704365 +0100
@@ -2,13 +2,16 @@
use strict;
use warnings;
-use Test::More 0.88;
+use Test::More;
my @files = <lib/Software/License/*.pm>;
+plan tests => scalar @files;
+
for my $module (@files) {
# It's retired. Dunno if it's okay to be open_source. Punt!
- next if $module =~ /Sun.pm$/;
+ SKIP: {
+ skip "Dunno if it's okay for Sun.pm to be open_source", 1 if $module =~ /Sun.pm$/;
my $pkg = $module;
$pkg =~ s{^lib/}{};
@@ -18,6 +21,5 @@ for my $module (@files) {
eval "require $pkg; 1";
ok(defined $pkg->meta_name, "$pkg provide meta_name");
+ }
}
-
-done_testing;

View File

@ -1,6 +1,9 @@
# 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-Software-License
Version: 0.103004
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Package that provides templated software licenses
License: GPL+ or Artistic
Group: Development/Libraries
@ -8,15 +11,18 @@ URL: http://search.cpan.org/dist/Software-License/
# For unknown reasons this module URL is currently missing
#Source0: http://www.cpan.org/modules/by-module/Software/Software-License-%{version}.tar.gz
Source0: http://search.cpan.org/CPAN/authors/id/R/RJ/RJBS/Software-License-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch1: Software-License-0.103001-old-Test::More.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
BuildArch: noarch
BuildRequires: perl >= 1:5.6.0
BuildRequires: perl(Data::Section) >= 0.000
BuildRequires: perl(base)
BuildRequires: perl(Carp)
BuildRequires: perl(Data::Section)
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(Sub::Install) >= 0.000
BuildRequires: perl(Text::Template) >= 0.000
BuildRequires: perl(Sub::Install)
BuildRequires: perl(Text::Template)
BuildRequires: perl(Test::More)
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
BuildRequires: perl(Test::Pod)
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
%description
Software-License contains templates for common open source software licenses.
@ -24,33 +30,49 @@ Software-License contains templates for common open source software licenses.
%prep
%setup -q -n Software-License-%{version}
# Compatibility with 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}/Software/
%{_mandir}/man3/Software::License.3pm*
%{_mandir}/man3/Software::License::*.3pm*
%{_mandir}/man3/Software::LicenseUtils.3pm*
%changelog
* Wed Mar 7 2012 Paul Howarth <paul@city-fan.org> - 0.103004-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
- Drop redundant versioned requirements of XXX >= 0.000
- Drop BR: perl 1:5.6.0; even EL-3 could have satisfied that
- BR: perl(base) and perl(Carp), which could be dual-lived
- BR: perl(Test::Pod) for full test coverage
- Run the release tests too
- 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@redhat.com> - 0.103004-1
- Update to 0.103004 release (rhbz #750790)