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
8f53201
%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}
74b9100
Version:        1.5.6
74b9100
Release:        1%{?dist}
bcd0013
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
fc5fa85
Requires:       python3-cliff
David Moreau Simard 12b153d
Requires:       python3-pbr
6b37477
98e9281
%description -n python3-%{srcname}
98e9281
%{summary}
6b37477
bcd0013
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
2527ca0
BuildRequires:  python3-ruamel-yaml
94dc9fc
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
2527ca0
Requires:       python3-ruamel-yaml
e0e0734
Requires:       python3-tzlocal
98e9281
Requires:       python3-whitenoise
98e9281
98e9281
%description -n python3-%{srcname}-server
98e9281
%{summary}
98e9281
bcd0013
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
bcd0013
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
bcd0013
%{summary}
6b37477
bcd0013
This package installs the documentation
7b84b52
%endif
6b37477
6b37477
%prep
98e9281
%autosetup -n %{srcname}-%{version} -S git
6b37477
6b37477
%build
bcd0013
# Substitute python3 shebang for the one provided by the distribution
bcd0013
sed -i -e 's|/usr/bin/env python3|/usr/bin/python3|' ara/server/__main__.py
bcd0013
6b37477
%py3_build
7b84b52
%if 0%{?with_docs}
6b37477
sphinx-build -b html doc/source doc/build/html
bcd0013
# Remove sphinx build leftovers
bcd0013
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
fc5fa85
%{_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
74b9100
* Thu Apr 15 2021 David Moreau Simard <moi@dmsimard.com> - 1.5.6-1
74b9100
- Update to latest upstream release
74b9100
528515c
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.4-2
528515c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
528515c
77d4b54
* Mon Dec 21 2020 David Moreau Simard <moi@dmsimard.com> - 1.5.4-1
77d4b54
- Update to latest upstream release
77d4b54
200ae4a
* Fri Oct 23 2020 David Moreau Simard <moi@dmsimard.com> - 1.5.3-1
200ae4a
- Update to latest upstream release
200ae4a
David Moreau Simard 12b153d
* Wed Sep 23 2020 David Moreau Simard <moi@dmsimard.com> - 1.5.1-2
David Moreau Simard 12b153d
- Add missing requirement on pbr
David Moreau Simard 12b153d
fc5fa85
* Wed Sep 23 2020 David Moreau Simard <moi@dmsimard.com> - 1.5.1-1
fc5fa85
- Update to latest upstream release
fc5fa85
- Add requirement on python3-cliff (new CLI client)
fc5fa85
2527ca0
* Tue Aug 11 2020 David Moreau Simard <moi@dmsimard.com> - 1.4.3-1
2527ca0
- Update to latest upstream release
2527ca0
- Change pyyaml to ruamel.yaml as preferred by dynaconf
2527ca0
3609473
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.0-5
3609473
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
3609473
8f53201
* Mon Jun 08 2020 Miro Hrončok <mhroncok@redhat.com> - 1.4.0-4
8f53201
- Rebuilt for Python 3.9
8f53201
5ae3c15
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.4.0-3
94dc9fc
- Bootstrap for Python 3.9
5ae3c15
3388cfa
* Mon Apr 20 2020 David Moreau Simard <dmsimard@redhat.com> - 1.4.0-1
bcd0013
- Update to latest upstream release
bcd0013
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