fa55fd1
%global pypi_name oslo.i18n
730f308
Alan Pevec cf8c10b
%if 0%{?fedora}
Alan Pevec cf8c10b
%global with_python3 1
Alan Pevec cf8c10b
%endif
Alan Pevec cf8c10b
25a3394
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
25a3394
730f308
Name:           python-oslo-i18n
25a3394
Version:        3.4.0
25a3394
Release:        1%{?dist}
2a45254
Summary:        OpenStack i18n library
730f308
License:        ASL 2.0
fa55fd1
URL:            https://github.com/openstack/%{pypi_name}
fa55fd1
Source0:        https://pypi.python.org/packages/source/o/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
730f308
2a45254
BuildArch:      noarch
2a45254
2a45254
%description
2a45254
The oslo.i18n library contain utilities for working with internationalization
2a45254
(i18n) features, especially translation for text strings in an application
2a45254
or library.
2a45254
2a45254
%package -n python2-oslo-i18n
2a45254
Summary:        OpenStack i18n Python 2 library
2a45254
%{?python_provide:%python_provide python2-oslo-i18n}
14712ac
# python_provide does not exist in CBS Cloud buildroot
14712ac
Provides:       python-oslo-i18n = %{version}-%{release}
14712ac
Obsoletes:      python-oslo-i18n < 2.5.0-2
14712ac
730f308
BuildRequires:  python2-devel
730f308
BuildRequires:  python-setuptools
730f308
BuildRequires:  python-pbr
837366a
BuildRequires:  python-babel
d524180
BuildRequires:  python-six
837366a
BuildRequires:  python-fixtures
837366a
730f308
Requires:       python-setuptools
837366a
Requires:       python-babel
d524180
Requires:       python-six
d524180
Requires:       python-fixtures
730f308
2a45254
%description -n python2-oslo-i18n
730f308
The oslo.i18n library contain utilities for working with internationalization
730f308
(i18n) features, especially translation for text strings in an application
730f308
or library.
730f308
Alan Pevec cf8c10b
%if 0%{?with_python3}
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
95653d4
Requires:       python3-setuptools
b8d2ae6
Requires:       python3-babel
95653d4
Requires:       python3-six
95653d4
Requires:       python3-fixtures
95653d4
95653d4
%description -n python3-oslo-i18n
95653d4
The oslo.i18n library contain utilities for working with internationalization
95653d4
(i18n) features, especially translation for text strings in an application
95653d4
or library.
Alan Pevec cf8c10b
%endif
95653d4
2a45254
%package -n python2-oslo-i18n-doc
87d35e8
Summary:        Documentation for OpenStack i18n library
14712ac
%{?python_provide:%python_provide python2-oslo-i18n-doc}
14712ac
# python_provide does not exist in CBS Cloud buildroot
14712ac
Provides:       python-oslo-i18n-doc = %{version}-%{release}
14712ac
Obsoletes:      python-oslo-i18n-doc < 2.5.0-2
14712ac
87d35e8
BuildRequires:  python-sphinx
87d35e8
BuildRequires:  python-oslo-sphinx
87d35e8
2a45254
%description -n python2-oslo-i18n-doc
730f308
Documentation for the oslo.i18n library.
730f308
fa55fd1
%if 0%{?with_python3}
b8d2ae6
%package -n python3-oslo-i18n-doc
87d35e8
Summary:        Documentation for OpenStack i18n library
14712ac
%{?python_provide:%python_provide python3-oslo-i18n-doc}
14712ac
fa55fd1
BuildRequires:  python3-sphinx
fa55fd1
BuildRequires:  python3-oslo-sphinx
fa55fd1
b8d2ae6
%description -n python3-oslo-i18n-doc
b8d2ae6
Documentation for the oslo.i18n library.
fa55fd1
%endif
730f308
730f308
%prep
fa55fd1
%setup -qc
25a3394
mv %{pypi_name}-%{upstream_version} python2
fa55fd1
fa55fd1
pushd python2
fa55fd1
rm -rf *.egg-info
fa55fd1
fa55fd1
# Let RPM handle the dependencies
fa55fd1
rm -f test-requirements.txt requirements.txt
fa55fd1
fa55fd1
cp -p LICENSE ChangeLog CONTRIBUTING.rst PKG-INFO README.rst ../
fa55fd1
popd
fa55fd1
2a45254
find python2 -name '*.py' | xargs sed -i 's|^#!python|#!%{__python2}|'
2a45254
Alan Pevec cf8c10b
%if 0%{?with_python3}
fa55fd1
cp -a python2 python3
b8d2ae6
find python3 -name '*.py' | xargs sed -i 's|^#!python|#!%{__python3}|'
Alan Pevec cf8c10b
%endif
730f308
730f308
%build
fa55fd1
pushd python2
730f308
%{__python2} setup.py build
fa55fd1
popd
Alan Pevec cf8c10b
%if 0%{?with_python3}
fa55fd1
pushd python3
95653d4
%{__python3} setup.py build
95653d4
popd
Alan Pevec cf8c10b
%endif
730f308
730f308
%install
2a45254
pushd python2
2a45254
%{__python2} setup.py install --skip-build --root %{buildroot}
fa55fd1
export PYTHONPATH="$( pwd ):$PYTHONPATH"
fa55fd1
pushd doc
2a45254
sphinx-build -b html -d build/doctrees   source build/html
fa55fd1
# Fix hidden-file-or-dir warnings
fa55fd1
rm -fr build/html/.buildinfo
730f308
fa55fd1
# Fix this rpmlint warning
fa55fd1
sed -i "s|\r||g" build/html/_static/jquery.js
fa55fd1
popd
fa55fd1
popd
730f308
2a45254
%if 0%{?with_python3}
2a45254
pushd python3
2a45254
%{__python3} setup.py install --skip-build --root %{buildroot}
730f308
export PYTHONPATH="$( pwd ):$PYTHONPATH"
730f308
pushd doc
2a45254
sphinx-build-3 -b html -d build/doctrees   source build/html
2a45254
730f308
# Fix hidden-file-or-dir warnings
fa55fd1
rm -fr build/html/.buildinfo
837366a
837366a
# Fix this rpmlint warning
fa55fd1
sed -i "s|\r||g" build/html/_static/jquery.js
fa55fd1
popd
95653d4
popd
2a45254
%endif
95653d4
2a45254
%files -n python2-oslo-i18n
b8d2ae6
%doc ChangeLog CONTRIBUTING.rst PKG-INFO README.rst
9f34f52
%license LICENSE
d524180
%{python2_sitelib}/oslo_i18n
730f308
%{python2_sitelib}/*.egg-info
730f308
Alan Pevec cf8c10b
%if 0%{?with_python3}
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
Alan Pevec cf8c10b
%endif
95653d4
2a45254
%files -n python2-oslo-i18n-doc
b8d2ae6
%license LICENSE
b8d2ae6
%doc python2/doc/build/html
730f308
fa55fd1
%if 0%{?with_python3}
b8d2ae6
%files -n python3-oslo-i18n-doc
b8d2ae6
%license LICENSE
fa55fd1
%doc python3/doc/build/html
fa55fd1
%endif
fa55fd1
730f308
%changelog
25a3394
* Tue Mar 22 2016 Haikel Guemar <hguemar@fedoraproject.org> 3.4.0-
25a3394
- Update to 3.4.0
730f308