Blame python-oslo-log.spec

a7eb79d
# Macros for py2/py3 compatibility
a7eb79d
%if 0%{?fedora} || 0%{?rhel} > 7
a7eb79d
%global pyver %{python3_pkgversion}
a7eb79d
%else
a7eb79d
%global pyver 2
a7eb79d
%endif
a7eb79d
%global pyver_bin python%{pyver}
9af91de
%global pyver_sitelib %{expand:%{python%{pyver}_sitelib}}
9af91de
%global pyver_install %{expand:%{py%{pyver}_install}}
9af91de
%global pyver_build %{expand:%{py%{pyver}_build}}
a7eb79d
# End of macros for py2/py3 compatibility
2527827
1e675e1
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
a7eb79d
4195ac5
%global with_doc 1
214fb1d
%global pypi_name oslo.log
1e675e1
%global pkg_name oslo-log
a7eb79d
4195ac5
%global common_desc \
4195ac5
OpenStack logging configuration library provides standardized configuration \
4195ac5
for all openstack projects. It also provides custom formatters, handlers and \
4195ac5
support for context specific logging (like resource id’s etc).
4195ac5
4195ac5
%global common_desc1 \
4195ac5
Tests for the Oslo Log handling library.
214fb1d
214fb1d
Name:           python-oslo-log
a7eb79d
Version:        3.44.1
63ecfd0
Release:        3%{?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
a7eb79d
%package -n python%{pyver}-%{pkg_name}
a7eb79d
Summary:        OpenStack Oslo Log library
a7eb79d
%{?python_provide:%python_provide python%{pyver}-%{pkg_name}}
a7eb79d
%if %{pyver} == 3
a7eb79d
Obsoletes: python2-%{pkg_name} < %{version}-%{release}
a7eb79d
%endif
a7eb79d
a7eb79d
BuildRequires:  python%{pyver}-devel
a7eb79d
BuildRequires:  python%{pyver}-pbr
a7eb79d
BuildRequires:  git
a7eb79d
# Required for tests
a7eb79d
BuildRequires:  python%{pyver}-dateutil
a7eb79d
BuildRequires:  python%{pyver}-mock
a7eb79d
BuildRequires:  python%{pyver}-oslotest
a7eb79d
BuildRequires:  python%{pyver}-oslo-context
a7eb79d
BuildRequires:  python%{pyver}-oslo-config
a7eb79d
BuildRequires:  python%{pyver}-oslo-serialization
a7eb79d
BuildRequires:  python%{pyver}-subunit
a7eb79d
BuildRequires:  python%{pyver}-testtools
a7eb79d
BuildRequires:  python%{pyver}-testrepository
a7eb79d
BuildRequires:  python%{pyver}-testscenarios
a7eb79d
# Required to compile translation files
a7eb79d
BuildRequires:  python%{pyver}-babel
a7eb79d
# Handle python2 exception
a7eb79d
%if %{pyver} == 2
a7eb79d
BuildRequires:  python-inotify
a7eb79d
%else
a7eb79d
BuildRequires:  python%{pyver}-inotify
a7eb79d
%endif
a7eb79d
a7eb79d
Requires:       python%{pyver}-pbr
a7eb79d
Requires:       python%{pyver}-dateutil
a7eb79d
Requires:       python%{pyver}-six >= 1.11.0
a7eb79d
Requires:       python%{pyver}-oslo-config >= 2:5.2.0
a7eb79d
Requires:       python%{pyver}-oslo-context >= 2.20.0
a7eb79d
Requires:       python%{pyver}-oslo-i18n >= 3.20.0
a7eb79d
Requires:       python%{pyver}-oslo-utils >= 3.36.0
a7eb79d
Requires:       python%{pyver}-oslo-serialization >= 2.25.0
a7eb79d
Requires:       python%{pyver}-debtcollector >= 1.19.0
a7eb79d
# Handle python2 exception
a7eb79d
%if %{pyver} == 2
a7eb79d
Requires:       python-inotify
a7eb79d
Requires:       python%{pyver}-monotonic >= 1.4
a7eb79d
%else
a7eb79d
Requires:       python%{pyver}-inotify
a7eb79d
%endif
a7eb79d
a7eb79d
Requires:       python-%{pkg_name}-lang = %{version}-%{release}
a7eb79d
a7eb79d
%description -n python%{pyver}-%{pkg_name}
a7eb79d
%{common_desc}
a7eb79d
4195ac5
%if 0%{?with_doc}
1e675e1
%package -n python-%{pkg_name}-doc
214fb1d
Summary:    Documentation for the Oslo Log handling library
214fb1d
a7eb79d
BuildRequires:  python%{pyver}-sphinx
a7eb79d
BuildRequires:  python%{pyver}-openstackdocstheme
a7eb79d
BuildRequires:  python%{pyver}-oslo-config
a7eb79d
BuildRequires:  python%{pyver}-oslo-utils
214fb1d
1e675e1
%description -n python-%{pkg_name}-doc
214fb1d
Documentation for the Oslo Log handling library.
4195ac5
%endif
214fb1d
a7eb79d
%package -n python%{pyver}-%{pkg_name}-tests
2a41025
Summary:    Tests for the Oslo Log handling library
2a41025
a7eb79d
Requires:       python%{pyver}-%{pkg_name} = %{version}-%{release}
a7eb79d
Requires:       python%{pyver}-mock
a7eb79d
Requires:       python%{pyver}-oslotest
a7eb79d
Requires:       python%{pyver}-oslo-config >= 2:5.2.0
a7eb79d
Requires:       python%{pyver}-subunit
a7eb79d
Requires:       python%{pyver}-testtools
a7eb79d
Requires:       python%{pyver}-testrepository
a7eb79d
Requires:       python%{pyver}-testscenarios
2a41025
a7eb79d
%description -n python%{pyver}-%{pkg_name}-tests
4195ac5
%{common_desc1}
2a41025
1e675e1
%description
4195ac5
%{common_desc}
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
a7eb79d
%{pyver_build}
214fb1d
4195ac5
%if 0%{?with_doc}
214fb1d
# generate html docs
a7eb79d
PYTHONPATH=. sphinx-build-%{pyver} -W -b html doc/source doc/build/html
a7eb79d
# remove the sphinx-build-%{pyver} leftovers
4195ac5
rm -rf doc/build/html/.{doctrees,buildinfo}
4195ac5
%endif
124d7f8
# Generate i18n files
a7eb79d
%{pyver_bin} setup.py compile_catalog -d build/lib/oslo_log/locale
214fb1d
214fb1d
%install
a7eb79d
%{pyver_install}
a7eb79d
ln -s ./convert-json %{buildroot}%{_bindir}/convert-json-%{pyver}
2527827
124d7f8
# Install i18n .mo files (.po and .pot are not required)
124d7f8
install -d -m 755 %{buildroot}%{_datadir}
a7eb79d
rm -f %{buildroot}%{pyver_sitelib}/oslo_log/locale/*/LC_*/oslo_log*po
a7eb79d
rm -f %{buildroot}%{pyver_sitelib}/oslo_log/locale/*pot
a7eb79d
mv %{buildroot}%{pyver_sitelib}/oslo_log/locale %{buildroot}%{_datadir}/locale
124d7f8
124d7f8
# Find language files
124d7f8
%find_lang oslo_log --all-name
124d7f8
1e675e1
%check
a7eb79d
%{pyver_bin} setup.py test
a7eb79d
a7eb79d
%files -n python%{pyver}-%{pkg_name}
a7eb79d
%doc README.rst ChangeLog AUTHORS
a7eb79d
%license LICENSE
a7eb79d
%{pyver_sitelib}/oslo_log
a7eb79d
%{pyver_sitelib}/*.egg-info
a7eb79d
%{_bindir}/convert-json
a7eb79d
%{_bindir}/convert-json-%{pyver}
a7eb79d
%exclude %{pyver_sitelib}/oslo_log/tests
214fb1d
4195ac5
%if 0%{?with_doc}
1e675e1
%files -n python-%{pkg_name}-doc
4195ac5
%doc doc/build/html
214fb1d
%license LICENSE
4195ac5
%endif
214fb1d
a7eb79d
%files -n python%{pyver}-%{pkg_name}-tests
a7eb79d
%{pyver_sitelib}/oslo_log/tests
124d7f8
a7eb79d
%files -n python-%{pkg_name}-lang -f oslo_log.lang
1e675e1
%license LICENSE
2a41025
1e675e1
%changelog
63ecfd0
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.44.1-3
63ecfd0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
63ecfd0
a7eb79d
* Wed Nov 06 2019 Alfredo Moralejo <amoralej@redhat.com> 3.44.1-2
a7eb79d
- Update to upstream version 3.44.1
a7eb79d
4ad38e3
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 3.42.3-4
4ad38e3
- Rebuilt for Python 3.8.0rc1 (#1748018)
4ad38e3
45be505
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 3.42.3-3
45be505
- Rebuilt for Python 3.8
45be505
54c8c28
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.42.3-2
54c8c28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
54c8c28
2527827
* Fri Mar 08 2019 RDO <dev@lists.rdoproject.org> 3.42.3-1
2527827
- Update to 3.42.3
214fb1d