Package tests

This commit is contained in:
Jitka Plesnikova 2021-03-09 13:23:43 +01:00
parent e048794823
commit 36cd4b33ed

View File

@ -1,6 +1,6 @@
Name: perl-Crypt-OpenSSL-Guess Name: perl-Crypt-OpenSSL-Guess
Version: 0.12 Version: 0.12
Release: 1%{?dist} Release: 2%{?dist}
Summary: Guess OpenSSL include path Summary: Guess OpenSSL include path
License: GPL+ or Artistic License: GPL+ or Artistic
URL: https://metacpan.org/release/Crypt-OpenSSL-Guess/ URL: https://metacpan.org/release/Crypt-OpenSSL-Guess/
@ -33,18 +33,42 @@ Recommends: openssl
Crypt::OpenSSL::Guess provides helpers to guess OpenSSL include path on any Crypt::OpenSSL::Guess provides helpers to guess OpenSSL include path on any
platforms. platforms.
%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 %prep
%setup -q -n Crypt-OpenSSL-Guess-%{version} %setup -q -n Crypt-OpenSSL-Guess-%{version}
# Help file to recognise the Perl scripts
for F in t/*.t; do
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1' "$F"
chmod +x "$F"
done
%build %build
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%{make_build} %{make_build}
%install %install
%{make_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)"
EOF
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
%{_fixperms} $RPM_BUILD_ROOT/* %{_fixperms} $RPM_BUILD_ROOT/*
%check %check
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
make test make test
%files %files
@ -53,10 +77,15 @@ make test
%{perl_vendorlib}/* %{perl_vendorlib}/*
%{_mandir}/man3/* %{_mandir}/man3/*
%files tests
%{_libexecdir}/%{name}
%changelog %changelog
* Tue Mar 09 2021 Jitka Plesnikova <jplesnik@redhat.com> - 0.12-2
- Package tests
* Mon Mar 08 2021 Jitka Plesnikova <jplesnik@redhat.com> - 0.12-1 * Mon Mar 08 2021 Jitka Plesnikova <jplesnik@redhat.com> - 0.12-1
- 0.12 bump - 0.12 bump
- Package tests
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-10 * Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild