From 1de4e3da71da84180feb10d476f7e2083e02c37866c5c995fc897eb8f834861c Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Tue, 20 Oct 2020 12:23:51 +0000 Subject: [PATCH] Accepting request 842154 from devel:languages:perl:CPAN-L Required by perl-Code-TidyAll which again is needed for update of perl-Task-Kensho-ModuleDev in TW. OBS-URL: https://build.opensuse.org/request/show/842154 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-lib-relative?expand=0&rev=1 --- .gitattributes | 23 ++++++++++++ .gitignore | 1 + lib-relative-1.000.tar.gz | 3 ++ perl-lib-relative.changes | 4 ++ perl-lib-relative.spec | 78 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 109 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 lib-relative-1.000.tar.gz create mode 100644 perl-lib-relative.changes create mode 100644 perl-lib-relative.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/lib-relative-1.000.tar.gz b/lib-relative-1.000.tar.gz new file mode 100644 index 0000000..c4cdb8c --- /dev/null +++ b/lib-relative-1.000.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dfe0c7005fd8bddd25a7e8c2504b0fade162c74ca71b4f7acb7e8e76106d6cd7 +size 16156 diff --git a/perl-lib-relative.changes b/perl-lib-relative.changes new file mode 100644 index 0000000..9caa6ff --- /dev/null +++ b/perl-lib-relative.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Fri Oct 16 15:42:57 UTC 2020 - Dirk Stoecker + +- Created diff --git a/perl-lib-relative.spec b/perl-lib-relative.spec new file mode 100644 index 0000000..85fef3f --- /dev/null +++ b/perl-lib-relative.spec @@ -0,0 +1,78 @@ +# +# spec file for package perl-lib-relative +# +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: perl-lib-relative +Version: 1.000 +Release: 0 +%define cpan_name lib-relative +Summary: Add paths relative to the current file to @INC +License: Artistic-2.0 +Group: Development/Libraries/Perl +Url: https://metacpan.org/release/%{cpan_name} +Source0: https://cpan.metacpan.org/authors/id/D/DB/DBOOK/%{cpan_name}-%{version}.tar.gz +BuildArch: noarch +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: perl +BuildRequires: perl-macros +BuildRequires: perl(File::Temp) >= 0.19 +BuildRequires: perl(Test::More) >= 0.88 +%{perl_requires} + +%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'. + +If this module is already available to be loaded, it can be used as with +lib.pm, passing relative paths, which will be absolutized relative to the +current file then passed on to lib. Multiple arguments will be separately +absolutized, and absolute paths will be passed on unchanged. + +For cases where this module cannot be loaded beforehand, the last section +of the "SYNOPSIS" can be copy-pasted into a file to perform the same task. + +%prep +%setup -q -n %{cpan_name}-%{version} + +%build +perl Makefile.PL INSTALLDIRS=vendor +make %{?_smp_mflags} + +%check +make test + +%install +%perl_make_install +%perl_process_packlist +%perl_gen_filelist + +%files -f %{name}.files +%defattr(-,root,root,755) +%doc Changes CONTRIBUTING.md README +%license LICENSE + +%changelog