From 86af18955de58d1b25c44ae2653173c89d763678 Mon Sep 17 00:00:00 2001 From: yuanhui Date: Fri, 14 Apr 2023 17:16:18 +0800 Subject: [PATCH] Optimize the spec file Signed-off-by: yuanhui --- perl-Unicode-Collate.spec | 75 ++++++++++----------------------------- 1 file changed, 18 insertions(+), 57 deletions(-) diff --git a/perl-Unicode-Collate.spec b/perl-Unicode-Collate.spec index c7c2318..5330d21 100644 --- a/perl-Unicode-Collate.spec +++ b/perl-Unicode-Collate.spec @@ -1,43 +1,28 @@ -%define anolis_release 3 +%define anolis_release 4 + Name: perl-Unicode-Collate Version: 1.31 Release: %{anolis_release}%{?dist} -Summary: Unicode Collation Algorithm License: (GPL+ or Artistic) and Unicode +Summary: Unicode Collation Algorithm URL: https://metacpan.org/release/Unicode-Collate Source0: https://cpan.metacpan.org/authors/id/S/SA/SADAHIRO/Unicode-Collate-%{version}.tar.gz -BuildRequires: coreutils -BuildRequires: gcc -BuildRequires: findutils -BuildRequires: make -BuildRequires: perl-devel -BuildRequires: perl-generators -BuildRequires: perl-interpreter -BuildRequires: perl(Carp) -BuildRequires: perl(constant) -BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 -BuildRequires: perl(File::Spec) -BuildRequires: perl(strict) -BuildRequires: perl(warnings) -BuildRequires: perl(base) -BuildRequires: perl(Unicode::Normalize) -BuildRequires: perl(XSLoader) +BuildRequires: gcc findutils make coreutils +BuildRequires: perl-generators perl-interpreter perl-devel +BuildRequires: perl(constant) perl(Carp) perl(File::Spec) perl(strict) +BuildRequires: perl(warnings) perl(ExtUtils::MakeMaker) >= 6.76 +BuildRequires: perl(XSLoader) perl(base) perl(Unicode::Normalize) + Requires: perl(Unicode::Normalize) Conflicts: perl < 4:5.22.0-347 -%description -This package is Perl implementation of Unicode Technical Standard #10 (Unicode -Collation Algorithm). - -%package tests -Summary: Tests for %{name} -Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} -Requires: perl-Test-Harness +Obsoletes: %{name}-tests < %{EVR} -%description tests -Tests from %{name}. Execute them -with "%{_libexecdir}/%{name}/test". +%description +perl-Unicode-Collate is a Perl module that provides an implementation of Unicode +collation algorithms. This module can be used for sorting Unicode strings as well +as comparing and matching strings. %package doc Summary: Documentation files for %{name} @@ -48,24 +33,9 @@ BuildArch: noarch The %{name}-doc package contains documentation files for %{name}. %prep -%setup -q -n Unicode-Collate-%{version} - -# Remove pregenerated files -rm Collate/Locale/* -# Collate/CJK/Korean.pm is an input for the mklocale script, do not remove it - -# 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 Unicode-Collate-%{version} -p1 %build - -perl mklocale -mv Locale/*.pl Collate/Locale -mv Korean.pm Collate/CJK - perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_OPT_FLAGS" %{make_build} @@ -74,15 +44,6 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_ find %{buildroot} -type f -name '*.bs' -size 0 -delete %{_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 . -r -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 @@ -92,13 +53,13 @@ make test %{perl_vendorarch}/Unicode* %{_mandir}/man3/* -%files tests -%{_libexecdir}/%{name} - %files doc %doc Changes README %changelog +* Fri Apr 14 2023 yuanhui - 1.31-4 +- Optimize the spec file + * Wed Feb 08 2023 mgb01105731 - 1.31-3 - remove versioned MODULE_COMPAT_ requires -- Gitee