Blame python-oslo-log.spec

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
124d7f8
Version:        3.16.0
621d54e
Release:        3%{?dist}
214fb1d
Summary:        OpenStack Oslo Log library
214fb1d
214fb1d
License:        ASL 2.0
214fb1d
URL:            http://launchpad.net/oslo
124d7f8
Source0:        https://pypi.io/packages/source/o/%{pypi_name}/%{pypi_name}-%{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
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
214fb1d
Requires:       python-six >= 1.9.0
214fb1d
Requires:       python-oslo-config
214fb1d
Requires:       python-oslo-context
214fb1d
Requires:       python-oslo-i18n
214fb1d
Requires:       python-oslo-utils
214fb1d
Requires:       python-oslo-serialization
Alan Pevec 2962add
Requires:       python-debtcollector
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
214fb1d
BuildRequires:  python-oslo-sphinx
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
1e675e1
Requires:       python-oslo-config
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
2a41025
Requires:       python3-oslo-config
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
1e675e1
Requires:       python3-six >= 1.9.0
1e675e1
Requires:       python3-oslo-config
1e675e1
Requires:       python3-oslo-context
1e675e1
Requires:       python3-oslo-i18n
1e675e1
Requires:       python3-oslo-utils
1e675e1
Requires:       python3-oslo-serialization
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
1e675e1
%setup -q -n %{pypi_name}-%{upstream_version}
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
1e675e1
PYTHONPATH=. sphinx-build doc/source html
214fb1d
# remove the sphinx-build leftovers
214fb1d
rm -rf html/.{doctrees,buildinfo}
124d7f8
# Generate i18n files
124d7f8
%{__python2} setup.py compile_catalog -d build/lib/oslo_log/locale
214fb1d
214fb1d
%install
1e675e1
%py2_install
1e675e1
%if 0%{?with_python3}
1e675e1
%py3_install
1e675e1
%endif
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
1e675e1
%{__python2} setup.py test
1e675e1
%if 0%{?with_python3}
1e675e1
rm -rf .testrepository
1e675e1
%{__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
1e675e1
%exclude %{python2_sitelib}/oslo_log/tests
214fb1d
1e675e1
%files -n python-%{pkg_name}-doc
214fb1d
%doc 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
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
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
621d54e
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.16.0-3
621d54e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
621d54e
fd1bb78
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 3.16.0-2
fd1bb78
- Rebuild for Python 3.6
fd1bb78
124d7f8
* Tue Sep 06 2016 Haikel Guemar <hguemar@fedoraproject.org> 3.16.0-1
124d7f8
- Update to 3.16.0
214fb1d