From 3239d593c9ec0a06bccc7f3c2bb9ce8e50c077df Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Sun, 7 Aug 2011 20:33:37 +0100 Subject: [PATCH] Initial import (perl-Data-Section-Simple-0.02-2) Data::Section::Simple is a simple module to extract data from the __DATA__ section of the file. --- .gitignore | 1 + Data-Section-Simple-0.02-old-Test::More.patch | 57 +++++++++++++++++ perl-Data-Section-Simple.spec | 63 +++++++++++++++++++ sources | 1 + 4 files changed, 122 insertions(+) create mode 100644 Data-Section-Simple-0.02-old-Test::More.patch create mode 100644 perl-Data-Section-Simple.spec diff --git a/.gitignore b/.gitignore index e69de29..c86c192 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/Data-Section-Simple-[0-9.]*\.tar\.gz diff --git a/Data-Section-Simple-0.02-old-Test::More.patch b/Data-Section-Simple-0.02-old-Test::More.patch new file mode 100644 index 0000000..81a775b --- /dev/null +++ b/Data-Section-Simple-0.02-old-Test::More.patch @@ -0,0 +1,57 @@ +diff -up Data-Section-Simple-0.02/t/basic.t.orig Data-Section-Simple-0.02/t/basic.t +--- Data-Section-Simple-0.02/t/basic.t.orig 2010-03-18 08:30:42.000000000 +0000 ++++ Data-Section-Simple-0.02/t/basic.t 2011-08-03 13:35:00.536119464 +0100 +@@ -1,6 +1,6 @@ + use strict; + use Data::Section::Simple qw(get_data_section); +-use Test::More; ++use Test::More tests => 3; + + my $x = get_data_section(); + is_deeply [ sort keys %$x ], [ qw(bar.tt foo.html) ]; +@@ -19,8 +19,6 @@ bar + + TT + +-done_testing; +- + __DATA__ + + @@ foo.html +diff -up Data-Section-Simple-0.02/t/data.t.orig Data-Section-Simple-0.02/t/data.t +--- Data-Section-Simple-0.02/t/data.t.orig 2010-03-18 21:59:01.000000000 +0000 ++++ Data-Section-Simple-0.02/t/data.t 2011-08-03 13:35:24.648055699 +0100 +@@ -1,6 +1,6 @@ + use lib "t"; + use DataInCode; +-use Test::More; ++use Test::More tests => 1; + use Data::Section::Simple; + + my $d = Data::Section::Simple->new('DataInCode'); +@@ -8,7 +8,3 @@ my $x = $d->get_data_section; + + is $x->{foo}, "bar\n\n"; + +-done_testing; +- +- +- +diff -up Data-Section-Simple-0.02/t/pkg_oo.t.orig Data-Section-Simple-0.02/t/pkg_oo.t +--- Data-Section-Simple-0.02/t/pkg_oo.t.orig 2010-03-18 08:26:28.000000000 +0000 ++++ Data-Section-Simple-0.02/t/pkg_oo.t 2011-08-03 13:35:51.142985668 +0100 +@@ -4,7 +4,7 @@ use Data::Section::Simple; + use lib "t"; + use Foo; + +-use Test::More; ++use Test::More tests => 3; + + my $d = Data::Section::Simple->new('Foo'); + my $x = $d->get_data_section(); +@@ -24,5 +24,3 @@ bar + + TT + +-done_testing; +- diff --git a/perl-Data-Section-Simple.spec b/perl-Data-Section-Simple.spec new file mode 100644 index 0000000..8e9d7d6 --- /dev/null +++ b/perl-Data-Section-Simple.spec @@ -0,0 +1,63 @@ +# We need to patch the test suite if we have an old version of Test::More +%global old_test_more %(perl -MTest::More -e 'printf "%d\\n", $Test::More::VERSION < 0.88 ? 1 : 0;' 2>/dev/null || echo 0) + +Name: perl-Data-Section-Simple +Version: 0.02 +Release: 2%{?dist} +Summary: Read data from __DATA__ +License: GPL+ or Artistic +Group: Development/Libraries +URL: http://search.cpan.org/dist/Data-Section-Simple/ +Source0: http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/Data-Section-Simple-%{version}.tar.gz +Patch1: Data-Section-Simple-0.02-old-Test::More.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) +BuildArch: noarch +BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: perl(Test::More) +BuildRequires: perl(Test::Pod) >= 1.00 +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) + +%description +Data::Section::Simple is a simple module to extract data from the __DATA__ +section of the file. + +%prep +%setup -q -n Data-Section-Simple-%{version} + +# Hack for old Test::More versions +%if %{old_test_more} +%patch1 -p1 +%endif + +%build +# Note that the Makefile.PL complains about missing Test::Requires +# but the package doesn't actually use it (CPAN RT#69981) +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} + +%check +make test +make test TEST_FILES="xt/*.t" + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%doc Changes README +%{perl_vendorlib}/Data/ +%{_mandir}/man3/Data::Section::Simple.3pm* + +%changelog +* Thu Aug 4 2011 Paul Howarth - 0.02-2 +- Sanitize for Fedora submission + +* Wed Aug 3 2011 Paul Howarth - 0.02-1 +- Initial RPM version diff --git a/sources b/sources index e69de29..061b767 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +730256f8dcfdd3fb6f3b522aa58e9188 Data-Section-Simple-0.02.tar.gz