3 %bcond_without apidocs # API documentation
4 %bcond_without static_libs # static library
6 Summary: Nanopb - Protocol Buffers for Embedded Systems
7 Summary(pl.UTF-8): Nanopb - Protocol Buffers dla systemów wbudowanych
13 #Source0Download: https://github.com/nanopb/nanopb/tags
14 Source0: https://github.com/nanopb/nanopb/archive/%{version}/%{name}-%{version}.tar.gz
15 # Source0-md5: a80226623867d82d7b0a0a8d4f64fac8
16 URL: https://jpa.kapsi.fi/nanopb/
17 BuildRequires: cmake >= 2.8.12
18 %{?with_apidocs:BuildRequires: pandoc}
19 BuildRequires: python3 >= 1:3
20 BuildRequires: rpm-build >= 4.6
21 BuildRequires: sed >= 4.0
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 Nanopb is a small code-size Protocol Buffers implementation in ANSI C.
26 It is especially suitable for use in microcontrollers, but fits any
27 memory restricted system.
29 %description -l pl.UTF-8
30 Nanopb to mała pod względem rozmiaru kodu implementacja Protocol
31 Buffers w ANSI C. Jest przydatna szczególnie dla mikrokontrolerów, ale
32 nadaje się dla każdego systemu o ograniczonej pamięci.
35 Summary: Header files for Nanopb library
36 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Nanopb
37 Group: Development/Libraries
38 Requires: %{name} = %{version}-%{release}
39 Requires: python3-modules
42 Header files for Nanopb library.
44 %description devel -l pl.UTF-8
45 Pliki nagłówkowe biblioteki Nanopb.
48 Summary: Static Nanopb library
49 Summary(pl.UTF-8): Statyczna biblioteka Nanopb
50 Group: Development/Libraries
51 Requires: %{name}-devel = %{version}-%{release}
54 Static Nanopb library.
56 %description static -l pl.UTF-8
57 Statyczna biblioteka Nanopb.
60 Summary: API documentation for Nanopb library
61 Summary(pl.UTF-8): Dokumentacja API biblioteki Nanopb
66 API documentation for Nanopb library.
68 %description apidocs -l pl.UTF-8
69 Dokumentacja API biblioteki Nanopb.
74 %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' generator/nanopb_generator.py
80 -DBUILD_SHARED_LIBS=ON \
81 %{!?with_static_libs:-DBUILD_STATIC_LIBS=OFF}
91 rm -rf $RPM_BUILD_ROOT
93 %{__make} -C build install \
94 DESTDIR=$RPM_BUILD_ROOT
97 rm -rf $RPM_BUILD_ROOT
99 %post -p /sbin/ldconfig
100 %postun -p /sbin/ldconfig
103 %defattr(644,root,root,755)
104 %doc AUTHORS.txt CHANGELOG.txt LICENSE.txt README.md
105 %attr(755,root,root) %{_libdir}/libprotobuf-nanopb.so.0
108 %defattr(644,root,root,755)
109 %attr(755,root,root) %{_bindir}/nanopb_generator.py
110 %attr(755,root,root) %{_bindir}/protoc-gen-nanopb
111 %attr(755,root,root) %{_libdir}/libprotobuf-nanopb.so
113 %{py3_sitescriptdir}/proto
114 %{_libdir}/cmake/nanopb
116 %if %{with static_libs}
118 %defattr(644,root,root,755)
119 %{_libdir}/libprotobuf-nanopb.a
124 %defattr(644,root,root,755)
125 %doc docs/{logo,*.css,*.html,*.svg}