fd20127
%if 0%{?fedora} || 0%{?rhel} >= 7
5326813
%bcond_without systemd
5326813
%endif
5326813
d94b0fa
%if 0%{?fedora} || 0%{?rhel} >= 8
5326813
%bcond_without python3
fd20127
%endif
fd20127
fd20127
%bcond_without tests
fd20127
c564796
c564796
Name:           nova-agent
3d1e3d3
Version:        2.1.20
67fe126
Release:        5%{?dist}
c564796
Summary:        Agent for setting up clean servers on Xen
c564796
License:        ASL 2.0
c564796
URL:            https://github.com/Rackspace-DOT/nova-agent
cdc3424
Source0:        %{url}/archive/%{version}/nova-agent-%{version}.tar.gz
c564796
BuildArch:      noarch
fd20127
fd20127
%{?with_systemd:BuildRequires: systemd}
5326813
5326813
%if %{with python3}
c564796
BuildRequires:  python3-devel
c564796
BuildRequires:  python3-setuptools
5326813
%else
c564796
BuildRequires:  python-devel
c564796
BuildRequires:  python-setuptools
5326813
%endif
5326813
fd20127
%if %{with tests}
5326813
%if %{with python3}
c564796
BuildRequires:  python3-nose
c564796
BuildRequires:  python3-crypto
c564796
BuildRequires:  python3-netifaces
c564796
BuildRequires:  python3-pyxs
c564796
BuildRequires:  python3-yaml
3d1e3d3
BuildRequires:  python3-distro
fd20127
%else
c564796
BuildRequires:  python-nose
c564796
BuildRequires:  python-crypto
c564796
BuildRequires:  python-netifaces
c564796
BuildRequires:  python-pyxs
c564796
BuildRequires:  python-mock
c564796
BuildRequires:  python-yaml
3d1e3d3
BuildRequires:  python-distro
5326813
%if 0%{?python2_version_nodots} < 27
c564796
BuildRequires:  python-unittest2
c564796
BuildRequires:  python-argparse
5326813
%endif
fd20127
%endif
fd20127
%endif
fd20127
5326813
%if %{with python3}
7e48cb6
Requires:       python3-setuptools
c564796
Requires:       python3-crypto
c564796
Requires:       python3-netifaces
c564796
Requires:       python3-pyxs
c564796
Requires:       python3-yaml
3d1e3d3
Requires:       python3-distro
fd20127
%else
7e48cb6
Requires:       python-setuptools
c564796
Requires:       python-crypto
c564796
Requires:       python-netifaces
c564796
Requires:       python-pyxs
c564796
Requires:       python-yaml
3d1e3d3
Requires:       python-distro
5326813
%if 0%{?python2_version_nodots} < 27
c564796
Requires:       python-argparse
5326813
%endif
fd20127
%endif
5326813
fd20127
%if %{with systemd}
cdc3424
%{?systemd_requires}
fd20127
%else
fd20127
Requires(post): chkconfig
fd20127
Requires(preun): chkconfig
fd20127
Requires(preun): initscripts
fd20127
Requires(postun): initscripts
fd20127
%endif
fd20127
fd20127
fd20127
%description
fd20127
Python agent for setting up clean servers on Xen using xenstore data.
fd20127
fd20127
fd20127
%prep
5326813
%autosetup
fd20127
fd20127
fd20127
%build
5326813
%if %{with python3}
fd20127
%py3_build
fd20127
%else
fd20127
%py2_build
fd20127
%endif
fd20127
fd20127
fd20127
%install
5326813
%if %{with python3}
fd20127
%py3_install
fd20127
%else
fd20127
%py2_install
fd20127
%endif
fd20127
fd20127
%if %{with systemd}
fd20127
install -Dm644 etc/nova-agent.service %{buildroot}/%{_unitdir}/nova-agent.service
fd20127
%else
fd20127
install -Dm755 etc/nova-agent.redhat %{buildroot}/%{_initddir}/nova-agent
fd20127
%endif
fd20127
fd20127
fd20127
%if %{with tests}
fd20127
%check
5326813
%if %{with python3}
fd20127
nosetests-%{python3_version} -v
fd20127
%else
fd20127
nosetests -v
fd20127
%endif
fd20127
%endif
fd20127
fd20127
fd20127
%post
fd20127
%if %{with systemd}
fd20127
%systemd_post nova-agent.service
fd20127
%else
fd20127
chkconfig --add nova-agent &> /dev/null || :
fd20127
%endif
fd20127
fd20127
fd20127
%preun
fd20127
%if %{with systemd}
fd20127
%systemd_preun nova-agent.service
fd20127
%else
fd20127
if [ $1 -eq 0 ]; then
fd20127
    service nova-agent stop &> /dev/null || :
fd20127
    chkconfig --del nova-agent &> /dev/null || :
fd20127
fi
fd20127
%endif
fd20127
fd20127
fd20127
%postun
fd20127
%if %{with systemd}
fd20127
%systemd_postun_with_restart nova-agent.service
fd20127
%else
fd20127
if [ $1 -ge 1 ]; then
fd20127
    service nova-agent condrestart &> /dev/null || :
