From 3f004bf7ff0c1d84a8207b559e7c3641aae9ce1c Mon Sep 17 00:00:00 2001 From: Michal Josef Špaček Date: Mar 04 2022 12:09:53 +0000 Subject: [PATCH 1/2] 6.14 bump --- diff --git a/.gitignore b/.gitignore index 65db4fe..acb1894 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /HTTP-Daemon-6.10.tar.gz /HTTP-Daemon-6.12.tar.gz /HTTP-Daemon-6.13.tar.gz +/HTTP-Daemon-6.14.tar.gz diff --git a/perl-HTTP-Daemon.spec b/perl-HTTP-Daemon.spec index aa44d3a..a98b451 100644 --- a/perl-HTTP-Daemon.spec +++ b/perl-HTTP-Daemon.spec @@ -1,5 +1,5 @@ Name: perl-HTTP-Daemon -Version: 6.13 +Version: 6.14 Release: 1%{?dist} Summary: Simple HTTP server class License: GPL+ or Artistic @@ -13,6 +13,7 @@ BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(:VERSION) >= 5.6 BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 +BuildRequires: perl(Module::Build::Tiny) >= 0.034 BuildRequires: perl(strict) # Run-time: BuildRequires: perl(Carp) @@ -28,17 +29,16 @@ BuildRequires: perl(warnings) BuildRequires: perl(Config) BuildRequires: perl(File::Spec) BuildRequires: perl(HTTP::Tiny) >= 0.042 -# LWP::UserAgent not used +BuildRequires: perl(LWP::RobotUA) +BuildRequires: perl(LWP::UserAgent) BuildRequires: perl(Module::Metadata) -# Test not used if LWP::UserAgent is not installed +BuildRequires: perl(Test) BuildRequires: perl(Test::More) >= 0.98 BuildRequires: perl(Test::Needs) -# URI not used +BuildRequires: perl(URI) # Optional tests: # CPAN::Meta not helpful # CPAN::Meta::Prereqs not helpful -# LWP::RobotUA not used -# LWP::UserAgent not used Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) Requires: perl(HTTP::Date) >= 6 Requires: perl(HTTP::Request) >= 6 @@ -69,9 +69,6 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 %{_fixperms} %{buildroot}/* %check -# Some tests are skipped with "Can't talk to ourself (misconfigured system)". -# These tests actually are never run becuse the required CAN_TALK_TO_OURSELF -# file is never created. Those are author's tests. make test %files @@ -81,6 +78,9 @@ make test %{_mandir}/man3/* %changelog +* Fri Mar 04 2022 Michal Josef Špaček - 6.14-1 +- 6.14 bump + * Thu Feb 10 2022 Michal Josef Špaček - 6.13-1 - 6.13 bump diff --git a/sources b/sources index f155bbd..c77c0e8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (HTTP-Daemon-6.13.tar.gz) = 8f13d2aab9d6372a7c9af78aa114de487b6f5b99892adf6cc4d47901dd2c31efdd0b68c34995d42b30de35a130be9babb44789ce7725402460926f964b59fc17 +SHA512 (HTTP-Daemon-6.14.tar.gz) = baae522b24211d04bc53d0f89f9e7b6b98681772eb79e28a72aa2b57c023a92e1264923abc2fefc24e28be265e17530541fd9d3a559d5bcfca00a8f5b0e9d85e From eb605a445cda64849ee97a9b7820353c46e771cf Mon Sep 17 00:00:00 2001 From: Michal Josef Špaček Date: Mar 04 2022 12:09:53 +0000 Subject: [PATCH 2/2] Package tests --- 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/perl-HTTP-Daemon.rpmlintrc b/perl-HTTP-Daemon.rpmlintrc new file mode 100644 index 0000000..3c67f8c --- /dev/null +++ b/perl-HTTP-Daemon.rpmlintrc @@ -0,0 +1,2 @@ +from Config import * +addFilter("-tests.noarch: W: no-documentation"); diff --git a/perl-HTTP-Daemon.spec b/perl-HTTP-Daemon.spec index a98b451..73939e4 100644 --- a/perl-HTTP-Daemon.spec +++ b/perl-HTTP-Daemon.spec @@ -8,7 +8,9 @@ Source0: https://cpan.metacpan.org/authors/id/O/OA/OALDERS/HTTP-Daemon-%{ # Use Makefile.PL without unneeded dependencies Patch0: HTTP-Daemon-6.04-EU-MM-is-not-deprecated.patch BuildArch: noarch +BuildRequires: coreutils BuildRequires: make +BuildRequires: findutils BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(:VERSION) >= 5.6 @@ -56,9 +58,27 @@ Instances of the HTTP::Daemon class are HTTP/1.1 servers that listen on a socket for incoming requests. The HTTP::Daemon is a subclass of IO::Socket::IP, so you can perform socket operations directly on it too. +%package tests +Summary: Tests for %{name} +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: perl-Test-Harness +# perl-generators doesn't detect 'use Test::Needs 'LWP::RobotUA';' +Requires: perl(LWP::RobotUA) +# perl-generators doesn't detect 'use Test::Needs 'LWP::UserAgent';' +Requires: perl(LWP::UserAgent) + +%description tests +Tests from %{name}. Execute them +with "%{_libexecdir}/%{name}/test". + %prep %setup -q -n HTTP-Daemon-%{version} %patch0 -p1 +# Help generators to recognize Perl scripts +for F in $(find t/ -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 NO_PERLLOCAL=1 @@ -66,6 +86,14 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 %install %{make_install} +# 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)" -r +EOF +chmod +x %{buildroot}%{_libexecdir}/%{name}/test %{_fixperms} %{buildroot}/* %check @@ -77,9 +105,13 @@ make test %{perl_vendorlib}/* %{_mandir}/man3/* +%files tests +%{_libexecdir}/%{name} + %changelog * Fri Mar 04 2022 Michal Josef Špaček - 6.14-1 - 6.14 bump +- Package unit tests * Thu Feb 10 2022 Michal Josef Špaček - 6.13-1 - 6.13 bump 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/tests/upstream-tests.fmf b/tests/upstream-tests.fmf new file mode 100644 index 0000000..6149e87 --- /dev/null +++ b/tests/upstream-tests.fmf @@ -0,0 +1,4 @@ +summary: Upstream tests +component: perl-HTTP-Daemon +require: perl-HTTP-Daemon-tests +test: /usr/libexec/perl-HTTP-Daemon/test