diff --git a/Socket-2.032.tar.gz b/Socket-2.032.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5558406a4e75518c743270efbaa76449cb5dd1bd Binary files /dev/null and b/Socket-2.032.tar.gz differ diff --git a/perl-Socket.spec b/perl-Socket.spec new file mode 100644 index 0000000000000000000000000000000000000000..93c831c5f2e4dc3bdfe0b09b3eed720c3c77372a --- /dev/null +++ b/perl-Socket.spec @@ -0,0 +1,100 @@ +%define anolis_release 1 +Name: perl-Socket +Epoch: 4 +Version: 2.032 +Release: %{anolis_release}%{?dist} +Summary: Networking constants and support functions +License: GPL+ or Artistic +URL: https://metacpan.org/release/Socket +Source0: https://cpan.metacpan.org/authors/id/P/PE/PEVANS/Socket-%{version}.tar.gz +BuildRequires: coreutils +BuildRequires: findutils +BuildRequires: gcc +BuildRequires: make +BuildRequires: perl-devel +BuildRequires: perl-macros +BuildRequires: perl-generators +BuildRequires: perl-interpreter +BuildRequires: perl(Config) +BuildRequires: perl(ExtUtils::CBuilder) +BuildRequires: perl(ExtUtils::Constant) >= 0.23 +# ExtUtils::Constant::ProxySubs not used +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 +BuildRequires: perl(strict) +BuildRequires: perl(warnings) +# Run-time: +BuildRequires: perl(:VERSION) >= 5.6.1 +BuildRequires: perl(Carp) +BuildRequires: perl(Exporter) +# Scalar::Util is needed only if getaddrinfo(3) does not exist. Not our case. +BuildRequires: perl(warnings::register) +BuildRequires: perl(XSLoader) +# Tests only: +BuildRequires: perl(Errno) +BuildRequires: perl(Test::More) +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +Requires: perl(:VERSION) >= 5.6.1 + +%{?perl_default_filter} + +%description +This Perl module provides a variety of constants, structure manipulators and +other functions related to socket-based networking. The values and functions +provided are useful when used in conjunction with Perl core functions such as +socket(), setsockopt() and bind(). It also provides several other support +functions, mostly for dealing with conversions of network addresses between +human-readable and native binary forms, and for hostname resolver operations. + +%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". + +%prep +%setup -q -n Socket-%{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 + +%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/* + +# 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 + +%files +%license Artistic Copying LICENSE +%doc Changes +%{perl_vendorarch}/auto/* +%{perl_vendorarch}/Socket* +%{_mandir}/man3/* + +%files tests +%{_libexecdir}/%{name} + +%changelog +* Wed Mar 09 2022 DengXiewei - 4:2.032-1 +- Init from upstream 2.032