From 4f99a025318699e9084091a547c1c55ef9aec168 Mon Sep 17 00:00:00 2001 From: yuanhui Date: Wed, 12 Apr 2023 10:32:51 +0800 Subject: [PATCH] Optimize the spec file Signed-off-by: yuanhui --- perl-Devel-PPPort.spec | 104 +++++++++-------------------------------- 1 file changed, 22 insertions(+), 82 deletions(-) diff --git a/perl-Devel-PPPort.spec b/perl-Devel-PPPort.spec index 395a77f..bfc8421 100644 --- a/perl-Devel-PPPort.spec +++ b/perl-Devel-PPPort.spec @@ -1,6 +1,4 @@ -%define anolis_release 3 -# Perform optional tests -%bcond_without perl_Devel_PPPort_enables_optional_test +%define anolis_release 4 Name: perl-Devel-PPPort Version: 3.68 @@ -9,76 +7,33 @@ Summary: Perl Pollution Portability header generator License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/Devel-PPPort Source0: https://cpan.metacpan.org/authors/id/A/AT/ATOOMIC/Devel-PPPort-%{version}.tar.gz -BuildRequires: coreutils -BuildRequires: findutils -BuildRequires: gcc -BuildRequires: make -BuildRequires: perl-devel -BuildRequires: perl-generators -BuildRequires: perl-interpreter -BuildRequires: perl(:VERSION) >= 5.3 -BuildRequires: perl(Config) -BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 -BuildRequires: perl(strict) -BuildRequires: perl(vars) -# Run-time: -# warnings in PPPort.pm not used + +BuildRequires: gcc make coreutils findutils +BuildRequires: perl(strict) perl(vars) +BuildRequires: perl-devel perl-generators perl-interpreter +BuildRequires: perl(:VERSION) >= 5.3 perl(Config) perl(ExtUtils::MakeMaker) >= 6.76 # Tests: -BuildRequires: perl(DynaLoader) -BuildRequires: perl(File::Path) -BuildRequires: perl(FindBin) -BuildRequires: perl(less) -BuildRequires: perl(lib) -BuildRequires: perl(Tie::Hash) -BuildRequires: perl(utf8) -BuildRequires: perl(warnings) -%if %{with perl_Devel_PPPort_enables_optional_test} && !%{defined %perl_bootstrap} -# Optional tests: -# File::Spec not helpful -BuildRequires: perl(Test::Pod) >= 0.95 -%endif - -# Filter modules bundled for tests -%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}perl\\(.::parts/.*\\) +BuildRequires: perl(DynaLoader) perl(File::Path) perl(FindBin) perl(less) +BuildRequires: perl(lib) perl(Tie::Hash) perl(utf8) perl(warnings) -%description -Perl's API has changed over time, gaining new features, new functions, -increasing its flexibility, and reducing the impact on the C name space -environment (reduced pollution). The header file written by this module, -typically ppport.h, attempts to bring some of the newer Perl API features -to older versions of Perl, so that you can worry less about keeping track -of old releases, but users can still reap the benefit. - -%package tests -Summary: Tests for %{name} -Requires: %{name} = %{EVR} -Requires: perl-Test-Harness -Requires: perl(File::Spec) -Requires: perl(less) -Requires: perl(utf8) +obsoletes: %{name}-tests < %{version}-%{release} -%description tests -Tests from %{name}. Execute them -with "%{_libexecdir}/%{name}/test". +%description +This package is a Perl module that provides a Perl API for parsing C header files and generating +C code that makes Perl modules compatible with older versions of Perl. It is used to make sure +that Perl modules are compatible with older versions of Perl and can be used by other developers +who may not have the latest version of Perl installed. %package doc -Summary: Doc files for %{name} +Summary: Documentation files for %{name} Requires: %{name} = %{EVR} BuildArch: noarch -%description doc -Doc files for %{name} - -%{?perl_default_filter} +%description doc +The %{name}-doc package contains documentation files for %{name}. %prep -%setup -q -n Devel-PPPort-%{version} - -# Help generators to recognize Perl scripts -for F in t/*.t t/*.pl parts/*.pl; do - perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F" - chmod +x "$F" -done +%autosetup -p1 -n Devel-PPPort-%{version} %build perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_OPT_FLAGS" @@ -86,24 +41,9 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_ %install %{make_install} -find %{buildroot} -type f -name '*.bs' -empty -delete %{_fixperms} %{buildroot}/* -# Install tests -mkdir -p %{buildroot}%{_libexecdir}/%{name} -cp -a t parts %{buildroot}%{_libexecdir}/%{name} -perl -i -pe 's{(ppptmp)}{/tmp/$1}' %{buildroot}%{_libexecdir}/%{name}/t/ppphtest.t -rm %{buildroot}%{_libexecdir}/%{name}/t/podtest.t -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 -unset PERL_CORE SKIP_SLOW_TESTS -export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}') -make regen_tests make test %files @@ -111,13 +51,13 @@ make test %{perl_vendorarch}/Devel* %{_mandir}/man3/* -%files tests -%{_libexecdir}/%{name} - %files doc -%doc Changes HACKERS README soak TODO +%doc HACKERS Changes soak README TODO %changelog +* Tue Apr 11 2023 yuanhui - 3.68-4 +- Optimize the spec file + * Tue Feb 07 2023 Chunmei Xu - 3.68-3 - rebuild with perl_bootstrap disabled -- Gitee