7b84b52
# Don't attempt to build -docs, -tests and -server on rhel/centos until
7b84b52
# missing packages are available.
7b84b52
%if 0%{?rhel}
7b84b52
%global with_docs 0
7b84b52
%global with_tests 0
7b84b52
%global with_server 0
7b84b52
%else
7b84b52
%global with_docs 1
7b84b52
%global with_tests 1
7b84b52
%global with_server 1
7b84b52
%endif
7b84b52
98e9281
%global srcname ara
6b37477
98e9281
Name:           %{srcname}
9787b4d
Version:        1.5.4
5d634d1
Release:        1%{?dist}
b3cdd84
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
e446f83
Requires:       python3-cliff
5d634d1
Requires:       python3-pbr
6b37477
98e9281
%description -n python3-%{srcname}
98e9281
%{summary}
6b37477
b3cdd84
This package installs the python files and Ansible plugins
6b37477
7b84b52
%if 0%{?with_server}
98e9281
%package -n python3-%{srcname}-server
98e9281
Summary:        %{summary}
6b37477
a69b0a0
Provides:       %{srcname}-server = %{version}-%{release}
a69b0a0
98e9281
# Test dependencies for check macro
98e9281
BuildRequires:  python3-django
98e9281
BuildRequires:  python3-django-cors-headers
e0e0734
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
f7d2614
BuildRequires:  python3-pygments
eea166a
BuildRequires:  python3-ruamel-yaml
eea166a
BuildRequires:  python3-requests
e0e0734
BuildRequires:  python3-tzlocal
98e9281
BuildRequires:  python3-whitenoise
98e9281
98e9281
Requires:       python3-%{srcname}
98e9281
Requires:       python3-django
98e9281
Requires:       python3-django-cors-headers
e0e0734
Requires:       python3-django-health-check
98e9281
Requires:       python3-django-filter
98e9281
Requires:       python3-django-rest-framework
98e9281
Requires:       python3-dynaconf
f7d2614
Requires:       python3-pygments
eea166a
Requires:       python3-ruamel-yaml
e0e0734
Requires:       python3-tzlocal
98e9281
Requires:       python3-whitenoise
98e9281
98e9281
%description -n python3-%{srcname}-server
98e9281
%{summary}
98e9281
b3cdd84
This package installs the API server dependencies
7b84b52
%endif
98e9281
7b84b52
%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
b3cdd84
This package installs the test dependencies
7b84b52
%endif
6b37477
7b84b52
%if 0%{?with_docs}
6b37477
%package doc
98e9281
Summary:        %{summary}
6b37477
6b37477
BuildRequires:  python3-sphinx
6b37477
BuildRequires:  python3-sphinx_rtd_theme
cefdc93
BuildRequires:  python3-sphinxcontrib-programoutput
cefdc93
# The API server dependencies need to be installed so the snippets from
cefdc93
# sphinxcontrib-programoutput can be generated
cefdc93
BuildRequires:  python3-%{srcname}-server
6b37477
6b37477
%description doc
b3cdd84
%{summary}
6b37477
b3cdd84
This package installs the documentation
7b84b52
%endif
6b37477
6b37477
%prep
98e9281
%autosetup -n %{srcname}-%{version} -S git
6b37477
6b37477
%build
b3cdd84
# Substitute python3 shebang for the one provided by the distribution
b3cdd84
sed -i -e 's|/usr/bin/env python3|/usr/bin/python3|' ara/server/__main__.py
b3cdd84
6b37477
%py3_build
7b84b52
%if 0%{?with_docs}
6b37477
sphinx-build -b html doc/source doc/build/html
b3cdd84
# Remove sphinx build leftovers
b3cdd84
rm -rf doc/build/html/.{doctrees,buildinfo}
7b84b52
%endif
6b37477
6b37477
%install
6b37477
%py3_install
6b37477
7b84b52
%if 0%{?with_tests}
6b37477
%check
6b37477
# Run unit tests
98e9281
cd %{_builddir}/%{srcname}-%{version}
a4224a7
# Set time zone to UTC -- buildsystem's timezone is "local" which isn't valid
bb34fef
ARA_TIME_ZONE=UTC %{__python3} manage.py test %{srcname}
7b84b52
%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
e446f83
%{_bindir}/ara
7b84b52
# TODO: ara-manage probably shouldn't get set up if django isn't installed
7b84b52
%exclude %{_bindir}/ara-manage
6b37477
7b84b52
%if 0%{?with_server}
98e9281
%files -n python3-%{srcname}-server
6b37477
%doc README.rst
6b37477
%license LICENSE
98e9281
%{_bindir}/ara-manage
7b84b52
%endif
6b37477
7b84b52
%if 0%{?with_tests}
98e9281
%files -n python3-%{srcname}-tests
6b37477
%doc README.rst
6b37477
%license LICENSE
98e9281
%{python3_sitelib}/%{srcname}/api/tests
7b84b52
%endif
6b37477
7b84b52
%if 0%{?with_docs}
6b37477
%files doc
6b37477
%doc README.rst doc/build/html
6b37477
%license LICENSE
7b84b52
%endif
6b37477
6b37477
%changelog
9787b4d
* Mon Dec 21 2020 David Moreau Simard <moi@dmsimard.com> - 1.5.4-1
9787b4d
- Update to latest upstream release
9787b4d
fa50172
* Fri Oct 23 2020 David Moreau Simard <moi@dmsimard.com> - 1.5.3-1
fa50172
- Update to latest upstream release
fa50172
e446f83
* Wed Sep 23 2020 David Moreau Simard <moi@dmsimard.com> - 1.5.1-1
e446f83
- Update to latest upstream release
e446f83
- Add requirement on python3-cliff (new CLI client)
e446f83
eea166a
* Tue Aug 11 2020 David Moreau Simard <moi@dmsimard.com> - 1.4.3-1
eea166a
- Update to latest upstream release
eea166a
- Change pyyaml to ruamel.yaml as preferred by dynaconf
eea166a
5d634d1
* Mon Jun 01 2020 David Moreau Simard <moi@dmsimard.com> - 1.4.1-1
5d634d1
- Update to latest upstream release
5d634d1
- Add missing requirement on python3-pbr
5d634d1
3363150
* Mon Apr 20 2020 David Moreau Simard <dmsimard@redhat.com> - 1.4.0-1
b3cdd84
- Update to latest upstream release
b3cdd84
006f206
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-2
006f206
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
006f206
1832170
* Fri Dec 13 2019 David Moreau Simard <dmsimard@redhat.com> - 1.3.2
1832170
- Update to latest upstream release
1832170
cefdc93
* Tue Dec 3 2019 David Moreau Simard <dmsimard@redhat.com> - 1.3.0
cefdc93
- Update to latest upstream release
cefdc93
f7d2614
* Wed Nov 6 2019 David Moreau Simard <dmsimard@redhat.com> - 1.2.0-2
f7d2614
- Add missing pygments dependency
f7d2614
e0e0734
* Wed Nov 6 2019 David Moreau Simard <dmsimard@redhat.com> - 1.2.0-1
e0e0734
- Update to latest upstream release
e0e0734
a69b0a0
* Tue Oct 8 2019 David Moreau Simard <dmsimard@redhat.com> - 1.1.0-3
a69b0a0
- Add an ara-server package alias to python3-ara-server
a69b0a0
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