diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore index 79552dc..3631050 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ POE-Component-IRC-6.14.tar.gz /POE-Component-IRC-6.68.tar.gz /POE-Component-IRC-6.88.tar.gz /POE-Component-IRC-6.90.tar.gz +/POE-Component-IRC-6.91.tar.gz +/POE-Component-IRC-6.92.tar.gz +/POE-Component-IRC-6.93.tar.gz diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..282e16b --- /dev/null +++ b/gating.yaml @@ -0,0 +1,7 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_stable +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} diff --git a/perl-POE-Component-IRC.rpmlintrc b/perl-POE-Component-IRC.rpmlintrc new file mode 100644 index 0000000..1118857 --- /dev/null +++ b/perl-POE-Component-IRC.rpmlintrc @@ -0,0 +1,2 @@ +from Config import * +addFilter("-tests\\.noarch: W: no-documentation") diff --git a/perl-POE-Component-IRC.spec b/perl-POE-Component-IRC.spec index e7c1cbd..4f4e43c 100644 --- a/perl-POE-Component-IRC.spec +++ b/perl-POE-Component-IRC.spec @@ -9,8 +9,8 @@ Name: perl-POE-Component-IRC Summary: A POE component for building IRC clients -Version: 6.90 -Release: 10%{?dist} +Version: 6.93 +Release: 1%{?dist} License: GPL+ or Artistic Source0: https://cpan.metacpan.org/authors/id/B/BI/BINGOS/POE-Component-IRC-%{version}.tar.gz URL: https://metacpan.org/release/POE-Component-IRC @@ -20,10 +20,10 @@ BuildRequires: make BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(:VERSION) >= 5.8.1 +BuildRequires: perl(Config) BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 BuildRequires: perl(strict) BuildRequires: perl(warnings) -BuildRequires: sed # Run-time: BuildRequires: perl(base) BuildRequires: perl(Carp) @@ -67,10 +67,9 @@ BuildRequires: perl(Socket6) # Tests: BuildRequires: perl(Crypt::PasswdMD5) BuildRequires: perl(Data::Dumper) -BuildRequires: perl(Digest::MD5) BuildRequires: perl(File::Temp) BuildRequires: perl(lib) -# TODO: Unbundle Net::Netmask +BuildRequires: perl(Net::Netmask) BuildRequires: perl(POE::Component::Client::Ident::Agent) # TODO: Unbundle POE::Component::Server::IRC %if %{with perl_POE_Component_IRC_enables_ipv6} @@ -107,7 +106,10 @@ Requires: perl(Socket6) %{?perl_default_filter} # Remove under-specified dependencies -%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\((IRC::Utils|List::Util|POE|POE::Filter::IRCD)\\)$ +%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\((IRC::Utils|List::Util|POE|POE::Filter::IRCD|Test::Differences|Test::More)\\)$ +# Remove private modules +%global __requires_exclude %{__requires_exclude}|^perl\\(POE::Component::Server::IRC.*\\)$ +%global __provides_exclude %{?__provides_exclude:%{__provides_exclude}|}^perl\\((POE::Component::IRC::Test::Plugin|POE::Component::Server::IRC.*)\\) %description POE::Component::IRC is a POE component (who'd have guessed?) which acts as an @@ -117,22 +119,82 @@ where to connect to, and it sends back interesting IRC events when they happen. You make the client do things by sending it events. That's all there is to it. Cool, no? +%package tests +Summary: Tests for %{name} +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: coreutils +Requires: perl-Test-Harness +Requires: perl(IRC::Utils) >= 0.12 +Requires: perl(List::Util) >= 1.33 +Requires: perl(POE) >= 1.311 +%if %{with perl_POE_Component_IRC_enables_dns} +Requires: perl(POE::Component::Client::DNS) >= 0.99 +%endif +Requires: perl(POE::Filter::IRCD) >= 2.42 +Requires: perl(POE::Filter::Line) +%if %{with perl_POE_Component_IRC_enables_zlib} +Requires: perl(POE::Filter::Zlib::Stream) >= 1.96 +%endif +Requires: perl(POE::Wheel::ReadWrite) +Requires: perl(POE::Wheel::SocketFactory) +%if %{with perl_POE_Component_IRC_enables_ipv6} +Requires: perl(Socket::GetAddrInfo) +%endif +%if %{with perl_POE_Component_IRC_enables_ipv6} +Requires: perl(Socket6) +%endif +Requires: perl(Test::Differences) >= 0.61 +Requires: perl(Test::More) >= 0.47 +Provides: bundled(POE-Component-Server-IRC) = 1.52 + +%description tests +Tests from %{name}. Execute them +with "%{_libexecdir}/%{name}/test". + %prep %setup -q -n POE-Component-IRC-%{version} chmod -c -x examples/* # Remove bundled modules -rm -r t/inc/Crypt -sed -i -e '/^t\/inc\/Crypt/d' MANIFEST +for D in t/inc/Crypt t/inc/Net; do + rm -r "$D" + perl -i -ne 'print $_ unless m{\A\Q'"$D"'\E/}' MANIFEST +done +# Remove online tests +for T in t/02_behavior/06_online.t; do + rm "$T" + perl -i -ne 'print $_ unless m{\A\Q'"$T"'\E\b}' MANIFEST +done +# Help generators to recognize Perl scripts +for F in $(find t -type f -name '*.t'); do + perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!\s*perl}{$Config{startperl}}' "$F" + chmod +x "$F" +done %build -perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 -make %{?_smp_mflags} +perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 +%{make_build} %install -make pure_install DESTDIR=%{buildroot} +%{make_install} %{_fixperms} %{buildroot}/* +# Install tests +mkdir -p %{buildroot}%{_libexecdir}/%{name} +cp -a Changes t %{buildroot}%{_libexecdir}/%{name} +cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF' +#!/bin/bash +set -e +# t/04_plugins/17_dcc/04_send_spaces.t writes to CWD +DIR=$(mktemp -d) +cp -a %{_libexecdir}/%{name}/* "$DIR" +pushd "$DIR" +prove -I . -r -j "$(getconf _NPROCESSORS_ONLN)" +popd +rm -r "$DIR" +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 @@ -141,7 +203,21 @@ make test %{perl_vendorlib}/* %{_mandir}/man3/*.3* +%files tests +%{_libexecdir}/%{name} + %changelog +* Wed Jun 16 2021 Petr Pisar - 6.93-1 +- 6.93 bump + +* Tue Jun 08 2021 Petr Pisar - 6.92-1 +- 6.92 bump + +* Mon Jun 07 2021 Petr Pisar - 6.91-1 +- 6.91 bump +- Package the tests +- Unbundle Net::Netmask + * Tue Jul 28 2020 Fedora Release Engineering - 6.90-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/plans/sanity.fmf b/plans/sanity.fmf new file mode 100644 index 0000000..a72ded4 --- /dev/null +++ b/plans/sanity.fmf @@ -0,0 +1,5 @@ +summary: Sanity tests +discover: + how: fmf +execute: + how: tmt diff --git a/sources b/sources index 8b124d4..86a5ac1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (POE-Component-IRC-6.90.tar.gz) = c8106bf740a60dc075f99df40c96f30232f69f1369ea5f68ce10636ab0640536ef2c806d73e721f21c21043ab7c386a1e54e099241bd52070648ffc9fd010750 +SHA512 (POE-Component-IRC-6.93.tar.gz) = 334535cb4f02c63fbc8b457b9e5c6d8cb96ef0ac159ac6f810d7cda337f55a729b73115a65dfca11c44ca286d355667500b021cd5408943a1afd2d325ece7be0 diff --git a/tests/upstream-tests.fmf b/tests/upstream-tests.fmf new file mode 100644 index 0000000..e67e129 --- /dev/null +++ b/tests/upstream-tests.fmf @@ -0,0 +1,4 @@ +summary: Upstream tests +component: perl-POE-Component-IRC +require: perl-POE-Component-IRC-tests +test: /usr/libexec/perl-POE-Component-IRC/test