From 9fbf8b548c1f3dd6b746b34e2cc10ca6d11e5cfb Mon Sep 17 00:00:00 2001 From: Xuchun Shang Date: Thu, 13 Apr 2023 11:22:31 +0800 Subject: [PATCH] Optimize the spec Signed-off-by: Xuchun Shang --- perl-threads.spec | 66 ++++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/perl-threads.spec b/perl-threads.spec index 6c22ec0..7915cb5 100644 --- a/perl-threads.spec +++ b/perl-threads.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 %global base_version 2.21 Name: perl-threads Epoch: 1 @@ -8,55 +8,64 @@ Summary: Perl interpreter-based threads License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/threads Source0: https://cpan.metacpan.org/authors/id/J/JD/JDHEDDEN/threads-%{base_version}.tar.gz -# Unbundled from perl 5.28.0 Patch0: threads-2.21-Upgrade-to-2.22.patch -# Unbundled from perl 5.32.0 Patch1: threads-2.21-Upgrade-to-2.25.patch -# Unbundled from perl 5.34.0 Patch2: threads-2.25-Upgrade-to-2.26.patch -# Unbundled from perl 5.35.11 Patch3: threads-2.26-Upgrade-to-2.27.patch +BuildRequires: gcc make BuildRequires: coreutils BuildRequires: findutils -BuildRequires: gcc -BuildRequires: make BuildRequires: perl-devel BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(Config) -BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 -BuildRequires: perl(File::Spec) BuildRequires: perl(strict) BuildRequires: perl(warnings) -# Run-time: +BuildRequires: perl(File::Spec) +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 BuildRequires: perl(Carp) BuildRequires: perl(overload) BuildRequires: perl(XSLoader) -# Tests only: -BuildRequires: perl(blib) BuildRequires: perl(Cwd) -BuildRequires: perl(ExtUtils::testlib) +BuildRequires: perl(blib) +BuildRequires: perl(POSIX) +BuildRequires: perl(IO::File) BuildRequires: perl(File::Path) BuildRequires: perl(Hash::Util) -BuildRequires: perl(IO::File) -BuildRequires: perl(POSIX) BuildRequires: perl(Test::More) -# Optional tests: +BuildRequires: perl(ExtUtils::testlib) +Requires: perl(Carp) BuildRequires: perl(Thread::Queue) BuildRequires: perl(Thread::Semaphore) BuildRequires: perl(threads::shared) -Requires: perl(Carp) %{?perl_default_filter} %description -Since Perl 5.8, thread programming has been available using a model called -interpreter threads which provides a new Perl interpreter for each thread, -and, by default, results in no data or state information being shared -between threads. +Perl-threads is a module in Perl that provides support for multiple threads of +control in a Perl program. Threads are lightweight processes that can run +concurrently within a single program. They provide a way to perform multiple +tasks simultaneously, which can greatly enhance the performance and +responsiveness of a program. + +The Perl-threads module provides a simple and easy-to-use interface for +creating and managing threads in a Perl program. It provides functions for +creating new threads, starting and stopping threads, and for communicating +between threads using shared data structures. -(Prior to Perl 5.8, 5005threads was available through the "Thread.pm" API. -This threading model has been deprecated, and was removed as of Perl 5.10.0.) +One of the key features of Perl-threads is its ability to perform true parallel +processing. This means that multiple threads can execute code simultaneously on +different processors or cores, allowing for maximum use of available system +resources. + +Another important feature of Perl-threads is its support for thread +synchronization. This allows multiple threads to coordinate their actions and +avoid conflicts when accessing shared resources, such as variables or files. + +Perl-threads also provides a number of other advanced features, such as +thread-local variables, which allow each thread to have its own private data, +and thread pools, which can be used to manage a group of threads for a specific +task. %package doc Summary: Documentation files for %{name} @@ -67,11 +76,7 @@ BuildArch: noarch The %{name}-doc package contains documentation files for %{name}. %prep -%setup -q -n threads-%{base_version} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 +%autosetup -p1 -n threads-%{base_version} chmod -x examples/* %build @@ -89,14 +94,17 @@ unset GIT_DIR PERL_BUILD_PACKAGING PERL_CORE PERL_RUNPERL_DEBUG \ make test %files +%{_mandir}/man3/* %{perl_vendorarch}/auto/* %{perl_vendorarch}/threads* -%{_mandir}/man3/* %files doc %doc Changes examples README %changelog +* Thu Apr 13 2023 Xuchun Shang - 1:2.27-2 +- Optimize the spec + * Thu Feb 09 2023 mgb01105731 - 1:2.27-1 - remove versioned MODULE_COMPAT_ requires - update to version 2.27 -- Gitee