From 8bd3306bdb23da09b9675a073e124a7bd0a794ac Mon Sep 17 00:00:00 2001 From: yuanhui Date: Sat, 15 Apr 2023 14:07:55 +0800 Subject: [PATCH] Optimize the spec file Signed-off-by: yuanhui --- perl-Task-Weaken.spec | 62 ++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/perl-Task-Weaken.spec b/perl-Task-Weaken.spec index bbe6963..ca0fd86 100644 --- a/perl-Task-Weaken.spec +++ b/perl-Task-Weaken.spec @@ -1,59 +1,71 @@ -%define anolis_release 1 +%define anolis_release 2 + Name: perl-Task-Weaken Version: 1.06 Release: %{anolis_release}%{?dist} -Summary: Ensure that a platform has weaken support License: GPL+ or Artistic +Summary: Ensure that a platform has weaken support URL: https://metacpan.org/release/Task-Weaken Source0: https://cpan.metacpan.org/authors/id/E/ET/ETHER/Task-Weaken-%{version}.tar.gz BuildArch: noarch # Build -BuildRequires: coreutils -BuildRequires: make -BuildRequires: perl-generators -BuildRequires: perl-interpreter -BuildRequires: perl(:VERSION) >= 5.6 -BuildRequires: perl(Config) -BuildRequires: perl(ExtUtils::MakeMaker) -BuildRequires: perl(File::Spec) -BuildRequires: perl(strict) -BuildRequires: perl(warnings) -# Run-time: -BuildRequires: perl(Scalar::Util) >= 1.14 +BuildRequires: make coreutils +BuildRequires: perl(:VERSION) >= 5.6 perl-interpreter perl-generators +BuildRequires: perl(File::Spec) perl(Config) perl(ExtUtils::MakeMaker) +BuildRequires: perl(strict) perl(Scalar::Util) >= 1.14 perl(warnings) # Tests -BuildRequires: perl(File::Spec::Functions) -BuildRequires: perl(Test::More) >= 0.42 +BuildRequires: perl(Test::More) >= 0.42 perl(File::Spec::Functions) # Dependencies Requires: perl(Scalar::Util) >= 1.14 %description -One recurring problem in modules that use Scalar::Util's weaken function is -that it is not present in the pure-perl variant. +One recurring problem in modules that use Scalar::Util's weaken function is that it is not +present in the pure-perl variant. + +While this isn't necessarily always a problem in a straight CPAN-based Perl environment, some +operating system distributions only include the pure-Perl versions, don't include the XS version, +and so weaken is then "missing" from the platform, despite passing a dependency on Scalar::Util +successfully. + +Most notably this is RedHat Linux at time of writing, but other come and go and do the same +thing, hence "recurring problem". -This restores the functionality testing to a dependency you do once in -your Makefile.PL, rather than something you have to write extra tests -for each time you write a module. +The normal solution is to manually write tests in each distribution to ensure that weaken +is available. + +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{EVR} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. %prep -%setup -q -n Task-Weaken-%{version} +%autosetup -p1 -n Task-Weaken-%{version} %build %{__perl} Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 make %{?_smp_mflags} %install -make pure_install DESTDIR=$RPM_BUILD_ROOT -%{_fixperms} -c $RPM_BUILD_ROOT +make pure_install DESTDIR=%{buildroot} +%{_fixperms} -c %{buildroot} %check make test %files %license LICENSE -%doc Changes CONTRIBUTING README %{perl_vendorlib}/Task/ %{_mandir}/man3/Task::Weaken.3* +%files doc +%doc README Changes CONTRIBUTING + %changelog +* Sat Apr 15 2023 yuanhui - 1.06-2 +- Optimize the spec file + * Wed Feb 01 2023 Chunmei Xu - 1.06-1 - init from upstream -- Gitee