diff --git a/lib-relative-1.000.tar.gz b/lib-relative-1.000.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..446de010dfa5298c2320d2b80197413b0ea8eeb5 Binary files /dev/null and b/lib-relative-1.000.tar.gz differ diff --git a/perl-lib-relative.spec b/perl-lib-relative.spec new file mode 100644 index 0000000000000000000000000000000000000000..6d95383b90dfd0245b3c52a3514aa6359f953953 --- /dev/null +++ b/perl-lib-relative.spec @@ -0,0 +1,99 @@ +%global _empty_manifest_terminate_build 0 +Name: perl-lib-relative +Version: 1.000 +Release: 1 +Summary: Add paths relative to the current file to @INC +License: Artistic 2.0 +Group: Development/Libraries +URL: http://search.cpan.org/dist/lib-relative/ +Source0: http://www.cpan.org/authors/id/D/DB/DBOOK/lib-relative-%{version}.tar.gz +BuildArch: noarch +BuildRequires: perl >= 0:5.006001 +BuildRequires: perl-generators +BuildRequires: perl(Cwd) +BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: perl(File::Spec) +BuildRequires: perl(File::Temp) >= 0.19 +BuildRequires: perl(Test::More) >= 0.88 +Requires: perl(Cwd) +Requires: perl(File::Spec) +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +%description +Adding a path to @INC to load modules from a local directory may seem +simple, but has a few common pitfalls to be aware of. Directly adding a +relative path to @INC means that any later code that changes the current +working directory will change where modules are loaded from. This applies +to the . path that used to be in @INC by default until perl 5.26.0, or a +relative path added in code like use lib 'path/to/lib', and may be a +vulnerability if such a location is not supposed to be writable. +Additionally, the commonly used FindBin module relies on interpreter state +and the path to the original script invoked by the perl interpreter, +sometimes requiring workarounds in uncommon cases like generated or +embedded code. This module proposes a more straightforward method: take a +path relative to the current file, absolutize it, and add it to @INC. +%package help +Summary : Add paths relative to the current file to @INC +Provides: perl-lib-relative-doc +%description help +Adding a path to @INC to load modules from a local directory may seem +simple, but has a few common pitfalls to be aware of. Directly adding a +relative path to @INC means that any later code that changes the current +working directory will change where modules are loaded from. This applies +to the . path that used to be in @INC by default until perl 5.26.0, or a +relative path added in code like use lib 'path/to/lib', and may be a +vulnerability if such a location is not supposed to be writable. +Additionally, the commonly used FindBin module relies on interpreter state +and the path to the original script invoked by the perl interpreter, +sometimes requiring workarounds in uncommon cases like generated or +embedded code. This module proposes a more straightforward method: take a +path relative to the current file, absolutize it, and add it to @INC. +%prep +%setup -q -n lib-relative-%{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 CONTRIBUTING.md cpanfile dist.ini LICENSE META.json README +%{perl_vendorlib}/* +%files help +%{_mandir}/* + +%changelog +* Tue Jul 13 2021 Perl_Bot 1.000-1 +- Specfile autogenerated by Perl_Bot