summaryrefslogtreecommitdiff
path: root/libnanopb-dev.spec
blob: af0b9f74e55cd3b06688ccb269eaa079d072f758 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# topdir: libnanopb-dev-0.4.9.2
# Self-provides cmake(Nanopb): the installed nanopb-config.cmake makes
# find_package(Nanopb) work for downstream consumers. find_package(Nanopb)
# seen by the dependency scanner only comes from examples/ and build-tests/
# (consumer CMakeLists), never from the library's own build.

%global debug_package %{nil}

Name:           libnanopb-dev
Version:        0.4.9.2
Release:        3%{?dist}
Summary:        Protocol Buffers for embedded systems - development files

License:        Zlib
URL:            https://github.com/nanopb/nanopb
Source0:        https://github.com/nanopb/nanopb/archive/0f6d088e777a33dd7b54297f137ef10d745c5da8.tar.gz#/libnanopb-dev-%{version}.tar.gz

Group:          Development/Libraries
Packager:       openEuler Builder <builder@openeuler.org>

BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  make
BuildRequires:  protobuf-compiler
BuildRequires:  python3-devel

Requires:       python3
Requires:       python3-protobuf
Requires:       protobuf-compiler

# This package installs nanopb-config.cmake, so it provides the cmake(Nanopb)
# capability that downstream find_package(Nanopb) consumers look for.
Provides:       cmake(Nanopb) = %{version}-%{release}

%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.

This package contains the C runtime headers, the static library
(libprotobuf-nanopb.a), the CMake integration files (nanopb-config.cmake) and
the nanopb code generator, which converts .proto definitions into .pb.c/.pb.h
source files.

%prep
%autosetup -n %{name}-%{version}

%build
%cmake \
    -DBUILD_SHARED_LIBS=OFF \
    -DBUILD_STATIC_LIBS=ON \
    -Dnanopb_BUILD_RUNTIME=ON \
    -Dnanopb_BUILD_GENERATOR=ON \
    -DPython_EXECUTABLE=%{_bindir}/python3
# Build against the in-source Makefile that cmake wrote into the source tree;
# the cmake-build helper macro here targets an absent out-of-source directory.
%make_build

%install
%make_install

%files
%license LICENSE.txt
%doc README.md AUTHORS.txt CHANGELOG.txt
%{_includedir}/nanopb/
%{_libdir}/libprotobuf-nanopb.a
%{_libdir}/cmake/nanopb/
%{_bindir}/nanopb_generator
%{_bindir}/nanopb_generator.py
%{_bindir}/protoc-gen-nanopb
%{python3_sitelib}/nanopb/

%changelog
* Wed Sep 23 2026 openEuler Builder <builder@openeuler.org> - 0.4.9.2-3
- Fix %build syntax error: the prior explanatory comment named rpm macros
  (cmake/cmake_build/make_build/make_install/vpath_builddir) with a percent
  prefix; rpm expands such tokens even inside comments and the multi-line
  cmake macro body broke out of the comment as live shell, aborting the
  build script with a syntax error near an unquoted parenthesis. Replaced
  the comment with a percent-token-free note; the make_build/make_install
  build approach is retained.

* Wed Sep 23 2026 openEuler Builder <builder@openeuler.org> - 0.4.9.2-2
- Fix %build: use %make_build/%make_install against %cmake in-source Makefile
  (chroot's %cmake_build expects absent out-of-source dir)

* Wed Sep 23 2026 openEuler Builder <builder@openeuler.org> - 0.4.9.2-1
- Initial package for openEuler