From 286f11fe4204c5a24de5c2a1b09a0854c8124470 Mon Sep 17 00:00:00 2001 From: yuanhui Date: Fri, 14 Apr 2023 16:38:37 +0800 Subject: [PATCH] Optimize the spec file Signed-off-by: yuanhui --- perl-experimental.spec | 66 ++++++++++++------------------------------ 1 file changed, 19 insertions(+), 47 deletions(-) diff --git a/perl-experimental.spec b/perl-experimental.spec index 0db7fd9..04f851e 100644 --- a/perl-experimental.spec +++ b/perl-experimental.spec @@ -1,4 +1,5 @@ -%define anolis_release 1 +%define anolis_release 2 + Name: perl-experimental Version: 0.031 Release: %{anolis_release}%{?dist} @@ -7,37 +8,23 @@ License: GPL+ or Artistic URL: https://metacpan.org/release/experimental Source0: https://cpan.metacpan.org/authors/id/L/LE/LEONT/experimental-%{version}.tar.gz BuildArch: noarch -BuildRequires: coreutils -BuildRequires: make -BuildRequires: perl-generators -BuildRequires: perl-interpreter -BuildRequires: perl(Config) -BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 -BuildRequires: perl(strict) -BuildRequires: perl(warnings) + +BuildRequires: make coreutils +BuildRequires: perl-interpreter perl-generators +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 perl(Config) perl(strict) perl(warnings) # Run-time: -BuildRequires: perl(Carp) -# feature is highly recommended on perl >= 5.10 -BuildRequires: perl(feature) -BuildRequires: perl(version) +BuildRequires: perl(Carp) perl(feature) perl(version) # Tests: BuildRequires: perl(Test::More) >= 0.89 -# feature is highly recommended on perl >= 5.10 Requires: perl(feature) - + +Obsoletes: %{name}-tests < %{EVR} + %description -This pragma provides an easy and convenient way to enable or disable -experimental features. - -%package tests -Summary: Tests for %{name} -Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} -Requires: perl-Test-Harness - -%description tests -Tests from %{name}. Execute them -with "%{_libexecdir}/%{name}/test". - +perl-experimental is a Perl module that provides some experimental features that may change or +be removed in future versions. This module is intended to allow developers to test and use +these features to provide feedback and suggestions. + %package doc Summary: Documentation files for %{name} Requires: %{name} = %{EVR} @@ -47,13 +34,7 @@ BuildArch: noarch The %{name}-doc package contains documentation files for %{name}. %prep -%setup -q -n experimental-%{version} - -# Help file to recognise the Perl scripts -for F in t/*.t; do - perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F" - chmod +x "$F" -done +%autosetup -n experimental-%{version} -p1 %build perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 @@ -63,15 +44,6 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 %{make_install} %{_fixperms} %{buildroot}/* -# Install tests -mkdir -p %{buildroot}%{_libexecdir}/%{name} -cp -a t %{buildroot}%{_libexecdir}/%{name} -cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF' -#!/bin/sh -cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)" -EOF -chmod +x %{buildroot}%{_libexecdir}/%{name}/test - %check export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}') make test @@ -81,13 +53,13 @@ make test %{perl_vendorlib}/* %{_mandir}/man3/* -%files tests -%{_libexecdir}/%{name} - %files doc -%doc Changes README +%doc README Changes INSTALL %changelog +* Fri Apr 14 2023 yuanhui - 0.031-2 +- Optimize the spec file + * Fri Feb 10 2023 mgb01105731 - 0.031-1 - update to version 0.031 -- Gitee