From 1be473653f73f542c0cb343009da52b135649ace Mon Sep 17 00:00:00 2001 From: Shawn Wang Date: Tue, 11 Apr 2023 15:08:57 +0800 Subject: [PATCH] Optimize the spec file Signed-off-by: Shawn Wang --- perl-inc-latest.spec | 65 ++++++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 21 deletions(-) diff --git a/perl-inc-latest.spec b/perl-inc-latest.spec index 8ac90d4..abcc2fd 100644 --- a/perl-inc-latest.spec +++ b/perl-inc-latest.spec @@ -1,52 +1,75 @@ -%define anolis_release 3 +%define anolis_release 4 Name: perl-inc-latest Epoch: 2 Version: 0.500 Release: %{anolis_release}%{?dist} Summary: Use modules bundled in inc/ if they are newer than installed ones -License: ASL 2.0 +License: Apache-2.0 URL: https://metacpan.org/release/inc-latest Source0: https://cpan.metacpan.org/authors/id/D/DA/DAGOLDEN/inc-latest-%{version}.tar.gz BuildArch: noarch -BuildRequires: make -BuildRequires: perl-generators -BuildRequires: perl-interpreter -BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 -BuildRequires: perl(strict) -BuildRequires: perl(warnings) -# Tests -BuildRequires: perl(File::Spec) -BuildRequires: perl(Test::More) +BuildRequires: make perl-generators perl-interpreter +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 perl(strict) perl(warnings) +BuildRequires: perl(File::Spec) perl(Test::More) Requires: perl(ExtUtils::Installed) Conflicts: perl-Module-Build < 2:0.42.10-4 %description -The inc::latest module helps bootstrap configure-time dependencies for CPAN -distributions. These dependencies get bundled into the inc directory within -a distribution and are used by Makefile.PL or Build.PL. +The "inc::latest" module helps bootstrap configure-time dependencies for +CPAN distributions. These dependencies get bundled into the "inc" +directory within a distribution and are used by Makefile.PL or Build.PL. + +Arguments to "inc::latest" are module names that are checked against +both the current @INC array and against specially-named directories in +"inc". If the bundled version is newer than the installed one (or the +module isn't installed, then, the bundled directory is added to the +start of @INC and the module is loaded from there. + +There are actually two variations of "inc::latest" -- one for authors +and one for the "inc" directory. For distribution authors, the +"inc::latest" installed in the system will record modules loaded via +"inc::latest" and can be used to create the bundled files in "inc", +including writing the second variation as "inc/latest.pm". + +This second "inc::latest" is the one that is loaded in a distribution +being installed (e.g. from Makefile.PL or Build.PL). This bundled +"inc::latest" is the one that determines which module to load. + +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{epoch}:%{version}-%{release} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. %prep -%setup -q -n inc-latest-%{version} +%autosetup -n inc-latest-%{version} %build -perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 -make %{?_smp_mflags} +perl Makefile.PL NO_PACKLIST=1 INSTALLDIRS=vendor +%make_build %install -make pure_install DESTDIR=$RPM_BUILD_ROOT +%make_build DESTDIR=$RPM_BUILD_ROOT pure_install %{_fixperms} $RPM_BUILD_ROOT/* %check -make test +%make_build test %files %license LICENSE +%{perl_vendorlib}/inc +%{_mandir}/man3/*.zst + +%files doc %doc Changes README -%{perl_vendorlib}/* -%{_mandir}/man3/* %changelog +* Tue Apr 11 2023 Shawn Wang - 2:0.500-4 +- Optimize the spec file + * Fri Feb 03 2023 mgb01105731 - 2:0.500-3 - remove versioned MODULE_COMPAT_ requires -- Gitee