update to 1.7046 [release 1.7046-1mamba;Wed Apr 19 2023]

This commit is contained in:
Silvan Calarco 2024-01-06 08:33:32 +01:00
parent 949ec91a8e
commit 9ae675b2f5
2 changed files with 131 additions and 6 deletions

114
fatunpack Normal file
View File

@ -0,0 +1,114 @@
#!/usr/bin/perl
use strict;
use warnings;
use File::Path;
use File::Spec;
use Getopt::Long;
my $libdir = 'lib';
my $filter = '';
GetOptions('libdir=s' => \$libdir, 'filter=s' => \$filter) or
die "Could not parse arguments\n";
if ($filter eq '') {
# Empty pattern passes previous result by definition. Do not use it.
# Interpolared compilation is fixed in perl 5.18.0. RT#119095.
$filter = qr/(?:)/;
}
eval { $filter = qr{$filter}; 1} or
die "Could not compile filter as a regular expression: $@\n";
my ($file, $filename, $delimiter);
while (<>) {
if (/^\$fatpacked\{\s*"([^"]*)"\s*\}\s*=.*<<\s*'([^']*)'\s*;/) {
# Packed module beginning found
$filename = $1;
$delimiter = $2;
if ($filename =~ $filter) {
print STDERR "Extracting `$filename'\n";
my $directory = (File::Spec->splitpath($filename))[1];
File::Path::make_path(File::Spec->catfile($libdir, $directory));
if ($file) {
die "Unballanced fat-packed module at line $.\n";
}
open($file, '>', File::Spec->catfile($libdir, $filename)) or
die "Could not create `",
File::Spec->catfile($libdir, $filename), "': $!\n";
} else {
print STDERR "Removing `$filename'\n";
}
} elsif (defined $delimiter and /^\Q$delimiter\E$/) {
# Packed module end found
if (defined $file) {
close($file) or
die "Could not close `",
File::Spec->catfile($libdir, $filename), "': $!\n";
$file = undef;
}
$filename = undef;
$delimiter = undef;
} elsif (defined $file) {
# Packed module to extract
s/^ //; # de-escape recursive here-documents
print $file $_;
} elsif (! defined $delimiter) {
# Rest of code to output
print STDOUT $_;
}
}
__END__
=encoding utf8
=head1 NAME
fatunpack - Unpacker for App::FatPacker packets
=head1 SYNOPSYS
fatunpack [OPTION…] [PACKED_SCRIPT…]
=head1 DESCRIPTION
This tool unpacks scripts packed with App::FatPacker.
Packed script's file names are specified as positional arguments. If no
argument is given, a script from standard intput will be processed.
The content of packed script stripped of all bundled modules is written to
standard output.
=head1 OPTIONS
=over 8
=item B<--libdir DIRECTORY>
Directory to output unpacked modules to that where bundled into the input
script. Default value is C<lib>.
=item B<--filter REGULAR_EXPRESSION>
Save only modules whose file name matches the B<REGULAR_EXPRESSION>. The file
names are compared without B<--libdir> prefix. The expession is not anchored
by default. Empty expression matches any file name. Default value is empty
regular expression, i.e. to save all modules.
=back
=head1 VERSION
This is version 2.
=head1 COPYRIGHT
Copyright © 2013, 2014 Petr Písař <ppisar@redhat.com>.
=head1 LICENSE
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License L<http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.
=cut

View File

@ -1,8 +1,8 @@
%define perl_major_ver %(eval `perl -V:version`; echo ${version%*.[0-9]*}.0) %define perl_major_ver %(eval `perl -V:version`; echo ${version%*.[0-9]*}.0)
Name: perl-App-cpanminus Name: perl-App-cpanminus
Version: 1.7044 Version: 1.7046
Release: 2mamba Release: 1mamba
Summary: cpanm - get, unpack build and install modules from CPAN Summary: cpanm - get, unpack build and install modules from CPAN
Group: System/Libraries/Perl Group: System/Libraries/Perl
Vendor: openmamba Vendor: openmamba
@ -10,11 +10,11 @@ Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://www.cpan.org/ URL: https://www.cpan.org/
Source: https://cpan.metacpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-%{version}.tar.gz Source: https://cpan.metacpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-%{version}.tar.gz
Source1: fatunpack
License: GPL, Artistic License: GPL, Artistic
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: libperl BuildRequires: libperl
BuildRequires: perl(App::cpanminus::Dependency) BuildRequires: perl-String-ShellQuote
BuildRequires: perl(String::ShellQuote)
BuildRequires: perl-devel BuildRequires: perl-devel
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
BuildRequires: perl >= 2:5.36.0 BuildRequires: perl >= 2:5.36.0
@ -26,7 +26,17 @@ cpanm - get, unpack build and install modules from CPAN.
%prep %prep
%setup -q -n App-cpanminus-%{version} %setup -q -n App-cpanminus-%{version}
# Unbundle fat-packed modules
podselect lib/App/cpanminus.pm > lib/App/cpanminus.pod
for F in bin/cpanm lib/App/cpanminus/fatscript.pm; do
%{SOURCE1} --libdir lib --filter '^App/cpanminus' "$F" > "${F}.stripped"
perl -c -Ilib "${F}.stripped"
mv "${F}.stripped" "$F"
done
%build %build
export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
%{__perl} Makefile.PL PREFIX=%{_prefix} INSTALLDIRS=vendor OPTIMIZE="%{optflags}" %{__perl} Makefile.PL PREFIX=%{_prefix} INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
%make %make
@ -52,10 +62,11 @@ done
%files -f .packlist %files -f .packlist
%defattr(-,root,root) %defattr(-,root,root)
%doc LICENSE %doc LICENSE
## note: eventually add the remaining documents (if any)
# %doc README
%changelog %changelog
* Wed Apr 19 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 1.7046-1mamba
- update to 1.7046
* Mon Apr 17 2023 Sdk Build System <sdk@mambasoft.it> 1.7044-2mamba * Mon Apr 17 2023 Sdk Build System <sdk@mambasoft.it> 1.7044-2mamba
- rebuilt with perl 5.36.0 - rebuilt with perl 5.36.0