%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%if 0%{?fedora} >= 24
%global with_python3 1
%endif
%global pypi_name oslo.cache
%global pkg_name oslo-cache
Name: python-oslo-cache
Version: 1.17.0
Release: 6%{?dist}
Summary: Cache storage for Openstack projects
License: ASL 2.0
URL: http://launchpad.net/oslo
Source0: https://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{upstream_version}.tar.gz
BuildArch: noarch
%package -n python2-%{pkg_name}
Summary: Cache storage for Openstack projects
%{?python_provide:%python_provide python2-%{pkg_name}}
BuildRequires: python2-devel
BuildRequires: python2-pbr
# Required for documentation build
BuildRequires: python2-sphinx
BuildRequires: python2-oslo-config
BuildRequires: python2-dogpile-cache >= 0.6.1
BuildRequires: python2-oslo-log
# Required for tests
BuildRequires: python2-hacking
BuildRequires: python2-mock
BuildRequires: python2-oslotest
BuildRequires: python2-memcached
BuildRequires: python2-pymongo
# Required to compile translation files
BuildRequires: python2-babel
Requires: python2-babel
Requires: python2-dogpile-cache >= 0.6.1
Requires: python2-six
Requires: python2-oslo-config
Requires: python2-oslo-i18n
Requires: python2-oslo-log
Requires: python2-oslo-utils
Requires: python2-memcached
Requires: python-%{pkg_name}-lang = %{version}-%{release}
%description -n python2-%{pkg_name}
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.
%package doc
Summary: Documentation for the OpenStack Oslo Cache library
BuildRequires: python2-sphinx
BuildRequires: python2-oslo-config
BuildRequires: python2-oslo-sphinx
BuildRequires: python2-fixtures
BuildRequires: dos2unix
%description doc
Documentation for the OpenStack Oslo cache library.
%package -n python2-%{pkg_name}-tests
Summary: Tests for the OpenStack Oslo Cache library
Requires: python2-%{pkg_name} = %{version}-%{release}
Requires: python2-hacking
Requires: python2-mock
Requires: python2-oslotest
Requires: python2-pymongo
%description -n python2-%{pkg_name}-tests
Tests for the OpenStack Oslo Cache library
%if 0%{?with_python3}
%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
Requires: python3-babel
Requires: python3-dogpile-cache
Requires: python3-six
Requires: python3-oslo-config
Requires: python3-oslo-i18n
Requires: python3-oslo-log
Requires: python3-oslo-utils
Requires: python3-memcached
Requires: python-%{pkg_name}-lang = %{version}-%{release}
%description -n python3-%{pkg_name}
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.
%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
%endif
%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
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.
%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
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
#doc
export PYTHONPATH="$( pwd ):$PYTHONPATH"
pushd doc
sphinx-build -b html -d build/doctrees source build/html
popd
# Fix hidden-file-or-dir warnings
rm -fr doc/build/html/.buildinfo
# Generate i18n files
%{__python2} setup.py compile_catalog -d build/lib/oslo_cache/locale
%install
%py2_install
%if 0%{?with_python3}
%py3_install
%endif
dos2unix doc/build/html/_static/jquery.js
# Install i18n .mo files (.po and .pot are not required)
install -d -m 755 %{buildroot}%{_datadir}
rm -f %{buildroot}%{python2_sitelib}/oslo_cache/locale/*/LC_*/oslo_cache*po
rm -f %{buildroot}%{python2_sitelib}/oslo_cache/locale/*pot
mv %{buildroot}%{python2_sitelib}/oslo_cache/locale %{buildroot}%{_datadir}/locale
%if 0%{?with_python3}
rm -rf %{buildroot}%{python3_sitelib}/oslo_cache/locale
%endif
# Find language files
%find_lang oslo_cache --all-name
%check
%{__python2} setup.py test
%if 0%{?with_python3}
rm -rf .testrepository
%{__python3} setup.py test
%endif
%files -n python2-%{pkg_name}
%license LICENSE
%doc AUTHORS CONTRIBUTING.rst README.rst PKG-INFO ChangeLog
%{python2_sitelib}/oslo_cache
%{python2_sitelib}/%{pypi_name}-%{upstream_version}-py?.?.egg-info
%exclude %{python2_sitelib}/oslo_cache/tests
%files doc
%doc doc/build/html
%license LICENSE
%files -n python2-%{pkg_name}-tests
%{python2_sitelib}/oslo_cache/tests
%files -n python-%{pkg_name}-lang -f oslo_cache.lang
%license LICENSE
%if 0%{?with_python3}
%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
%endif
%changelog
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.17.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 1.17.0-5
- Rebuilt for Python 3.7
* Tue Feb 27 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.17.0-4
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.17.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.17.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Wed Feb 08 2017 Alfredo Moralejo <amoralej@redhat.com> 1.17.0-1
- Update to 1.17.0