From c58a9f781fc45d236a50bed226c9f949241547c4 Mon Sep 17 00:00:00 2001 From: Yuanhong Peng Date: Sat, 15 Apr 2023 13:44:38 +0800 Subject: [PATCH] Refactor the specfile Signed-off-by: Yuanhong Peng --- perl-Module-Load.spec | 58 ++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 36 deletions(-) diff --git a/perl-Module-Load.spec b/perl-Module-Load.spec index 588e67d..9f1eb0b 100644 --- a/perl-Module-Load.spec +++ b/perl-Module-Load.spec @@ -1,42 +1,25 @@ -%define anolis_release 3 -Name: perl-Module-Load -# Epoch to compete with perl.spec +%define anolis_release 4 +%global modname Module-Load + +Name: perl-%{modname} Epoch: 1 Version: 0.36 Release: %{anolis_release}%{?dist} Summary: Run-time require of both modules and files License: GPL+ or Artistic -URL: https://metacpan.org/release/Module-Load -Source0: https://cpan.metacpan.org/modules/by-module/Module/Module-Load-%{version}.tar.gz -BuildArch: noarch -BuildRequires: coreutils -BuildRequires: make -BuildRequires: perl-generators -BuildRequires: perl-interpreter -BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 -BuildRequires: perl(strict) -# Run-time: -BuildRequires: perl(File::Spec) -BuildRequires: perl(warnings) -# Tests: -BuildRequires: perl(Config) -BuildRequires: perl(Data::Dumper) -BuildRequires: perl(Exporter) -BuildRequires: perl(lib) -BuildRequires: perl(Test::More) >= 0.94 -BuildRequires: perl(vars) +URL: https://metacpan.org/release/%{modname} +Source0: https://cpan.metacpan.org/modules/by-module/Module/%{modname}-%{version}.tar.gz -%description -If you consult "perldoc -f require" you will see that "require" will behave -differently when given a bare-word or a string. In the case of a string, -"require" assumes you are wanting to load a file. But in the case of -a bare-word, it assumes you mean a module. +BuildRequires: make coreutils perl-generators perl-interpreter +BuildRequires: perl(warnings) perl(Config) perl(Data::Dumper) perl(Exporter) +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 perl(Test::More) >= 0.94 +BuildRequires: perl(strict) perl(File::Spec) perl(lib) perl(vars) -This gives nasty overhead when you are trying to dynamically require modules -at run-time, since you will need to change the module notation to a file -notation fitting the particular platform you are on. +BuildArch: noarch -"load" eliminates the need for this overhead and will just DWYM. +%description +Module::Load allows for generic loading of modules and files. Simply give it +the name of a module or file and it will Do What You Mean (tm). %package doc Summary: Documentation files for %{name} @@ -47,15 +30,15 @@ BuildArch: noarch The %{name}-doc package contains documentation files for %{name}. %prep -%setup -q -n Module-Load-%{version} +%autosetup -n %{modname}-%{version} %build perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 -%{make_build} +%make_build %install -%{make_install} -%{_fixperms} '%{buildroot}'/* +%make_install +%{_fixperms} -c %{buildroot} %check unset PERL_CORE @@ -66,9 +49,12 @@ make test %{_mandir}/man3/* %files doc -%doc CHANGES README +%doc README CHANGES %changelog +* Sat Apr 15 2023 Yuanhong Peng - 1:0.36-4 +- Refactor the specfile + * Mon Feb 06 2023 mgb01105731 - 1:0.36-3 - remove versioned MODULE_COMPAT_ requires -- Gitee