## START: Set by rpmautospec ## (rpmautospec version 0.3.5) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 3; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %bcond_without check %global forgeurl https://github.com/nanopb/nanopb Version: 0.4.7 %global tag %{version} %forgemeta Name: nanopb Release: %autorelease Summary: A small code-size Protocol Buffers implementation in ansi C License: Zlib URL: https://jpa.kapsi.fi/nanopb/ Source0: %{forgesource} # remove binary tools of protoc-based generator Patch0: nanopb-remove-bin.patch # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: ninja-build BuildRequires: protobuf-devel BuildRequires: python3-devel # for testing %if %{with check} BuildRequires: python3-scons BuildRequires: %{py3_dist grpcio-tools} %endif %description Nanopb is a small code-size Protocol Buffers implementation in ansi C. It is especially suitable for use in microcontrollers, but fits any memory restricted system. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %package python3 Summary: Small code-size Protocol Buffers implementation in Python Requires: %{name}%{?_isa} = %{version}-%{release} %description python3 The %{name}-python3 package contains Small code-size Protocol Buffers implementation in Python. It includes the protoc-based generator, which converts .proto files to .pb.h files for inclusion in a project. %prep %forgeautosetup -p1 # https://github.com/nanopb/nanopb/blob/master/extra/poetry/poetry_build.sh cp extra/poetry/pyproject.toml . mkdir -p nanopb cp -r generator nanopb touch nanopb/__init__.py nanopb/generator/__init__.py make -C nanopb/generator/proto %generate_buildrequires %pyproject_buildrequires %build %cmake \ -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_STATIC_LIBS=OFF \ -Dnanopb_BUILD_GENERATOR=OFF \ %cmake_build %pyproject_wheel %install %cmake_install %pyproject_install %pyproject_save_files nanopb %if %{with check} %check pushd tests scons popd %endif %files %license LICENSE.txt %doc README.md %{_libdir}/libprotobuf-nanopb.so.0 %files devel %{_libdir}/libprotobuf-nanopb.so %{_includedir}/pb*.h %dir %{_libdir}/cmake/nanopb %{_libdir}/cmake/nanopb/*.cmake %files python3 -f %{pyproject_files} %{_bindir}/nanopb_generator %{_bindir}/protoc-gen-nanopb %changelog * Thu Jul 20 2023 Fedora Release Engineering - 0.4.7-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Sun Jul 02 2023 Python Maint - 0.4.7-2 - Rebuilt for Python 3.12 * Sun Jun 25 2023 topazus - 0.4.7-1 - initial import; rhbz#2216595