fd20127
fi
fd20127
%endif
fd20127
fd20127
fd20127
%files
fd20127
%license LICENSE
3d1e3d3
%doc README.md
5326813
%if %{with python3}
5647f20
%{python3_sitelib}/novaagent
5647f20
%{python3_sitelib}/novaagent-%{version}-py%{python3_version}.egg-info
fd20127
%else
5647f20
%{python2_sitelib}/novaagent
5647f20
%{python2_sitelib}/novaagent-%{version}-py%{python2_version}.egg-info
fd20127
%endif
fd20127
%{_bindir}/nova-agent
fd20127
%if %{with systemd}
fd20127
%{_unitdir}/nova-agent.service
fd20127
%else
fd20127
%{_initddir}/nova-agent
fd20127
%endif
fd20127
fd20127
fd20127
%changelog
67fe126
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.1.20-5
67fe126
- Rebuilt for Python 3.8.0rc1 (#1748018)
67fe126
57ac4d2
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.1.20-4
57ac4d2
- Rebuilt for Python 3.8
57ac4d2
f2d6b64
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.20-3
f2d6b64
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
f2d6b64
aeafe0d
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.20-2
aeafe0d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
aeafe0d
3d1e3d3
* Mon Dec 17 2018 Carl George <carl@george.computer> - 2.1.20-1
3d1e3d3
- Latest upstream
7e48cb6
- Requires setuptools because the entrypoint script imports pkg_resources
d94b0fa
- Use python3 on RHEL 8+
3d1e3d3
Dave Kludt 4544814
* Thu Sep 13 2018 Dave Kludt <david.kludt@rackspace.com> - 2.1.18-1
Dave Kludt 4544814
- Latest Upstream
Dave Kludt 4544814
Dave Kludt c2a1575
* Wed Sep 05 2018 Dave Kludt <david.kludt@rackspace.com> - 2.1.17-1
Dave Kludt c2a1575
- Latest Upstream
Dave Kludt c2a1575
Dave Kludt e681fd5
* Fri Aug 31 2018 Dave Kludt <david.kludt@rackspace.com> - 2.1.16-1
Dave Kludt e681fd5
- Latest Upstream
Dave Kludt e681fd5
d6a2f5f
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.14-3
d6a2f5f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
d6a2f5f
cbf1076
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 2.1.14-2
cbf1076
- Rebuilt for Python 3.7
cbf1076
Dave Kludt f834333
* Mon Jun 25 2018 Dave Kludt <david.kludt@rackspace.com> - 2.1.14-1
Dave Kludt f834333
- Latest upstream
Dave Kludt f834333
a373f54
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.1.12-2
a373f54
- Rebuilt for Python 3.7
a373f54
5647f20
* Wed Feb 21 2018 Carl George <carl@george.computer> - 2.1.12-1
5647f20
- Latest upstream
5647f20
b77f165
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.11-2
b77f165
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
b77f165
75a6968
* Fri Jan 05 2018 Carl George <carl@george.computer> - 2.1.11-1
75a6968
- Latest upstream
75a6968
c568334
* Tue Dec 19 2017 Carl George <carl@george.computer> - 2.1.10-1
c568334
- Latest upstream
c568334
5326813
* Sat Oct 21 2017 Carl George <carl@george.computer> - 2.1.8-1
5326813
- Latest upstream
5326813
fd20127
* Tue Sep 05 2017 Carl George <carl@george.computer> - 2.1.6-1
fd20127
- Latest upstream
fd20127
- Add patch for pull request #22
fd20127
fd20127
* Thu Aug 31 2017 Carl George <carl@george.computer> - 2.1.5-1
fd20127
- Latest upstream
fd20127
fd20127
* Thu Aug 10 2017 Carl George <carl@george.computer> - 2.1.1-1
fd20127
- Latest upstream
fd20127
fd20127
* Wed Aug 09 2017 Carl George <carl@george.computer> - 2.1.0-1
fd20127
- Latest upstream
fd20127
fd20127
* Wed Aug 02 2017 Carl George <carl@george.computer> - 2.0.3-1
fd20127
- Latest upstream
fd20127
- Run test suite
fd20127
fd20127
* Mon Jun 26 2017 Dave Kludt <david.kludt@rackspace.com> 2.0.0-1
fd20127
- Refactor code and bump to higher version so upgrade can be done
fd20127
fd20127
* Mon Feb 15 2016 Daniel Wallace <danielwallace@gtmanfred.com> 0.2.1-1
fd20127
- Always write a string to xenstore on returns
fd20127
fd20127
* Mon Feb 01 2016 Carl George <carl.george@rackspace.com> - 0.2.0-1
fd20127
- Disable debug packages
fd20127
- Build with Python 3 on Fedora and openSUSE
fd20127
- openSUSE macros fixes
fd20127
fd20127
* Fri Jan 29 2016 Carl George <carl.george@rackspace.com> - 0.1.0-1
fd20127
- Initial build of package