133e01c
# Macros for py2/py3 compatibility
133e01c
%if 0%{?fedora} || 0%{?rhel} > 7
133e01c
%global pyver %{python3_pkgversion}
5e8692b
%else
133e01c
%global pyver 2
502d2ad
%endif
133e01c
%global pyver_bin python%{pyver}
81fecce
%global pyver_sitelib %{expand:%{python%{pyver}_sitelib}}
81fecce
%global pyver_install %{expand:%{py%{pyver}_install}}
81fecce
%global pyver_build %{expand:%{py%{pyver}_build}}
133e01c
# End of macros for py2/py3 compatibility
502d2ad
133e01c
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
502d2ad
502d2ad
%global client python-tackerclient
502d2ad
%global sclient tackerclient
502d2ad
%global executable tacker
0e455e6
%global with_doc 1
502d2ad
502d2ad
Name:       %{client}
0e455e6
Version:    0.16.1
ed96880
Release:    3%{?dist}
842029a
Summary:    OpenStack Tacker client
502d2ad
License:    ASL 2.0
502d2ad
URL:        http://launchpad.net/%{client}/
502d2ad
502d2ad
Source0:    http://tarballs.openstack.org/%{client}/%{client}-%{upstream_version}.tar.gz
ed96880
Patch001:   0001-Replace-assertItemsEqual-with-assertCountEqual.patch
502d2ad
502d2ad
BuildArch:  noarch
502d2ad
842029a
BuildRequires:  git
842029a
133e01c
%package -n python%{pyver}-%{sclient}
502d2ad
Summary:    OpenStack tacker client
133e01c
%{?python_provide:%python_provide python%{pyver}-%{sclient}}
133e01c
%if %{pyver} == 3
133e01c
Obsoletes: python2-%{sclient} < %{version}-%{release}
133e01c
%endif
133e01c
133e01c
BuildRequires:  python%{pyver}-devel
133e01c
BuildRequires:  python%{pyver}-mock
133e01c
BuildRequires:  python%{pyver}-fixtures
133e01c
BuildRequires:  python%{pyver}-flake8
133e01c
BuildRequires:  python%{pyver}-hacking
133e01c
BuildRequires:  python%{pyver}-keystoneclient
133e01c
BuildRequires:  python%{pyver}-oslo-log
133e01c
BuildRequires:  python%{pyver}-oslo-serialization
133e01c
BuildRequires:  python%{pyver}-pbr
133e01c
BuildRequires:  python%{pyver}-reno
0e455e6
BuildRequires:  python%{pyver}-requests-mock
133e01c
BuildRequires:  python%{pyver}-setuptools
133e01c
BuildRequires:  python%{pyver}-stestr
133e01c
BuildRequires:  python%{pyver}-subunit
133e01c
BuildRequires:  python%{pyver}-testtools
133e01c
BuildRequires:  python%{pyver}-cliff
133e01c
133e01c
Requires:   python%{pyver}-pbr >= 2.0.0
133e01c
Requires:   python%{pyver}-babel >= 2.3.4
133e01c
Requires:   python%{pyver}-cliff >= 2.8.0
133e01c
Requires:   python%{pyver}-iso8601 >= 0.1.11
133e01c
Requires:   python%{pyver}-keystoneclient >= 1:3.8.0
133e01c
Requires:   python%{pyver}-oslo-i18n >= 3.15.3
133e01c
Requires:   python%{pyver}-oslo-log >= 3.36.0
133e01c
Requires:   python%{pyver}-oslo-serialization >= 2.18.0
133e01c
Requires:   python%{pyver}-oslo-utils >= 3.33.0
133e01c
Requires:   python%{pyver}-requests >= 2.14.2
133e01c
Requires:   python%{pyver}-six >= 1.10.0
133e01c
Requires:   python%{pyver}-stevedore >= 1.20.0
133e01c
Requires:   python%{pyver}-osc-lib >= 1.8.0
133e01c
Requires:   python%{pyver}-netaddr >= 0.7.18
133e01c
# Handle python2 exception
133e01c
%if %{pyver} == 2
842029a
Requires:   python-simplejson >= 3.5.1
133e01c
%else
133e01c
Requires:   python%{pyver}-simplejson >= 3.5.1
842029a
%endif
502d2ad
133e01c
%description -n python%{pyver}-%{sclient}
502d2ad
OpenStack tacker client
502d2ad
502d2ad
133e01c
%package -n python%{pyver}-%{sclient}-tests-unit
502d2ad
Summary:    OpenStack taker client unit tests
133e01c
Requires:   python%{pyver}-%{sclient} = %{version}-%{release}
133e01c
133e01c
Requires:  python%{pyver}-fixtures
133e01c
Requires:  python%{pyver}-flake8
133e01c
Requires:  python%{pyver}-hacking
133e01c
Requires:  python%{pyver}-oslo-log
133e01c
Requires:  python%{pyver}-oslo-serialization
133e01c
Requires:  python%{pyver}-pbr
133e01c
Requires:  python%{pyver}-setuptools
133e01c
Requires:  python%{pyver}-subunit
133e01c
Requires:  python%{pyver}-testtools
133e01c
Requires:  python%{pyver}-mock
133e01c
Requires:  python%{pyver}-stestr
133e01c
133e01c
%description -n python%{pyver}-%{sclient}-tests-unit
502d2ad
OpenStack tacker client unit tests
502d2ad
502d2ad
This package contains the tacker client test files.
502d2ad
502d2ad
0e455e6
%if 0%{?with_doc}
502d2ad
%package -n python-%{sclient}-doc
502d2ad
Summary:    OpenStack tacker client documentation
502d2ad
133e01c
BuildRequires: python%{pyver}-sphinx
0e455e6
BuildRequires: python%{pyver}-osc-lib
0e455e6
BuildRequires: python%{pyver}-ddt
133e01c
BuildRequires: python%{pyver}-openstackdocstheme
502d2ad
502d2ad
%description -n python-%{sclient}-doc
502d2ad
OpenStack tacker client documentation
502d2ad
502d2ad
This package contains the documentation for tacker client.
0e455e6
%endif
502d2ad
133e01c
%description
133e01c
OpenStack tacker client.
502d2ad
502d2ad
%prep
502d2ad
%autosetup -n %{client}-%{upstream_version} -S git
502d2ad
0e455e6
# Fix rpmlint warning for CRLF line termination
0e455e6
sed -i 's/\r$//' ./doc/source/cli/vnf_package_commands.rst ./doc/source/cli/commands.rst
0e455e6
502d2ad
# Let's handle dependencies ourseleves
502d2ad
rm -f *requirements.txt
502d2ad
502d2ad
%build
133e01c
%{pyver_build}
502d2ad
0e455e6
%if 0%{?with_doc}
502d2ad
# generate html docs
0e455e6
export PYTHONPATH=.
133e01c
sphinx-build-%{pyver} -W -b html doc/source doc/build/html
133e01c
# remove the sphinx-build-%{pyver} leftovers
842029a
rm -rf doc/build/html/.{doctrees,buildinfo}
502d2ad
133e01c
sphinx-build-%{pyver} -W -b man doc/source doc/build/man
0e455e6
%endif
133e01c
502d2ad
%install
502d2ad
133e01c
%{pyver_install}
0e455e6
0e455e6
%if 0%{?with_doc}
133e01c
install -p -D -m 644 -v doc/build/man/tacker.1 %{buildroot}%{_mandir}/man1/tacker.1
0e455e6
%endif
502d2ad
133e01c
# Create a versioned binary for backwards compatibility until everything is pure py3
133e01c
ln -s %{executable} %{buildroot}%{_bindir}/%{executable}-%{pyver}
502d2ad
502d2ad
%check
133e01c
export OS_TEST_PATH='./tackerclient/tests/unit'
0e455e6
PYTHON=%{pyver_bin} stestr-%{pyver} --test-path $OS_TEST_PATH run
502d2ad
133e01c
%files -n python%{pyver}-%{sclient}
502d2ad
%license LICENSE
133e01c
%{pyver_sitelib}/%{sclient}
133e01c
%{pyver_sitelib}/*.egg-info
133e01c
%exclude %{pyver_sitelib}/%{sclient}/tests
133e01c
%{_bindir}/%{executable}-%{pyver}
502d2ad
%{_bindir}/%{executable}
0e455e6
0e455e6
%if 0%{?with_doc}
502d2ad
%{_mandir}/man1/*
0e455e6
%endif
502d2ad
133e01c
%files -n python%{pyver}-%{sclient}-tests-unit
502d2ad
%license LICENSE
133e01c
%{pyver_sitelib}/%{sclient}/tests
502d2ad
0e455e6
%if 0%{?with_doc}
502d2ad
%files -n python-%{sclient}-doc
502d2ad
%license LICENSE
842029a
%doc doc/build/html README.rst
0e455e6
%endif
502d2ad
502d2ad
%changelog
ed96880
* Fri Mar 13 2020 Alfredo Moralejo <amoralej@redhat.com> - 0.16.1-3
ed96880
- Replace assertItemsEqual with assertCountEqual
ed96880
c566aa7
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.1-2
c566aa7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
c566aa7
0e455e6
* Wed Nov 06 2019 Alfredo Moralejo <amoralej@redhat.com> 0.16.1-1
0e455e6
- Update to upstream version 0.16.1
0e455e6
0468b47
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.15.0-4
0468b47
- Rebuilt for Python 3.8.0rc1 (#1748018)
0468b47
b09bf19
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.15.0-3
b09bf19
- Rebuilt for Python 3.8
b09bf19
d5ba0e8
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-2
d5ba0e8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
d5ba0e8
133e01c
* Mon Mar 11 2019 RDO <dev@lists.rdoproject.org> 0.15.0-1
133e01c
- Update to 0.15.0
731ff89
502d2ad