## START: Set by rpmautospec ## (rpmautospec version 0.2.5) %define autorelease(e:s:pb:) %{?-p:0.}%{lua: release_number = 18; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{?dist} ## END: Set by rpmautospec # Should we re-generate the Python binding code from the .proto files, instead # of using the pre-generated code in the source tarball? Either approach is OK # under Fedora packaging guidelines. %bcond_without codegen %global srcname opencensus-proto %global _description %{expand: Census provides a framework to define and collect stats against metrics and to break those stats down across user-defined dimensions. The Census framework is natively available in many languages (e.g. C++, Go, and Java). The API interface types are defined using protos to ensure consistency and interoperability for the different implementations.} Name: python-%{srcname} Version: 0.3.0 Release: %autorelease Summary: Language Independent Interface Types For OpenCensus License: ASL 2.0 URL: https://github.com/census-instrumentation/%{srcname}/ Source0: %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz BuildRequires: python3-devel %if %{with codegen} BuildRequires: %{py3_dist grpcio-tools} %endif BuildArch: noarch %description %{_description} %package -n python3-%{srcname} Summary: Python library generated from OpenCensus cross-language protos %description -n python3-%{srcname} %{_description}. %prep %autosetup -n %{srcname}-%{version} %if %{with codegen} find gen-python/opencensus/proto -type f ! -name '__init__.py' -print -delete sed -r -i 's|\bpython |%{__python3} |g' src/mkpygen.sh %endif %generate_buildrequires cd gen-python/ %pyproject_buildrequires %build %if %{with codegen} pushd src ./mkpygen.sh popd %endif pushd gen-python/ %pyproject_wheel popd %install pushd gen-python/ %pyproject_install # Giving the name of the containing namespace package works acceptably. # https://bugzilla.redhat.com/show_bug.cgi?id=1935266 %pyproject_save_files opencensus popd %check # Upstream has no tests. %pyproject_check_import %files -n python3-%{srcname} -f %{pyproject_files} %license LICENSE %doc AUTHORS CONTRIBUTING.md gen-python/README.rst # Excluding these files makes it easier to share ownership of the namespace # package directory, without worrying about trivial differences in the contents # of __init__.py—which is not needed for namespace packages in recent Python # versions anyway. %exclude %{python3_sitelib}/opencensus/{*.py,__pycache__/} %changelog * Fri Oct 29 2021 Benjamin A. Beasley 0.3.0-18 - Use the new %%pyproject_check_import macro * Tue Sep 14 2021 Benjamin A. Beasley 0.3.0-17 - Use the pyproject_save_files macro * Sun Sep 12 2021 Benjamin A. Beasley 0.3.0-16 - Drop BR on pyproject-rpm-macros, now implied by python3-devel * Wed Jul 28 2021 Benjamin A. Beasley 0.3.0-15 - Move %generate_buildrequires after %prep to make the spec file easier to follow * Sat Jul 10 2021 Benjamin A. Beasley - 0.3.0-6 - Add a check section that “smoke-tests” imports * Fri Jun 25 2021 Benjamin A. Beasley - 0.3.0-5 - Whitespace adjustments - Drop obsolete %%python_provide macro - Precisely name the egg-info directory rather than using a glob - Use the srcname macro in the package name - Share ownership of the opencensus namespace package directory - Allow re-generating the Python bindings from .proto sources - Use pyproject-rpm-macros * Fri Jun 04 2021 Python Maint - 0.3.0-4 - Rebuilt for Python 3.10 * Wed Jan 27 2021 Fedora Release Engineering - 0.3.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Wed Jul 29 2020 Fedora Release Engineering - 0.3.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Fri Jul 24 2020 Mohamed El Morabity - 0.3.0-1 - Update to 0.3.0 * Sun May 31 2020 Mohamed El Morabity - 0.2.1-2 - Rebuild for Python 3.9 * Fri May 29 2020 Mohamed El Morabity - 0.2.1-1 - Initial RPM release