From 268e9c17882dc1304b6eccd265bf82069e1eadd25a334885e10e07b19ab49e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 6 Jun 2019 12:01:23 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinxcontrib-applehelp?expand=0&rev=2 --- python-sphinxcontrib-applehelp.spec | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/python-sphinxcontrib-applehelp.spec b/python-sphinxcontrib-applehelp.spec index 14f4ae7..b786a59 100644 --- a/python-sphinxcontrib-applehelp.spec +++ b/python-sphinxcontrib-applehelp.spec @@ -17,20 +17,30 @@ %define skip_python2 1 +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif %{?!python_module:%define python_module() python-%{**} python3-%{**}} -Name: python-sphinxcontrib-applehelp +Name: python-sphinxcontrib-applehelp%{psuffix} Version: 1.0.1 Release: 0 -Summary: sphinx extension which outputs Apple help books +Summary: Sphinx extension which outputs Apple help books License: BSD-2-Clause Group: Development/Languages/Python URL: https://github.com/sphinx-doc/sphinxcontrib-applehelp Source: https://files.pythonhosted.org/packages/source/s/sphinxcontrib-applehelp/sphinxcontrib-applehelp-%{version}.tar.gz -BuildRequires: %{python_module Sphinx >= 1} +%if %{with test} +BuildRequires: %{python_module Sphinx} BuildRequires: %{python_module pytest} +%endif BuildRequires: %{python_module setuptools} BuildRequires: gettext-tools -Requires: python-Sphinx >= 1 +Requires: python-Sphinx BuildRequires: fdupes BuildRequires: python-rpm-macros BuildArch: noarch @@ -46,15 +56,21 @@ sphinxcontrib-applehelp is a sphinx extension which outputs Apple help books %python_build %install +%if !%{with test} %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif +%if %{with test} %check %pytest +%endif +%if !%{with test} %files %{python_files} %doc README.rst CHANGES %license LICENSE %{python_sitelib}/* +%endif %changelog