From 71cdbcda700db2d4de3e4f0c7db1583df8d15a56 Mon Sep 17 00:00:00 2001 From: yuanhui Date: Thu, 13 Apr 2023 09:52:10 +0800 Subject: [PATCH] Optimize the spec file Signed-off-by: yuanhui --- perl-Sys-Syslog.spec | 81 +++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 50 deletions(-) diff --git a/perl-Sys-Syslog.spec b/perl-Sys-Syslog.spec index 2f097dc..4b1ecd7 100644 --- a/perl-Sys-Syslog.spec +++ b/perl-Sys-Syslog.spec @@ -1,5 +1,6 @@ -%define anolis_release 3 -%bcond_without perl_Sys_Syslog_enables_optional_test +%define anolis_release 4 + +%bcond_without optional_test Name: perl-Sys-Syslog Epoch: 1 @@ -9,53 +10,31 @@ Summary: Perl interface to the UNIX syslog(3) calls License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/Sys-Syslog Source0: https://cpan.metacpan.org/authors/id/S/SA/SAPER/Sys-Syslog-%{version}.tar.gz -BuildRequires: coreutils -BuildRequires: findutils -BuildRequires: gcc -BuildRequires: glibc-common -BuildRequires: make -BuildRequires: perl-devel -BuildRequires: perl-generators -BuildRequires: perl-interpreter -BuildRequires: perl(Config) -BuildRequires: perl(ExtUtils::Constant) -BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 -BuildRequires: perl(File::Copy) -BuildRequires: perl(File::Spec) -BuildRequires: perl(strict) -# Run-time: -BuildRequires: perl(Carp) -BuildRequires: perl(constant) -BuildRequires: perl(Exporter) -BuildRequires: perl(Fcntl) -BuildRequires: perl(File::Basename) -BuildRequires: perl(POSIX) -BuildRequires: perl(Socket) -BuildRequires: perl(vars) -BuildRequires: perl(warnings) -BuildRequires: perl(warnings::register) -BuildRequires: perl(XSLoader) -# DynaLoader not used -# Tests: -BuildRequires: perl(FileHandle) -BuildRequires: perl(Data::Dumper) -BuildRequires: perl(Test::More) -# Optional tests: -%if !%{defined perl_bootstrap} && %{with perl_Sys_Syslog_enables_optional_test} -BuildRequires: perl(Test::NoWarnings) -BuildRequires: perl(Test::Pod) >= 1.14 -BuildRequires: perl(Test::Pod::Coverage) >= 1.06 -BuildRequires: perl(Test::Portability::Files) -# POE::Component::Server::Syslog is not packaged yet + +BuildRequires: coreutils findutils gcc make glibc-common +BuildRequires: perl-devel perl-generators perl-interpreter +BuildRequires: perl(POSIX) perl(Socket) perl(vars) +BuildRequires: perl(File::Copy) perl(File::Spec) perl(strict) perl(Carp) +BuildRequires: perl(XSLoader) perl(warnings::register) perl(warnings) +BuildRequires: perl(constant) perl(Exporter) perl(Fcntl) perl(File::Basename) +BuildRequires: perl(Config) perl(ExtUtils::Constant) perl(ExtUtils::MakeMaker) >= 6.76 + +# Tests: +BuildRequires: perl(FileHandle) perl(Data::Dumper) perl(Test::More) +%if !%{defined perl_bootstrap} && %{with optional_test} +BuildRequires: perl(Test::NoWarnings) perl(Test::Pod) >= 1.14 perl(Test::Pod::Coverage) >= 1.06 perl(Test::Portability::Files) %endif -Requires: perl(Fcntl) -Requires: perl(XSLoader) + +Requires: perl(Fcntl) perl(XSLoader) %{?perl_default_filter} %description -Sys::Syslog is an interface to the UNIX syslog(3) function. Call syslog() with -a string priority and a list of printf() arguments just like at syslog(3). +'Sys::Syslog' is an interface to the UNIX 'syslog(3)' program. Call 'syslog()' with a string priority and a list of 'printf()' +args just like 'syslog(3)'. + +Sys::Syslog should work on any Perl since 5.6.0. This module is regularly compiled and tested by the CPAN Testers on +various combinations of Perl and operating systems. %package doc Summary: Doc files for %{name} @@ -66,10 +45,9 @@ BuildArch: noarch Doc files for %{name} %prep -%setup -q -n Sys-Syslog-%{version} +%autosetup -p1 -n Sys-Syslog-%{version} chmod -x eg/* -# Inhibit bundled syslog.h rm -rf fallback perl -i -ne 'print $_ unless m{^fallback/}' MANIFEST # Recode files @@ -78,15 +56,15 @@ for F in Changes; do touch -r "$F" "${F}.utf8" mv "${F}.utf8" "$F" done - + %build perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_OPT_FLAGS" %{make_build} %install %{make_install} -find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete -%{_fixperms} $RPM_BUILD_ROOT/* +find %{buildroot} -type f -name '*.bs' -size 0 -delete +%{_fixperms} %{buildroot}/* %check make test @@ -97,9 +75,12 @@ make test %{_mandir}/man3/* %files doc -%doc Changes eg README +%doc README README.pod Changes eg %changelog +* Wed Apr 12 2023 yuanhui 1:0.36-4 +- Optimize the spec file + * Tue Feb 07 2023 Chunmei Xu - 1:0.36-3 - rebuild with perl_bootstrap disabled -- Gitee