154baeb
# Don't attempt to build -docs, -tests and -server on rhel/centos until
154baeb
# missing packages are available.
154baeb
%if 0%{?rhel}
154baeb
%global with_docs 0
154baeb
%global with_tests 0
154baeb
%global with_server 0
154baeb
%else
154baeb
%global with_docs 1
154baeb
%global with_tests 1
154baeb
%global with_server 1
154baeb
%endif
154baeb
98e9281
%global srcname ara
6b37477
98e9281
Name:           %{srcname}
4017c2b
Version:        1.4.3
d4da844
Release:        1%{?dist}
0bbba33
Summary:        Records Ansible playbooks and makes them easier to understand and troubleshoot
6b37477
6b37477
License:        GPLv3
98e9281
URL:            https://github.com/ansible-community/ara
98e9281
Source0:        https://pypi.io/packages/source/a/%{srcname}/%{srcname}-%{version}.tar.gz
6b37477
BuildArch:      noarch
6b37477
6b37477
BuildRequires:  git
6b37477
98e9281
Requires:       python3-%{srcname} = %{version}-%{release}
6b37477
6b37477
%description
98e9281
%{summary}
98e9281
98e9281
%package -n python3-%{srcname}
6b37477
Summary:        %{summary}
6b37477
6b37477
BuildRequires:  python3-devel
6b37477
BuildRequires:  python3-pbr
6b37477
98e9281
Requires:       python3-requests
ce5e931
Requires:       python3-pbr
6b37477
98e9281
%description -n python3-%{srcname}
98e9281
%{summary}
6b37477
0bbba33
This package installs the python files and Ansible plugins
6b37477
154baeb
%if 0%{?with_server}
98e9281
%package -n python3-%{srcname}-server
98e9281
Summary:        %{summary}
6b37477
4da98c5
Provides:       %{srcname}-server = %{version}-%{release}
4da98c5
98e9281
# Test dependencies for check macro
98e9281
BuildRequires:  python3-django
98e9281
BuildRequires:  python3-django-cors-headers
a5a6db3
BuildRequires:  python3-django-health-check
98e9281
BuildRequires:  python3-django-filter
98e9281
BuildRequires:  python3-django-rest-framework
98e9281
BuildRequires:  python3-dynaconf
98e9281
BuildRequires:  python3-factory-boy
98e9281
BuildRequires:  python3-faker
a8fee36
BuildRequires:  python3-pygments
4017c2b
BuildRequires:  python3-ruamel-yaml
4017c2b
BuildRequires:  python3-requests
a5a6db3
BuildRequires:  python3-tzlocal
98e9281
BuildRequires:  python3-whitenoise
98e9281
98e9281
Requires:       python3-%{srcname}
98e9281
Requires:       python3-django
98e9281
Requires:       python3-django-cors-headers
a5a6db3
Requires:       python3-django-health-check
98e9281
Requires:       python3-django-filter
98e9281
Requires:       python3-django-rest-framework
98e9281
Requires:       python3-dynaconf
a8fee36
Requires:       python3-pygments
4017c2b
Requires:       python3-ruamel-yaml
a5a6db3
Requires:       python3-tzlocal
98e9281
Requires:       python3-whitenoise
98e9281
98e9281
%description -n python3-%{srcname}-server
98e9281
%{summary}
98e9281
0bbba33
This package installs the API server dependencies
154baeb
%endif
98e9281
154baeb
%if 0%{?with_tests}
98e9281
%package -n python3-%{srcname}-tests
98e9281
Summary:        %{summary}
6b37477
98e9281
Requires:       python3-%{srcname}-server = %{version}-%{release}
98e9281
Requires:       python3-factory-boy
98e9281
Requires:       python3-faker
98e9281
98e9281
%description -n python3-%{srcname}-tests
98e9281
%{summary}
6b37477
0bbba33
This package installs the test dependencies
154baeb
%endif
6b37477
154baeb
%if 0%{?with_docs}
6b37477
%package doc
98e9281
Summary:        %{summary}
6b37477
6b37477
BuildRequires:  python3-sphinx
6b37477
BuildRequires:  python3-sphinx_rtd_theme
d4da844
BuildRequires:  python3-sphinxcontrib-programoutput
d4da844
# The API server dependencies need to be installed so the snippets from
d4da844
# sphinxcontrib-programoutput can be generated
d4da844
BuildRequires:  python3-%{srcname}-server
6b37477
6b37477
%description doc
0bbba33
%{summary}
6b37477
0bbba33
This package installs the documentation
154baeb
%endif
6b37477
6b37477
%prep
98e9281
%autosetup -n %{srcname}-%{version} -S git
6b37477
6b37477
%build
0bbba33
# Substitute python3 shebang for the one provided by the distribution
0bbba33
sed -i -e 's|/usr/bin/env python3|/usr/bin/python3|' ara/server/__main__.py
0bbba33
6b37477
%py3_build
154baeb
%if 0%{?with_docs}
6b37477
sphinx-build -b html doc/source doc/build/html
0bbba33
# Remove sphinx build leftovers
0bbba33
rm -rf doc/build/html/.{doctrees,buildinfo}
154baeb
%endif
6b37477
6b37477
%install
6b37477
%py3_install
6b37477
154baeb
%if 0%{?with_tests}
6b37477
%check
6b37477
# Run unit tests
98e9281
cd %{_builddir}/%{srcname}-%{version}
a5a6db3
# Set time zone to UTC -- buildsystem's timezone is "local" which isn't valid
a5a6db3
ARA_TIME_ZONE=UTC %{__python3} manage.py test %{srcname}
154baeb
%endif
6b37477
6b37477
%files
6b37477
%doc README.rst
6b37477
%license LICENSE
6b37477
98e9281
%files -n python3-%{srcname}
6b37477
%doc README.rst
6b37477
%license LICENSE
98e9281
%{python3_sitelib}/%{srcname}
98e9281
%{python3_sitelib}/%{srcname}-*.egg-info
98e9281
%exclude %{python3_sitelib}/%{srcname}/api/tests
154baeb
# TODO: ara-manage probably shouldn't get set up if django isn't installed
154baeb
%exclude %{_bindir}/ara-manage
6b37477
154baeb
%if 0%{?with_server}
98e9281
%files -n python3-%{srcname}-server
6b37477
%doc README.rst
6b37477
%license LICENSE
98e9281
%{_bindir}/ara-manage
154baeb
%endif
6b37477
154baeb
%if 0%{?with_tests}
98e9281
%files -n python3-%{srcname}-tests
6b37477
%doc README.rst
6b37477
%license LICENSE
98e9281
%{python3_sitelib}/%{srcname}/api/tests
154baeb
%endif
6b37477
154baeb
%if 0%{?with_docs}
6b37477
%files doc
6b37477
%doc README.rst doc/build/html
6b37477
%license LICENSE
154baeb
%endif
6b37477
6b37477
%changelog
4017c2b
* Tue Aug 11 2020 David Moreau Simard <moi@dmsimard.com> - 1.4.3-1
4017c2b
- Update to latest upstream release
4017c2b
- Change pyyaml to ruamel.yaml as preferred by dynaconf
4017c2b
ce5e931
* Mon Jun 01 2020 David Moreau Simard <moi@dmsimard.com> - 1.4.1-1
ce5e931
- Update to latest upstream release
ce5e931
- Add missing requirement on python3-pbr
ce5e931
0bbba33
* Mon Apr 20 2020 David Moreau Simard <dmsimard@redhat.com> - 1.4.0-1
0bbba33
- Update to latest upstream release
0bbba33
61db19e
* Fri Dec 13 2019 David Moreau Simard <dmsimard@redhat.com> - 1.3.2
61db19e
- Update to latest upstream release
61db19e
d4da844
* Tue Dec 3 2019 David Moreau Simard <dmsimard@redhat.com> - 1.3.0
d4da844
- Update to latest upstream release
d4da844
a8fee36
* Wed Nov 6 2019 David Moreau Simard <dmsimard@redhat.com> - 1.2.0-2
a8fee36
- Add missing pygments dependency
a8fee36
a5a6db3
* Wed Nov 6 2019 David Moreau Simard <dmsimard@redhat.com> - 1.2.0-1
a5a6db3
- Update to latest upstream release
a5a6db3
4da98c5
* Tue Oct 8 2019 David Moreau Simard <dmsimard@redhat.com> - 1.1.0-3
4da98c5
- Add an ara-server package alias to python3-ara-server
4da98c5
98e9281
* Tue Sep 10 2019 David Moreau Simard <dmsimard@redhat.com> - 1.1.0-1
98e9281
- Update to latest upstream release
98e9281
6b37477
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.1-4
6b37477
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
6b37477
6b37477
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.1-3
6b37477
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
6b37477
6b37477
* Mon Sep 10 2018 David Moreau Simard <dmsimard@redhat.com> - 0.16.1
6b37477
- Update to latest upstream release
6b37477
- Default to python3
6b37477
6b37477
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.6-3
6b37477
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
6b37477
6b37477
* Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 0.14.6-2
6b37477
- Rebuilt for Python 3.7
6b37477
6b37477
* Sat Feb 24 2018 David Moreau Simard <dmsimard@redhat.com> - 0.14.6-1
6b37477
- Update to upstream 0.14.6
6b37477
6b37477
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.0-2
6b37477
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
6b37477
6b37477
* Sat Aug 5 2017 David Moreau Simard <dmsimard@redhat.com> - 0.14.0-1
6b37477
- First packaged version of ARA