%{!?sources_gpg: %{!?dlrn:%global sources_gpg 1} } %global sources_gpg_sign 0x4c29ff0e437f3351fd82bdf47c5a3bc787dc7035 %{!?upstream_version: %global upstream_version %{version}%{?milestone}} %global with_doc 1 %global pypi_name oslo.metrics %global pkg_name oslo-metrics %global common_desc \ The OpenStack Oslo Metrics library. \ Oslo metrics API supports collecting metrics data from other Oslo \ libraries and exposing the metrics data to monitoring system. Name: python-oslo-metrics Version: 0.3.0 Release: %autorelease Summary: OpenStack Oslo Metrics library License: ASL 2.0 URL: https://launchpad.net/oslo Source0: https://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{upstream_version}.tar.gz # License file for jslibs using in -doc subpkg Source1: LICENSE_doc # Required for tarball sources verification %if 0%{?sources_gpg} == 1 Source101: https://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{upstream_version}.tar.gz.asc Source102: https://releases.openstack.org/_static/%{sources_gpg_sign}.txt %endif BuildArch: noarch # Required for tarball sources verification %if 0%{?sources_gpg} == 1 BuildRequires: /usr/bin/gpgv2 %endif %package -n python3-%{pkg_name} Summary: OpenStack Oslo Metrics library %py_provides python3-%{pkg_name} BuildRequires: pyproject-rpm-macros BuildRequires: git-core BuildRequires: python3-devel BuildRequires: python3-oslo-config BuildRequires: python3-oslo-log BuildRequires: python3-oslo-utils BuildRequires: python3-pbr BuildRequires: python3-prometheus_client # Required for testing BuildRequires: python3-oslotest Requires: python3-oslo-config >= 2:6.9.0 Requires: python3-oslo-log >= 3.44.0 Requires: python3-oslo-utils >= 3.41.0 Requires: python3-prometheus_client >= 0.6.0 Requires: python3-pbr >= 3.1.1 %generate_buildrequires %pyproject_buildrequires -r %description -n python3-%{pkg_name} %{common_desc} %if 0%{?with_doc} %package -n python-%{pkg_name}-doc Summary: Documentation for the Oslo Metrics library # licenses for jslibs(sphinx, jquery.js and underscore.js) License: ASL 2.0 and BSD and MIT BuildRequires: python3-openstackdocstheme BuildRequires: python3-sphinx BuildRequires: python3-sphinxcontrib-apidoc %description -n python-%{pkg_name}-doc Documentation for the Oslo Metrics library. %endif %package -n python3-%{pkg_name}-tests Summary: Tests for the Oslo Metrics library Requires: python3-%{pkg_name} = %{version}-%{release} Requires: python3-oslotest %description -n python3-%{pkg_name}-tests Tests for the Oslo Metrics library. %description %{common_desc} %prep # Required for tarball sources verification %if 0%{?sources_gpg} == 1 %{gpgverify} --keyring=%{SOURCE102} --signature=%{SOURCE101} --data=%{SOURCE0} %endif %autosetup -n %{pypi_name}-%{upstream_version} -S git # Let RPM handle the dependencies rm -rf {test-,}requirements.txt install -m 644 %{SOURCE1} %{_builddir}/%{pypi_name}-%{version}/LICENSE_doc %build %pyproject_wheel %if 0%{?with_doc} # generate html docs sphinx-build-3 -b html doc/source doc/build/html # remove the sphinx-build-3 leftovers rm -rf doc/build/html/.{doctrees,buildinfo} %endif %install %pyproject_install %pyproject_save_files oslo_metrics %check %{__python3} setup.py test %files -n python3-%{pkg_name} -f %{pyproject_files} %license LICENSE %doc README.rst %{python3_sitelib}/oslo_metrics %{_bindir}/oslo-metrics %exclude %{python3_sitelib}/oslo_metrics/tests/ %if 0%{?with_doc} %files -n python-%{pkg_name}-doc %license LICENSE LICENSE_doc %doc doc/build/html %endif %files -n python3-%{pkg_name}-tests %{python3_sitelib}/oslo_metrics/tests/ %changelog %autochangelog