fca88d7
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
fca88d7
fa55fd1
%global pypi_name oslo.i18n
fca88d7
%global pkg_name oslo-i18n
730f308
1dee508
1dee508
%global with_doc 1
1dee508
f52eeac
%global common_desc \
f52eeac
The oslo.i18n library contain utilities for working with internationalization \
f52eeac
(i18n) features, especially translation for text strings in an application \
f52eeac
or library.
f52eeac
730f308
Name:           python-oslo-i18n
1dee508
Version:        3.23.1
4270a4e
Release:        4%{?dist}
2a45254
Summary:        OpenStack i18n library
730f308
License:        ASL 2.0
fa55fd1
URL:            https://github.com/openstack/%{pypi_name}
a0d1151
Source0:        https://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{upstream_version}.tar.gz
730f308
2a45254
BuildArch:      noarch
2a45254
fca88d7
BuildRequires:  git
fca88d7
2a45254
%description
f52eeac
%{common_desc}
2a45254
95653d4
%package -n python3-oslo-i18n
95653d4
Summary:        OpenStack i18n Python 3 library
2a45254
%{?python_provide:%python_provide python3-oslo-i18n}
95653d4
BuildRequires:  python3-devel
95653d4
BuildRequires:  python3-setuptools
95653d4
BuildRequires:  python3-pbr
b8d2ae6
BuildRequires:  python3-babel
95653d4
BuildRequires:  python3-six
b8d2ae6
BuildRequires:  python3-fixtures
b8d2ae6
b8d2ae6
Requires:       python3-babel
95653d4
Requires:       python3-six
a87b2e6
Requires:       python-%{pkg_name}-lang = %{version}-%{release}
95653d4
95653d4
%description -n python3-oslo-i18n
f52eeac
%{common_desc}
95653d4
1dee508
%if 0%{?with_doc}
fca88d7
%package -n python-oslo-i18n-doc
87d35e8
Summary:        Documentation for OpenStack i18n library
fca88d7
1dee508
Provides:  python2-oslo-i18n-doc = %{version}-%{release}
fca88d7
Provides:  python3-oslo-i18n-doc = %{version}-%{release}
1dee508
Obsoletes: python2-oslo-i18n-doc <= 3.9.0-1
fca88d7
Obsoletes: python3-oslo-i18n-doc <= 3.9.0-1
14712ac
81e81d5
BuildRequires:  python3-sphinx
81e81d5
BuildRequires:  python3-openstackdocstheme
87d35e8
fca88d7
%description -n python-oslo-i18n-doc
730f308
Documentation for the oslo.i18n library.
1dee508
%endif
730f308
fca88d7
%package  -n python-%{pkg_name}-lang
fca88d7
Summary:   Translation files for Oslo i18n library
14712ac
fca88d7
%description -n python-%{pkg_name}-lang
fca88d7
Translation files for Oslo i18n library
730f308
730f308
%prep
fca88d7
%autosetup -n %{pypi_name}-%{upstream_version} -S git
fa55fd1
rm -rf *.egg-info
fa55fd1
fa55fd1
# Let RPM handle the dependencies
f52eeac
rm -rf *requirements.txt
fa55fd1
730f308
%build
fca88d7
%py3_build
f52eeac
fca88d7
# Generate i18n files
81e81d5
%{__python3} setup.py compile_catalog -d build/lib/oslo_i18n/locale
730f308
730f308
%install
f52eeac
%py3_install
f52eeac
1dee508
%if 0%{?with_doc}
81e81d5
%{__python3} setup.py build_sphinx --build-dir . -b html
1dee508
# remove the sphinx-build-3 leftovers
fca88d7
rm -rf html/.{doctrees,buildinfo}
730f308
fa55fd1
# Fix this rpmlint warning
fca88d7
sed -i "s|\r||g" html/_static/jquery.js
1dee508
%endif
730f308
fca88d7
# Install i18n .mo files (.po and .pot are not required)
fca88d7
install -d -m 755 %{buildroot}%{_datadir}
81e81d5
rm -f %{buildroot}%{python3_sitelib}/oslo_i18n/locale/*/LC_*/oslo_i18n*po
81e81d5
rm -f %{buildroot}%{python3_sitelib}/oslo_i18n/locale/*pot
81e81d5
mv %{buildroot}%{python3_sitelib}/oslo_i18n/locale %{buildroot}%{_datadir}/locale
fca88d7
rm -rf %{buildroot}%{python3_sitelib}/oslo_i18n/locale
95653d4
fca88d7
# Find language files
fca88d7
%find_lang oslo_i18n --all-name
fca88d7
95653d4
%files -n python3-oslo-i18n
b8d2ae6
%doc ChangeLog CONTRIBUTING.rst PKG-INFO README.rst
95653d4
%license LICENSE
95653d4
%{python3_sitelib}/oslo_i18n
95653d4
%{python3_sitelib}/*.egg-info
95653d4
1dee508
%if 0%{?with_doc}
fca88d7
%files -n python-oslo-i18n-doc
b8d2ae6
%license LICENSE
fca88d7
%doc html
1dee508
%endif
730f308
fca88d7
%files -n python-%{pkg_name}-lang -f oslo_i18n.lang
b8d2ae6
%license LICENSE
fa55fd1
730f308
%changelog
4270a4e
* Mon Aug 19 2019 Miro HronĨok <mhroncok@redhat.com> - 3.23.1-4
4270a4e
- Rebuilt for Python 3.8
4270a4e
3bea43b
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.23.1-3
3bea43b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
3bea43b
1dee508
* Fri Mar 08 2019 RDO <dev@lists.rdoproject.org> 3.23.1-1
1dee508
- Update to 3.23.1
730f308