Init package
This commit is contained in:
parent
85d8c8c4c7
commit
342bc0d962
BIN
Eval-Closure-0.14.tar.gz
Normal file
BIN
Eval-Closure-0.14.tar.gz
Normal file
Binary file not shown.
121
perl-Eval-Closure.spec
Normal file
121
perl-Eval-Closure.spec
Normal file
@ -0,0 +1,121 @@
|
||||
%global _empty_manifest_terminate_build 0
|
||||
|
||||
Name: perl-Eval-Closure
|
||||
Version: 0.14
|
||||
Release: 1
|
||||
Summary: Safely and cleanly create closures via string eval
|
||||
License: GPL+ or Artistic
|
||||
URL: https://metacpan.org/release/Eval-Closure
|
||||
Source0: https://cpan.metacpan.org/authors/id/D/DO/DOY/Eval-Closure-%{version}.tar.gz
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: coreutils
|
||||
BuildRequires: findutils
|
||||
BuildRequires: make
|
||||
BuildRequires: perl-interpreter
|
||||
BuildRequires: perl-generators
|
||||
BuildRequires: perl(ExtUtils::MakeMaker)
|
||||
BuildRequires: perl(Carp)
|
||||
BuildRequires: perl(constant)
|
||||
BuildRequires: perl(Devel::LexAlias) >= 0.05
|
||||
BuildRequires: perl(Exporter)
|
||||
BuildRequires: perl(overload)
|
||||
BuildRequires: perl(Perl::Tidy)
|
||||
BuildRequires: perl(Scalar::Util)
|
||||
BuildRequires: perl(strict)
|
||||
BuildRequires: perl(B)
|
||||
BuildRequires: perl(blib)
|
||||
BuildRequires: perl(File::Spec)
|
||||
BuildRequires: perl(IO::Handle)
|
||||
BuildRequires: perl(IPC::Open3)
|
||||
BuildRequires: perl(PadWalker)
|
||||
BuildRequires: perl(Test::Fatal)
|
||||
BuildRequires: perl(Test::More) >= 0.88
|
||||
BuildRequires: perl(Test::Requires)
|
||||
BuildRequires: perl(warnings)
|
||||
Requires: perl(Devel::LexAlias) >= 0.05
|
||||
Requires: perl(Perl::Tidy)
|
||||
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
|
||||
|
||||
%description
|
||||
String eval is often used for dynamic code generation. For instance, Moose uses
|
||||
it heavily, to generate inlined versions of accessors and constructors, which
|
||||
speeds code up at runtime by a significant amount. String eval is not without
|
||||
its issues however - it's difficult to control the scope it's used in (which
|
||||
determines which variables are in scope inside the eval), and it can be quite
|
||||
slow, especially if doing a large number of evals.
|
||||
|
||||
This module attempts to solve both of those problems. It provides an
|
||||
eval_closure function, which evals a string in a clean environment, other than
|
||||
a fixed list of specified variables. It also caches the result of the eval, so
|
||||
that doing repeated evals of the same source, even with a different
|
||||
environment, will be much faster (but note that the description is part of the
|
||||
string to be evaled, so it must also be the same (or non-existent) if caching
|
||||
is to work properly).
|
||||
|
||||
%package help
|
||||
Summary: Safely and cleanly create closures via string eval
|
||||
Provides: perl-Eval-Closure-doc
|
||||
|
||||
%description help
|
||||
String eval is often used for dynamic code generation. For instance, Moose
|
||||
uses it heavily, to generate inlined versions of accessors and
|
||||
constructors, which speeds code up at runtime by a significant amount.
|
||||
String eval is not without its issues however - it's difficult to control
|
||||
the scope it's used in (which determines which variables are in scope
|
||||
inside the eval), and it's easy to miss compilation errors, since eval
|
||||
catches them and sticks them in $@ instead.
|
||||
|
||||
%prep
|
||||
%setup -q -n Eval-Closure-%{version}
|
||||
|
||||
%build
|
||||
export PERL_MM_OPT=""
|
||||
%{__perl} Makefile.PL INSTALLDIRS=vendor
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
export PERL_MM_OPT=""
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
make pure_install PERL_INSTALL_ROOT=$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/*
|
||||
|
||||
pushd %{buildroot}
|
||||
touch filelist.lst
|
||||
if [ -d usr/bin ];then
|
||||
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
|
||||
fi
|
||||
if [ -d usr/sbin ];then
|
||||
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
|
||||
fi
|
||||
if [ -d usr/lib64 ];then
|
||||
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
|
||||
fi
|
||||
if [ -d usr/lib ];then
|
||||
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
|
||||
fi
|
||||
popd
|
||||
mv %{buildroot}/filelist.lst .
|
||||
|
||||
%check
|
||||
make test
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files -f filelist.lst
|
||||
%defattr(-,root,root,-)
|
||||
%doc Changes dist.ini LICENSE META.json README
|
||||
%{perl_vendorlib}/*
|
||||
|
||||
%files help
|
||||
%{_mandir}/*
|
||||
|
||||
%changelog
|
||||
* Wed Jun 29 2022 misaka00251 <misaka00251@misakanet.cn> - 0.14-1
|
||||
- Init package
|
||||
Loading…
x
Reference in New Issue
Block a user