spec: Default to not shipping tests on RHEL > 7

We weren't shipping it in RHEL7 either. It also brings in a dependency
on Python, which is tricky there. (And anyway
`gnome-desktop-testing-runner` isn't even packaged there).

Make it a bcond though so one can still build it if one desires. (And
symmetrically, to *not* build it on Fedora if one desires).
This commit is contained in:
Jonathan Lebon 2018-10-17 10:19:46 -04:00
parent 5bb0359caf
commit f497dc3063

View File

@ -1,3 +1,10 @@
# Don't ship tests on RHEL > 7.
%if 0%{?rhel} > 7
%bcond_with tests
%else
%bcond_without tests
%endif
Summary: Tool for managing bootable, immutable filesystem trees Summary: Tool for managing bootable, immutable filesystem trees
Name: ostree Name: ostree
Version: 2018.8 Version: 2018.8
@ -69,6 +76,7 @@ Requires: ostree
GRUB2 integration for OSTree GRUB2 integration for OSTree
%endif %endif
%if %{with tests}
%package tests %package tests
Summary: Tests for the %{name} package Summary: Tests for the %{name} package
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
@ -76,6 +84,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description tests %description tests
This package contains tests that can be used to verify This package contains tests that can be used to verify
the functionality of the installed %{name} package. the functionality of the installed %{name} package.
%endif
%prep %prep
%autosetup -Sgit -n libostree-%{version} %autosetup -Sgit -n libostree-%{version}
@ -87,7 +96,7 @@ env NOCONFIGURE=1 ./autogen.sh
--with-selinux \ --with-selinux \
--with-curl \ --with-curl \
--with-openssl \ --with-openssl \
--enable-installed-tests=exclusive \ %{?with_tests:--enable-installed-tests=exclusive} \
--with-dracut=yesbutnoconf \ --with-dracut=yesbutnoconf \
--disable-http2 --disable-http2
%make_build %make_build
@ -144,12 +153,17 @@ find %{buildroot} -name '*.la' -delete
%{_libexecdir}/libostree/grub2* %{_libexecdir}/libostree/grub2*
%endif %endif
%if %{with tests}
%files tests %files tests
%{_libexecdir}/installed-tests %{_libexecdir}/installed-tests
%{_datadir}/installed-tests %{_datadir}/installed-tests
%{_libexecdir}/libostree/ostree-trivial-httpd %{_libexecdir}/libostree/ostree-trivial-httpd
%endif
%changelog %changelog
* Wed Oct 17 2018 Jonathan Lebon <jonathan@jlebon.com>
- Add conditional for tests and disable by default on RHEL > 7
* Wed Aug 22 2018 Colin Walters <walters@verbum.org> - 2018.8-1 * Wed Aug 22 2018 Colin Walters <walters@verbum.org> - 2018.8-1
- https://github.com/ostreedev/ostree/releases/tag/v2018.8 - https://github.com/ostreedev/ostree/releases/tag/v2018.8