forked from pool/nanopb
* Fix memory not released on error return from pb_decode_ex() (bsc#1234088) * Fix deprecated MakeClass() call in generator (#1015) * Fix compiler error with enums and --c-style (#1014) * Fix version conflict with bazel build rules (#1034) * Fix problems with enum intsize introduced in 0.4.8 (#961) * Fix Python pkg_resources deprecation (#887) * Add option to discard deprecated fields (#997) * Use fallback_type when breaking circular dependencies (#996) * Discard autogenerated map entry types if the field is skipped (#956) * Use pb_byte_t = uint8_t when available (#916) * Add enum_validate option (#988, #991) * Add check_return attribute for IAR compiler (#965) * Add label_override field option (#962, #963) * Add Zephyr module specification (#946) * Add Apple privacy manifest (#938) * Bazel rule improvements, including bzlmod migration (#927, #950) * CMake build rule improvements (#936, #939, #942, #958, #968, #971, #974, #978, #1003) * Improve C++ descriptors (#931, #933) * Test case improvements (#928) * Update dependency package versions (#924, #959, #986, #998, #1010) * Documentation improvements (#319, #710, #999) OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/nanopb?expand=0&rev=29
115 lines
3.5 KiB
RPMSpec
115 lines
3.5 KiB
RPMSpec
#
|
|
# spec file for package nanopb
|
|
#
|
|
# Copyright (c) 2024 SUSE LLC
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%define sover 0
|
|
%define src_install_dir %{_prefix}/src/%{name}
|
|
Name: nanopb
|
|
Version: 0.4.9.1
|
|
Release: 0
|
|
Summary: Protocol Buffers with small code size
|
|
License: Zlib
|
|
Group: Development/Libraries/C and C++
|
|
URL: https://jpa.kapsi.fi/nanopb/
|
|
Source: https://github.com/nanopb/nanopb/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
|
BuildRequires: cmake
|
|
BuildRequires: fdupes
|
|
BuildRequires: protobuf-devel
|
|
BuildRequires: python-rpm-macros
|
|
BuildRequires: python3
|
|
BuildRequires: python3-setuptools
|
|
|
|
%description
|
|
Nanopb is a C implementation of Google's Protocol Buffers data format. It is
|
|
targeted at 32 bit microcontrollers, but is also fit for other embedded systems
|
|
with tight (2-10 kB ROM, <1 kB RAM) memory constraints.
|
|
|
|
%package -n libprotobuf-nanopb%{sover}
|
|
Summary: Shared library for nanopb
|
|
Group: System/Libraries
|
|
|
|
%description -n libprotobuf-nanopb%{sover}
|
|
Shared library for nanopb - a C implementation of Google's Protocol Buffers
|
|
data format.
|
|
|
|
%package devel
|
|
Summary: Development files for nanopb
|
|
Group: Development/Libraries/C and C++
|
|
Requires: libprotobuf-nanopb%{sover} = %{version}
|
|
|
|
%description devel
|
|
Development files for nanopb - a C implementation of Google's Protocol Buffers
|
|
data format.
|
|
|
|
%package source
|
|
Summary: Source code of nanopb
|
|
Group: Development/Libraries/C and C++
|
|
BuildArch: noarch
|
|
|
|
%description source
|
|
Source code of nanopb - a C implementation of Google's Protocol Buffers data
|
|
format.
|
|
|
|
%prep
|
|
%autosetup -p1
|
|
|
|
%build
|
|
%cmake \
|
|
-DCMAKE_C_FLAGS=-DPB_ENABLE_MALLOC=1
|
|
%cmake_build
|
|
|
|
%install
|
|
%cmake_install
|
|
# Install source code
|
|
mkdir -p %{buildroot}%{src_install_dir}
|
|
tar -xf %{SOURCE0} --strip-components=1 -C %{buildroot}%{src_install_dir}
|
|
# drop the only py2 script which is only for compatibility
|
|
rm %{buildroot}%{src_install_dir}/generator/nanopb_generator.py2
|
|
|
|
find %{buildroot}%{src_install_dir} -name ".*" -exec rm -rfv \{\} +
|
|
# Fix env-script-interpreter rpmlint error
|
|
files=$(grep -rl '#!/usr/bin/env python' %{buildroot}%{src_install_dir}) && echo $files | xargs sed -i 's|#!/usr/bin/env python|#!%{_bindir}/python|'
|
|
sed -i 's|env python3|python3|' %{buildroot}%{_bindir}/*
|
|
|
|
%fdupes %{buildroot}%{src_install_dir}
|
|
|
|
%post -n libprotobuf-nanopb%{sover} -p /sbin/ldconfig
|
|
%postun -n libprotobuf-nanopb%{sover} -p /sbin/ldconfig
|
|
|
|
%files -n libprotobuf-nanopb%{sover}
|
|
%license LICENSE.txt
|
|
%doc CHANGELOG.txt README.md
|
|
%{_libdir}/libprotobuf-nanopb.so.%{sover}
|
|
|
|
%files devel
|
|
%{_bindir}/nanopb_generator.py
|
|
%{_bindir}/nanopb_generator
|
|
%{_bindir}/protoc-gen-nanopb
|
|
%{python3_sitelib}/nanopb
|
|
%dir %{_includedir}/nanopb
|
|
%{_includedir}/nanopb/pb.h
|
|
%{_includedir}/nanopb/pb_common.h
|
|
%{_includedir}/nanopb/pb_decode.h
|
|
%{_includedir}/nanopb/pb_encode.h
|
|
%{_libdir}/cmake/nanopb
|
|
%{_libdir}/libprotobuf-nanopb.so
|
|
|
|
%files source
|
|
%{src_install_dir}
|
|
|
|
%changelog
|