From c0702bfb4028bb91dea82f5972600c75a29cd047 Mon Sep 17 00:00:00 2001 From: David Moreau Simard Date: Jan 23 2020 16:49:51 +0000 Subject: WIP: Don't attempt to build server, docs and tests for now --- diff --git a/ara.spec b/ara.spec index 57b51c6..bdd95f6 100644 --- a/ara.spec +++ b/ara.spec @@ -1,3 +1,15 @@ +# Don't attempt to build -docs, -tests and -server on rhel/centos until +# missing packages are available. +%if 0%{?rhel} +%global with_docs 0 +%global with_tests 0 +%global with_server 0 +%else +%global with_docs 1 +%global with_tests 1 +%global with_server 1 +%endif + %global srcname ara Name: %{srcname} @@ -35,6 +47,7 @@ Requires: python3-requests This package contains the python files and Ansible plugins +%if 0%{?with_server} %package -n python3-%{srcname}-server Summary: %{summary} @@ -70,7 +83,9 @@ Requires: python3-whitenoise %{summary} This package installs the necessary dependencies to run the API server +%endif +%if 0%{?with_tests} %package -n python3-%{srcname}-tests Summary: %{summary} @@ -82,7 +97,9 @@ Requires: python3-faker %{summary} This package installs the necessary test dependencies and contains the test files +%endif +%if 0%{?with_docs} %package doc Summary: %{summary} @@ -97,22 +114,27 @@ BuildRequires: python3-%{srcname}-server %{common_desc} This package installs the documentation files +%endif %prep %autosetup -n %{srcname}-%{version} -S git %build %py3_build +%if 0%{?with_docs} sphinx-build -b html doc/source doc/build/html +%endif %install %py3_install +%if 0%{?with_tests} %check # Run unit tests cd %{_builddir}/%{srcname}-%{version} # Set time zone to UTC -- buildsystem's timezone is "local" which isn't valid ARA_TIME_ZONE=UTC %{__python3} manage.py test %{srcname} +%endif %files %doc README.rst @@ -124,20 +146,28 @@ ARA_TIME_ZONE=UTC %{__python3} manage.py test %{srcname} %{python3_sitelib}/%{srcname} %{python3_sitelib}/%{srcname}-*.egg-info %exclude %{python3_sitelib}/%{srcname}/api/tests +# TODO: ara-manage probably shouldn't get set up if django isn't installed +%exclude %{_bindir}/ara-manage +%if 0%{?with_server} %files -n python3-%{srcname}-server %doc README.rst %license LICENSE %{_bindir}/ara-manage +%endif +%if 0%{?with_tests} %files -n python3-%{srcname}-tests %doc README.rst %license LICENSE %{python3_sitelib}/%{srcname}/api/tests +%endif +%if 0%{?with_docs} %files doc %doc README.rst doc/build/html %license LICENSE +%endif %changelog * Fri Dec 13 2019 David Moreau Simard - 1.3.2