%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global pypi_name oslo.db
%global pkg_name oslo-db
Name: python-%{pkg_name}
Version: 4.33.1
Release: 8%{?dist}
Summary: OpenStack oslo.db library
License: ASL 2.0
URL: http://launchpad.net/oslo
Source0: https://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{upstream_version}.tar.gz
# FIXME(hguemar): backport of upstream compatibility patch with python 3.7
# https://bugs.launchpad.net/oslo.db/+bug/1775866
Patch001: https://github.com/openstack/oslo.db/commit/df6bf3401266f42271627c1e408f87c71a06cef7.patch
BuildArch: noarch
%description
The OpenStack Oslo database handling library. Provides database connectivity
to the different backends and helper utils.
%package -n python-%{pkg_name}-doc
Summary: Documentation for the Oslo database handling library
BuildRequires: python3-sphinx
BuildRequires: python3-openstackdocstheme
%description -n python-%{pkg_name}-doc
Documentation for the Oslo database handling library.
%package -n python3-%{pkg_name}
Summary: OpenStack oslo.db library
%{?python_provide:%python_provide python3-%{pkg_name}}
BuildRequires: python3-devel
BuildRequires: python3-pbr
# test requirements
BuildRequires: python3-oslo-utils
BuildRequires: python3-oslo-config
BuildRequires: python3-six
BuildRequires: python3-alembic
BuildRequires: python3-fixtures
BuildRequires: python3-migrate
BuildRequires: python3-testresources
BuildRequires: python3-testscenarios
BuildRequires: python3-oslotest
BuildRequires: python3-oslo-context
BuildRequires: python3-psycopg2
Requires: MySQL-python3
Requires: python3-PyMySQL
Requires: python3-oslo-config >= 2:5.1.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-alembic >= 0.8.7
Requires: python3-migrate >= 0.11.0
Requires: python3-six >= 1.10.0
Requires: python3-sqlalchemy >= 1.0.10
Requires: python3-stevedore >= 1.20.0
Requires: python3-pbr
Requires: python3-debtcollector >= 1.2.0
Requires: python-%{pkg_name}-lang = %{version}-%{release}
%description -n python3-%{pkg_name}
The OpenStack Oslo database handling library. Provides database connectivity
to the different backends and helper utils.
%package -n python3-%{pkg_name}-tests
Summary: test subpackage for the Oslo database handling library
Requires: python3-%{pkg_name} = %{version}-%{release}
Requires: python3-oslo-utils
Requires: python3-oslo-config
Requires: python3-six
Requires: python3-alembic
Requires: python3-fixtures
Requires: python3-migrate
Requires: python3-testresources
Requires: python3-testscenarios
Requires: python3-oslotest
Requires: python3-psycopg2
%description -n python3-%{pkg_name}-tests
Test subpackage for the Oslo database handling library.
%package -n python-%{pkg_name}-lang
Summary: Translation files for Oslo db library
%description -n python-%{pkg_name}-lang
Translation files for Oslo db library
%prep
%autosetup -n %{pypi_name}-%{upstream_version} -S git
# Let RPM handle the dependencies
rm -f requirements.txt
%build
%py3_build
# generate html docs
sphinx-build-3 doc/source html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}
# Generate i18n files
%{__python3} setup.py compile_catalog -d build/lib/oslo_db/locale
%install
%py3_install
# Install i18n .mo files (.po and .pot are not required)
install -d -m 755 %{buildroot}%{_datadir}
rm -f %{buildroot}%{python3_sitelib}/oslo_db/locale/*/LC_*/oslo_db*po
rm -f %{buildroot}%{python3_sitelib}/oslo_db/locale/*pot
mv %{buildroot}%{python3_sitelib}/oslo_db/locale %{buildroot}%{_datadir}/locale
# Find language files
%find_lang oslo_db --all-name
%check
PYTHON=%{__python3} %{__python3} setup.py test
%files -n python-%{pkg_name}-doc
%doc html
%license LICENSE
%files -n python-%{pkg_name}-lang -f oslo_db.lang
%license LICENSE
%files -n python3-%{pkg_name}
%doc README.rst
%license LICENSE
%{python3_sitelib}/oslo_db
%{python3_sitelib}/*.egg-info
%exclude %{python3_sitelib}/oslo_db/tests
%files -n python3-%{pkg_name}-tests
%{python3_sitelib}/oslo_db/tests
%changelog
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.33.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Nov 23 2018 Miro Hrončok <mhroncok@redhat.com> - 4.33.1-7
- Subpackages python2-oslo-db, python2-oslo-db-tests have been removed
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
* Sat Aug 18 2018 Haïkel Guémar <hguemar@fedoraproject.org> - 4.33.1-6
- Re-add python3 tests subpackages (RHBZ#1166404)
- Add python 3.7 compat patch (RHBZ#1605811)
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.33.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 4.33.1-4
- Rebuilt for Python 3.7
* Mon Jun 04 2018 Iryna Shcherbina <shcherbina.iryna@gmail.com> - 4.33.1-3
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Mon May 28 2018 Javier Peña <jpena@redhat.com> - 4.33.1-2
- Use autosetup -S git
* Mon May 28 2018 Javier Peña <jpena@redhat.com> - 4.33.1-1
- Update to upstream 4.33.1 (bz#1556226)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.17.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.17.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Wed Feb 08 2017 Alfredo Moralejo <amoralej@redhat.com> 4.17.0-1
- Update to 4.17.0