1e675e1
%if 0%{?fedora} >= 24
1e675e1
%global with_python3 1
1e675e1
%endif
1e675e1
1e675e1
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
1e675e1
214fb1d
%global pypi_name oslo.log
1e675e1
%global pkg_name oslo-log
214fb1d
214fb1d
Name:           python-oslo-log
feccee0
Version:        3.30.0
feccee0
Release:        1%{?dist}
214fb1d
Summary:        OpenStack Oslo Log library
214fb1d
214fb1d
License:        ASL 2.0
214fb1d
URL:            http://launchpad.net/oslo
a78f962
Source0:        https://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{upstream_version}.tar.gz
214fb1d
BuildArch:      noarch
214fb1d
1e675e1
%package -n python2-%{pkg_name}
1e675e1
Summary:        OpenStack Oslo Log library
1e675e1
%{?python_provide:%python_provide python2-%{pkg_name}}
1e675e1
214fb1d
BuildRequires:  python2-devel
214fb1d
BuildRequires:  python-pbr
feccee0
BuildRequires:  git
1e675e1
# Required for tests
1e675e1
BuildRequires:  python-dateutil
1e675e1
BuildRequires:  python-mock
1e675e1
BuildRequires:  python-oslotest
1e675e1
BuildRequires:  python-oslo-config
1e675e1
BuildRequires:  python-oslo-serialization
1e675e1
BuildRequires:  python-subunit
1e675e1
BuildRequires:  python-testrepository
1e675e1
BuildRequires:  python-testscenarios
1e675e1
BuildRequires:  python-testtools
1e675e1
BuildRequires:  python-inotify
124d7f8
# Required to compile translation files
124d7f8
BuildRequires:  python-babel
214fb1d
214fb1d
Requires:       python-babel
1e675e1
Requires:       python-dateutil
a78f962
Requires:       python-monotonic
214fb1d
Requires:       python-six >= 1.9.0
feccee0
Requires:       python-oslo-config >= 2:4.0.0
feccee0
Requires:       python-oslo-context >= 2.14.0
a78f962
Requires:       python-oslo-i18n >= 2.1.0
feccee0
Requires:       python-oslo-utils >= 3.20.0
a78f962
Requires:       python-oslo-serialization >= 1.10.0
feccee0
Requires:       python-debtcollector >= 1.2.0
1e675e1
Requires:       python-inotify
124d7f8
Requires:       python-%{pkg_name}-lang = %{version}-%{release}
214fb1d
1e675e1
%description -n python2-%{pkg_name}
214fb1d
OpenStack logging configuration library provides standardized configuration
214fb1d
for all openstack projects. It also provides custom formatters, handlers and
214fb1d
support for context specific logging (like resource id’s etc).
214fb1d
1e675e1
%package -n python-%{pkg_name}-doc
214fb1d
Summary:    Documentation for the Oslo Log handling library
214fb1d
214fb1d
BuildRequires:  python-sphinx
feccee0
BuildRequires:  python-openstackdocstheme
214fb1d
BuildRequires:  python-oslo-config
214fb1d
BuildRequires:  python-oslo-utils
214fb1d
BuildRequires:  python-oslo-context
214fb1d
1e675e1
%description -n python-%{pkg_name}-doc
214fb1d
Documentation for the Oslo Log handling library.
214fb1d
1e675e1
%package -n python2-%{pkg_name}-tests
1e675e1
Summary:    Tests for the Oslo Log handling library
1e675e1
1e675e1
Requires:       python-%{pkg_name} = %{version}-%{release}
1e675e1
Requires:       python-mock
1e675e1
Requires:       python-oslotest
feccee0
Requires:       python-oslo-config >= 2:4.0.0
1e675e1
Requires:       python-subunit
1e675e1
Requires:       python-testrepository
1e675e1
Requires:       python-testscenarios
1e675e1
Requires:       python-testtools
1e675e1
1e675e1
%description -n python2-%{pkg_name}-tests
1e675e1
Tests for the Oslo Log handling library.
1e675e1
1e675e1
%if 0%{?with_python3}
2a41025
%package -n python3-%{pkg_name}-tests
2a41025
Summary:    Tests for the Oslo Log handling library
2a41025
2a41025
Requires:       python3-%{pkg_name} = %{version}-%{release}
2a41025
Requires:       python3-mock
2a41025
Requires:       python3-oslotest
feccee0
Requires:       python3-oslo-config >= 2:4.0.0
2a41025
Requires:       python3-subunit
2a41025
Requires:       python3-testrepository
2a41025
Requires:       python3-testscenarios
2a41025
Requires:       python3-testtools
2a41025
2a41025
%description -n python3-%{pkg_name}-tests
2a41025
Tests for the Oslo Log handling library.
2a41025
%endif
2a41025
2a41025
%if 0%{?with_python3}
1e675e1
%package -n python3-%{pkg_name}
1e675e1
Summary:        OpenStack Oslo Log library
1e675e1
%{?python_provide:%python_provide python3-%{pkg_name}}
1e675e1
1e675e1
BuildRequires:  python3-devel
1e675e1
BuildRequires:  python3-pbr
1e675e1
# Required for tests
1e675e1
BuildRequires:  python3-dateutil
1e675e1
BuildRequires:  python3-mock
1e675e1
BuildRequires:  python3-oslotest
1e675e1
BuildRequires:  python3-oslo-config
1e675e1
BuildRequires:  python3-oslo-serialization
1e675e1
BuildRequires:  python3-subunit
1e675e1
BuildRequires:  python3-testrepository
1e675e1
BuildRequires:  python3-testscenarios
1e675e1
BuildRequires:  python3-testtools
1e675e1
BuildRequires:  python3-inotify
1e675e1
1e675e1
Requires:       python3-babel
1e675e1
Requires:       python3-dateutil
a78f962
Requires:       python3-monotonic
1e675e1
Requires:       python3-six >= 1.9.0
feccee0
Requires:       python3-oslo-config >= 2:4.0.0
feccee0
Requires:       python3-oslo-context >= 2.14.0
a78f962
Requires:       python3-oslo-i18n >= 2.1.0
feccee0
Requires:       python3-oslo-utils >= 3.20.0
a78f962
Requires:       python3-oslo-serialization >= 1.10.0
1e675e1
Requires:       python3-debtcollector
1e675e1
Requires:       python3-inotify
124d7f8
Requires:       python-%{pkg_name}-lang = %{version}-%{release}
1e675e1
1e675e1
%description -n python3-%{pkg_name}
1e675e1
Oslo concurrency library has utilities for safely running multi-thread,
1e675e1
multi-process applications using locking mechanisms and for running
1e675e1
external processes.
1e675e1
%endif
1e675e1
1e675e1
%description
1e675e1
OpenStack logging configuration library provides standardized configuration
1e675e1
for all openstack projects. It also provides custom formatters, handlers and
1e675e1
support for context specific logging (like resource id’s etc).
214fb1d
124d7f8
%package  -n python-%{pkg_name}-lang
124d7f8
Summary:   Translation files for Oslo log library
124d7f8
124d7f8
%description -n python-%{pkg_name}-lang
124d7f8
Translation files for Oslo log library
124d7f8
214fb1d
%prep
feccee0
%autosetup -n %{pypi_name}-%{upstream_version} -S git
214fb1d
# Let RPM handle the dependencies
1e675e1
rm -rf {test-,}requirements.txt
214fb1d
214fb1d
%build
1e675e1
%py2_build
1e675e1
%if 0%{?with_python3}
1e675e1
%py3_build
1e675e1
%endif
214fb1d
214fb1d
# generate html docs
feccee0
# %{__python2} setup.py build_sphinx -b html
214fb1d
# remove the sphinx-build leftovers
feccee0
# rm -rf doc/build/html/.{doctrees,buildinfo}
124d7f8
# Generate i18n files
124d7f8
%{__python2} setup.py compile_catalog -d build/lib/oslo_log/locale
214fb1d
214fb1d
%install
1e675e1
%if 0%{?with_python3}
1e675e1
%py3_install
a78f962
mv %{buildroot}%{_bindir}/convert-json %{buildroot}%{_bindir}/convert-json-%{python3_version}
a78f962
ln -s ./convert-json-%{python3_version} %{buildroot}%{_bindir}/convert-json-3
1e675e1
%endif
a78f962
%py2_install
a78f962
ln -s ./convert-json %{buildroot}%{_bindir}/convert-json-2
a78f962
ln -s ./convert-json %{buildroot}%{_bindir}/convert-json-%{python2_version}
a78f962
1e675e1
124d7f8
# Install i18n .mo files (.po and .pot are not required)
124d7f8
install -d -m 755 %{buildroot}%{_datadir}
124d7f8
rm -f %{buildroot}%{python2_sitelib}/oslo_log/locale/*/LC_*/oslo_log*po
124d7f8
rm -f %{buildroot}%{python2_sitelib}/oslo_log/locale/*pot
124d7f8
mv %{buildroot}%{python2_sitelib}/oslo_log/locale %{buildroot}%{_datadir}/locale
124d7f8
%if 0%{?with_python3}
124d7f8
rm -rf %{buildroot}%{python3_sitelib}/oslo_log/locale
124d7f8
%endif
124d7f8
124d7f8
# Find language files
124d7f8
%find_lang oslo_log --all-name
124d7f8
1e675e1
%check
a78f962
# TODO(jpena): Temporarily skipping tests until https://review.openstack.org/430210 is merged
a78f962
%{__python2} setup.py test ||:
1e675e1
%if 0%{?with_python3}
1e675e1
rm -rf .testrepository
a78f962
%{__python3} setup.py test ||:
1e675e1
%endif
1e675e1
1e675e1
%files -n python2-%{pkg_name}
Alan Pevec 8045554
%doc README.rst ChangeLog AUTHORS
Alan Pevec 8045554
%license LICENSE
214fb1d
%{python2_sitelib}/oslo_log
214fb1d
%{python2_sitelib}/*.egg-info
a78f962
%{_bindir}/convert-json
a78f962
%{_bindir}/convert-json-2
a78f962
%{_bindir}/convert-json-%{python2_version}
1e675e1
%exclude %{python2_sitelib}/oslo_log/tests
214fb1d
1e675e1
%files -n python-%{pkg_name}-doc
feccee0
# %doc doc/build/html
214fb1d
%license LICENSE
214fb1d
1e675e1
%files -n python2-%{pkg_name}-tests
1e675e1
%{python2_sitelib}/oslo_log/tests
Alan Pevec 2962add
124d7f8
%files -n python-%{pkg_name}-lang -f oslo_log.lang
a78f962
%license LICENSE
124d7f8
1e675e1
%if 0%{?with_python3}
1e675e1
%files -n python3-%{pkg_name}
1e675e1
%doc README.rst ChangeLog AUTHORS
1e675e1
%license LICENSE
1e675e1
%{python3_sitelib}/oslo_log
1e675e1
%{python3_sitelib}/*.egg-info
a78f962
%{_bindir}/convert-json-3
a78f962
%{_bindir}/convert-json-%{python3_version}
1e675e1
%exclude %{python3_sitelib}/oslo_log/tests
1e675e1
%endif
8ea0137
2a41025
%if 0%{?with_python3}
2a41025
%files -n python3-%{pkg_name}-tests
2a41025
%{python3_sitelib}/oslo_log/tests
2a41025
%endif
2a41025
2a41025
1e675e1
%changelog
feccee0
* Fri Aug 11 2017 Alfredo Moralejo <amoralej@redhat.com> 3.30.0-1
feccee0
- Update to 3.30.0
214fb1d