Package tests

This commit is contained in:
Petr Písař 2021-04-06 14:12:00 +02:00
parent 3ba2be5fa3
commit 1f9a3fd0a6
2 changed files with 38 additions and 2 deletions

2
psutils.rpmlintrc Normal file
View File

@ -0,0 +1,2 @@
from Config import *
addFilter("-tests\.noarch: W: no-documentation")

View File

@ -23,7 +23,7 @@ Summary: PostScript utilities
# pstops.in.in: GPLv3+
# PSUtils.pm: GPLv3+
# README: GPLv3+
## Not in any binary package
## In tests subpackage
# aclocal.m4: FSFULLR
# build-aux/compile: GPLv2+ with Autoconf exception
# build-aux/config.guess: GPLv3+ with Autoconf exception
@ -35,13 +35,14 @@ Summary: PostScript utilities
# build-aux/test-driver: GPLv2+ with Autoconf exception
# build-aux/texinfo.tex: GPLv3+ with TeX exception
# configure: FSFULLR
# INSTALL: FSFAP
# m4/00gnulib.m4: FSFULLR
# m4/ax_check_gnu_make.m4: FSFAP
# m4/gnulib-common.m4: FSFULLR
# m4/gnulib-comp.m4: GPLv3+ with Autoconf exception
# m4/relocatable-lib.m4: FSFULLR
# Makefile.in: FSFULLR
## Not in any binary package
# INSTALL: FSFAP
# old-scripts/fixwfwps: See LICENSE
# pre-inst-env.in: GPLv2+
License: GPLv3+ and psutils
@ -98,6 +99,18 @@ Utilities for manipulating PostScript documents.
Page selection and rearrangement are supported, including arrangement into
signatures for booklet printing, and page merging for n-up printing.
%package tests
Summary: Tests for %{name}
License: GPLv3+ and FSFULLR and MIT and FSFAP
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: coreutils
Requires: diffutils
Requires: make
%description tests
Tests from %{name}. Execute them
with "%{_libexecdir}/%{name}/test".
%prep
%setup -q
%if %{with psutils_enables_unbundling_gnulib}
@ -111,6 +124,24 @@ autoreconf -fi
%install
%{make_install}
# Install tests
mkdir -p %{buildroot}%{_libexecdir}/%{name}
cp -a aclocal.m4 build-aux config.status configure* m4 Makefile* tests %{buildroot}%{_libexecdir}/%{name}
printf '#!/bin/sh\nexec "$@"\n' > %{buildroot}%{_libexecdir}/%{name}/pre-inst-env
chmod +x %{buildroot}%{_libexecdir}/%{name}/pre-inst-env
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
#!/bin/bash
set -e
# Makefile writes into CWD
DIR=$(mktemp -d)
cp -a %{_libexecdir}/%{name}/* "$DIR"
pushd "$DIR"
unset PSUTILS_UNINSTALLED
make -j "$(getconf _NPROCESSORS_ONLN)" check-TESTS
popd
rm -r "$DIR"
EOF
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
%check
unset PSUTILS_UNINSTALLED
@ -142,10 +173,13 @@ make check %{?_smp_mflags}
%{_mandir}/man1/pstops.1*
%{_mandir}/man1/psutils.1*
%files tests
%{_libexecdir}/%{name}
%changelog
* Tue Apr 06 2021 Petr Pisar <ppisar@redhat.com> - 2.05-1
- 2.05 bump
- Package tests
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.04-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild