commit 9cb59e7836357ae821870ec80005f3df76814c05 Author: Tom "spot" Callaway <tcallawa@xxxxxxxxxx> Date: Thu Aug 11 15:28:23 2011 -0400 initial import .gitignore | 1 + Switch-2.16-perl514.patch | 11 ++++++++++ perl-Switch.spec | 48 +++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 4 files changed, 61 insertions(+), 0 deletions(-) --- diff --git a/.gitignore b/.gitignore index e69de29..e4dd551 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/Switch-2.16.tar.gz diff --git a/Switch-2.16-perl514.patch b/Switch-2.16-perl514.patch new file mode 100644 index 0000000..90e96cb --- /dev/null +++ b/Switch-2.16-perl514.patch @@ -0,0 +1,11 @@ +--- Switch-2.16-wjgfvU/Switch.pm 2009-10-23 00:52:51.000000000 -0700 ++++ Switch-2.16-wjgfvUcopy/Switch.pm 2010-08-15 17:41:38.000000000 -0700 +@@ -146,7 +146,7 @@ sub filter_blocks + die "Bad $keyword statement (problem in the code block?) near $Switch::file line ", line(substr($source,0, pos $source), $line), "\n"; + }; + my $code = filter_blocks(substr($source,$pos[0],$pos[4]-$pos[0]),line(substr($source,0,$pos[0]),$line)); +- $code =~ s/{/{ local \$::_S_W_I_T_C_H; Switch::switch $arg;/; ++ $code =~ s/{/{ local \$::_S_W_I_T_C_H; Switch::switch($arg);/; + $text .= $code . 'continue {last}'; + next component; + } diff --git a/perl-Switch.spec b/perl-Switch.spec new file mode 100644 index 0000000..83ee7b4 --- /dev/null +++ b/perl-Switch.spec @@ -0,0 +1,48 @@ +Name: perl-Switch +Version: 2.16 +Release: 1%{?dist} +Summary: A switch statement for Perl +Group: Development/Libraries +License: GPL+ or Artistic +URL: http://search.cpan.org/dist/Switch/ +Source0: http://search.cpan.org/CPAN/authors/id/R/RG/RGARCIA/Switch-%{version}.tar.gz +# From OpenSUSE, fix test failures with perl 5.14 +Patch0: Switch-2.16-perl514.patch +BuildRequires: perl(ExtUtils::MakeMaker) +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +BuildArch: noarch + +%description +Switch.pm provides the syntax and semantics for an explicit case mechanism for +Perl. The syntax is minimal, introducing only the keywords C<switch> and +C<case> and conforming to the general pattern of existing Perl control +structures. The semantics are particularly rich, allowing any one (or more) of +nearly 30 forms of matching to be used when comparing a switch value with its +various cases. + +%prep +%setup -q -n Switch-%{version} +%patch0 -p1 -b .514 + +%build +%{__perl} Makefile.PL INSTALLDIRS=vendor +make %{?_smp_mflags} + +%install +make pure_install PERL_INSTALL_ROOT=%{buildroot} +find %{buildroot} -type f -name .packlist -exec rm -f {} ';' +find %{buildroot} -type f -name '*.bs' -a -size 0 -exec rm -f {} ';' +find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null ';' +chmod -R u+w %{buildroot}/* + +%check +make test + +%files +%doc Changes README +%{perl_vendorlib}/Switch.pm +%{_mandir}/man3/*.3* + +%changelog +* Wed Aug 10 2011 Tom Callaway <spot@xxxxxxxxxxxxxxxxx> - 2.16-1 +- initial package diff --git a/sources b/sources index e69de29..83895e4 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +bf75dc7f171b4718a2118c3d6cbe6013 Switch-2.16.tar.gz -- Fedora Extras Perl SIG http://www.fedoraproject.org/wiki/Extras/SIGs/Perl perl-devel mailing list perl-devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/perl-devel