From 407461decbc440dbc1fe57c339a28e94bd698d97 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Thu, 6 Sep 2018 15:17:16 +0000 Subject: [PATCH] - perl >= 5.28 fixes --- perl.patch | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ shorewall.spec | 7 ++--- 2 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 perl.patch diff --git a/perl.patch b/perl.patch new file mode 100644 index 0000000..a285d57 --- /dev/null +++ b/perl.patch @@ -0,0 +1,69 @@ +diff -ur shorewall-5.2.0.5.orig/shorewall-5.2.0.5/Perl/Shorewall/Chains.pm shorewall-5.2.0.5/shorewall-5.2.0.5/Perl/Shorewall/Chains.pm +--- shorewall-5.2.0.5.orig/shorewall-5.2.0.5/Perl/Shorewall/Chains.pm 2018-08-05 17:31:09.000000000 +0000 ++++ shorewall-5.2.0.5/shorewall-5.2.0.5/Perl/Shorewall/Chains.pm 2018-09-06 15:14:31.187972699 +0000 +@@ -5819,7 +5819,7 @@ + + $chain =~ s/[^\w-]//g; + # $1 $2 - $3 +- while ( $condition =~ m( ^(.*?) @({)?(?:0|chain)(?(2)}) (.*)$ )x ) { ++ while ( $condition =~ m( ^(.*?) @(\{)?(?:0|chain)(?(2)}) (.*)$ )x ) { + $condition = join( '', $1, $chain, $3 ); + } + +diff -ur shorewall-5.2.0.5.orig/shorewall-5.2.0.5/Perl/Shorewall/Config.pm shorewall-5.2.0.5/shorewall-5.2.0.5/Perl/Shorewall/Config.pm +--- shorewall-5.2.0.5.orig/shorewall-5.2.0.5/Perl/Shorewall/Config.pm 2018-08-05 17:31:09.000000000 +0000 ++++ shorewall-5.2.0.5/shorewall-5.2.0.5/Perl/Shorewall/Config.pm 2018-09-06 15:14:25.806972759 +0000 +@@ -2833,7 +2833,7 @@ + } + + # $1 $2 $3 - $4 +- while ( $expression =~ m( ^(.*?) \$({)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) { ++ while ( $expression =~ m( ^(.*?) \$(\{)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) { + my ( $first, $var, $rest ) = ( $1, $3, $4); + + if ( $var =~ /^\d+$/ ) { +@@ -2850,7 +2850,7 @@ + + if ( $chain ) { + # $1 $2 $3 - $4 +- while ( $expression =~ m( ^(.*?) \@({)? (\d+|[a-zA-Z]\w*) (?(2)}) (.*)$ )x ) { ++ while ( $expression =~ m( ^(.*?) \@(\{)? (\d+|[a-zA-Z]\w*) (?(2)}) (.*)$ )x ) { + my ( $first, $var, $rest ) = ( $1, $3, $4); + $var = numeric_value( $var ) if $var =~ /^\d/; + $val = $var ? $actparams{$var} : $chain; +@@ -2861,7 +2861,7 @@ + } + + # $1 $2 $3 - $4 +- while ( $expression =~ m( ^(.*?) __({)? (\w+) (?(2)}) (.*)$ )x ) { ++ while ( $expression =~ m( ^(.*?) __(\{)? (\w+) (?(2)}) (.*)$ )x ) { + my ( $first, $cap, $rest ) = ( $1, $3, $4); + + if ( exists $capdesc{$cap} ) { +@@ -3791,7 +3791,7 @@ + my ( $lineref, $count ) = ( $_[0], 0 ); + my $chain = $actparams{chain}; + # $1 $2 $3 - $4 +- while ( $$lineref =~ m( ^(.*?) \$({)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) { ++ while ( $$lineref =~ m( ^(.*?) \$(\{)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) { + + my ( $first, $var, $rest ) = ( $1, $3, $4); + +@@ -3830,7 +3830,7 @@ + # + $$lineref =~ s/\\@/??/g; + # $1 $2 $3 - $4 +- while ( $$lineref =~ m( ^(.*?) \@({)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) { ++ while ( $$lineref =~ m( ^(.*?) \@(\{)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) { + my ( $first, $var, $rest ) = ( $1, $3, $4); + my $val = $var ? $actparams{$var} : $actparams{chain}; + $usedcaller = USEDCALLER if $var eq 'caller'; +@@ -3846,7 +3846,7 @@ + sub expand_shorewallrc_variables( \$ ) { + my ( $lineref, $count ) = ( $_[0], 0 ); + # $1 $2 $3 - $4 +- while ( $$lineref =~ m( ^(.*?) \$({)? (\d+|[a-zA-Z]\w*) (?(2)}) (.*)$ )x ) { ++ while ( $$lineref =~ m( ^(.*?) \$(\{)? (\d+|[a-zA-Z]\w*) (?(2)}) (.*)$ )x ) { + + my ( $first, $var, $rest ) = ( $1, $3, $4); + diff --git a/shorewall.spec b/shorewall.spec index 0f383e9..9dec2f2 100644 --- a/shorewall.spec +++ b/shorewall.spec @@ -1,13 +1,12 @@ # NOTE: # A very helpful document for packaging Shorewall is "Anatomy of Shorewall 4.0" # which is found at http://www.shorewall.net/Anatomy.html -# TODO -# - rc-script inits +# Summary: Shoreline Firewall - an iptables-based firewall for Linux systems Summary(pl.UTF-8): Shoreline Firewall - zapora sieciowa oparta na iptables Name: shorewall Version: 5.2.0.5 -Release: 1 +Release: 2 License: GPL Group: Networking/Utilities Source0: http://www.shorewall.net/pub/shorewall/5.2/shorewall-5.2.0/%{name}-%{version}.tar.bz2 @@ -30,6 +29,7 @@ Patch2: tld.patch Patch3: man.patch Patch4: init.patch Patch5: shell-fix.patch +Patch6: perl.patch URL: http://www.shorewall.net/ BuildRequires: perl BuildRequires: perl(Digest::SHA) @@ -147,6 +147,7 @@ done %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 # Remove hash-bang from files which are not directly executed as shell # scripts. This silences some rpmlint errors. -- 2.44.0