%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
# NOTE(ykarel) disable doc as doc depends on etcd3gw which is
# not packaged.
%global with_doc 0
%global pypi_name oslo.cache
%global pkg_name oslo-cache
%global common_desc \
oslo.cache aims to provide a generic caching mechanism for OpenStack projects \
by wrapping the dogpile.cache library. The dogpile.cache library provides \
support memoization, key value storage and interfaces to common caching \
backends such as Memcached.
Name: python-oslo-cache
Version: 1.28.0
Release: 3%{?dist}
Summary: Cache storage for Openstack projects
License: ASL 2.0
URL: http://launchpad.net/%{pypi_name}
Source0: https://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{upstream_version}.tar.gz
BuildArch: noarch
BuildRequires: git
%if 0%{?with_doc}
%package doc
Summary: Documentation for the OpenStack Oslo Cache library
BuildRequires: python3-sphinx
BuildRequires: python3-oslo-config
BuildRequires: python3-openstackdocstheme
BuildRequires: python3-oslo-sphinx
BuildRequires: python3-fixtures
BuildRequires: dos2unix
%description doc
Documentation for the OpenStack Oslo cache library.
%endif
%package -n python3-%{pkg_name}
Summary: Cache storage for Openstack projects
%{?python_provide:%python_provide python3-%{pkg_name}}
BuildRequires: python3-devel
BuildRequires: python3-pbr
# Required for tests
BuildRequires: python3-hacking
BuildRequires: python3-mock
BuildRequires: python3-oslotest
BuildRequires: python3-memcached
BuildRequires: python3-pymongo
BuildRequires: python3-dogpile-cache >= 0.6.2
BuildRequires: python3-oslo-log >= 3.36.0
BuildRequires: python3-urllib3
Requires: python3-dogpile-cache >= 0.6.2
Requires: python3-six
Requires: python3-oslo-config >= 2:5.1.0
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-log >= 3.36.0
Requires: python3-oslo-utils >= 3.33.0
Requires: python3-memcached
Requires: python-%{pkg_name}-lang = %{version}-%{release}
%description -n python3-%{pkg_name}
%{common_desc}
%package -n python3-%{pkg_name}-tests
Summary: Tests for the OpenStack Oslo Cache library
Requires: python3-%{pkg_name} = %{version}-%{release}
Requires: python3-hacking
Requires: python3-mock
Requires: python3-oslotest
Requires: python3-pymongo
%description -n python3-%{pkg_name}-tests
Tests for the OpenStack Oslo Cache library
%package -n python-%{pkg_name}-lang
Summary: Translation files for Oslo cache library
%description -n python-%{pkg_name}-lang
Translation files for Oslo cache library
%description
%{common_desc}
%prep
%autosetup -n %{pypi_name}-%{upstream_version} -S git
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
# Let RPM handle the dependencies
sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
rm -f {test-,}requirements.txt
%build
%py3_build
%if 0%{?with_doc}
#doc
%{__python3} setup.py build_sphinx -b html
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.buildinfo
%endif
# Generate i18n files
%{__python3} setup.py compile_catalog -d build/lib/oslo_cache/locale
%install
%py3_install
%if 0%{?with_doc}
dos2unix doc/build/html/_static/jquery.js
%endif
# Install i18n .mo files (.po and .pot are not required)
install -d -m 755 %{buildroot}%{_datadir}
rm -f %{buildroot}%{python3_sitelib}/oslo_cache/locale/*/LC_*/oslo_cache*po
rm -f %{buildroot}%{python3_sitelib}/oslo_cache/locale/*pot
mv %{buildroot}%{python3_sitelib}/oslo_cache/locale %{buildroot}%{_datadir}/locale
# Find language files
%find_lang oslo_cache --all-name
%check
rm -rf .testrepository
PYTHON=%{__python3} %{__python3} setup.py test
%if 0%{?with_doc}
%files doc
%doc doc/build/html
%license LICENSE
%endif
%files -n python-%{pkg_name}-lang -f oslo_cache.lang
%license LICENSE
%files -n python3-%{pkg_name}
%license LICENSE
%doc AUTHORS CONTRIBUTING.rst README.rst PKG-INFO ChangeLog
%{python3_sitelib}/oslo_cache
%{python3_sitelib}/%{pypi_name}-%{upstream_version}-py?.?.egg-info
%exclude %{python3_sitelib}/oslo_cache/tests
%files -n python3-%{pkg_name}-tests
%{python3_sitelib}/oslo_cache/tests
%changelog
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.28.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Nov 19 2018 Miro HronĨok <mhroncok@redhat.com> - 1.28.0-2
- Subpackages python2-oslo-cache, python2-oslo-cache-tests have been removed
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
* Sat Feb 10 2018 RDO <dev@lists.rdoproject.org> 1.28.0-1
- Update to 1.28.0