Ai
5 Star 0 Fork 5

src-openEuler/perl-lib-relative
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
perl-lib-relative.spec 3.29 KB
一键复制 编辑 原始数据 按行查看 历史
Name: perl-lib-relative
Version: 1.002
Release: 3
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
%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
%{__perl} Makefile.PL INSTALLDIRS=vendor
%make_build
%install
make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
%{_fixperms} $RPM_BUILD_ROOT/*
%check
make test
%files
%license LICENSE META.json
%doc Changes CONTRIBUTING.md README
%{perl_vendorlib}/*
%files help
%{_mandir}/man?/*
%changelog
* Fri Aug 01 2025 Funda Wang <fundawang@yeah.net> - 1.002-3
- use perl-generators to scan META.json for requirements
* Fri Feb 07 2025 sqfu <dev01203@linx-info.com> - 1.002-2
- drop useless perl(:MODULE_COMPAT) requirement
* Wed Feb 07 2024 woody2918 <wudi1@uniontech.com> - 1.002-1
- Update version to 1.002
- Skip symlink tests on msys as symlinks are broken on this platform
- Fix checking whether symlinks are available for testing on Win32 and msys
* Tue Jul 13 2021 Perl_Bot <Perl_Bot@openeuler.org> - 1.000-1
- Specfile autogenerated by Perl_Bot
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/perl-lib-relative.git
git@gitee.com:src-openeuler/perl-lib-relative.git
src-openeuler
perl-lib-relative
perl-lib-relative
master

搜索帮助