]> git.pld-linux.org Git - packages/nanopb.git/blob - nanopb.spec
- updated to 0.4.6.4
[packages/nanopb.git] / nanopb.spec
1 #
2 # Conditional build:
3 %bcond_without  apidocs         # API documentation
4 %bcond_without  static_libs     # static library
5 #
6 Summary:        Nanopb - Protocol Buffers for Embedded Systems
7 Summary(pl.UTF-8):      Nanopb - Protocol Buffers dla systemów wbudowanych
8 Name:           nanopb
9 Version:        0.4.6.4
10 Release:        1
11 License:        BSD-like
12 Group:          Libraries
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)
23
24 %description
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.
28
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.
33
34 %package devel
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
40
41 %description devel
42 Header files for Nanopb library.
43
44 %description devel -l pl.UTF-8
45 Pliki nagłówkowe biblioteki Nanopb.
46
47 %package static
48 Summary:        Static Nanopb library
49 Summary(pl.UTF-8):      Statyczna biblioteka Nanopb
50 Group:          Development/Libraries
51 Requires:       %{name}-devel = %{version}-%{release}
52
53 %description static
54 Static Nanopb library.
55
56 %description static -l pl.UTF-8
57 Statyczna biblioteka Nanopb.
58
59 %package apidocs
60 Summary:        API documentation for Nanopb library
61 Summary(pl.UTF-8):      Dokumentacja API biblioteki Nanopb
62 Group:          Documentation
63 BuildArch:      noarch
64
65 %description apidocs
66 API documentation for Nanopb library.
67
68 %description apidocs -l pl.UTF-8
69 Dokumentacja API biblioteki Nanopb.
70
71 %prep
72 %setup -q
73
74 %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' generator/nanopb_generator.py
75
76 %build
77 install -d build
78 cd build
79 %cmake .. \
80         -DBUILD_SHARED_LIBS=ON \
81         %{!?with_static_libs:-DBUILD_STATIC_LIBS=OFF}
82
83 %{__make}
84 cd ..
85
86 %if %{with apidocs}
87 %{__make} -C docs
88 %endif
89
90 %install
91 rm -rf $RPM_BUILD_ROOT
92
93 %{__make} -C build install \
94         DESTDIR=$RPM_BUILD_ROOT
95
96 %clean
97 rm -rf $RPM_BUILD_ROOT
98
99 %post   -p /sbin/ldconfig
100 %postun -p /sbin/ldconfig
101
102 %files
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
106
107 %files devel
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
112 %{_includedir}/pb*.h
113 %{py3_sitescriptdir}/proto
114 %{_libdir}/cmake/nanopb
115
116 %if %{with static_libs}
117 %files static
118 %defattr(644,root,root,755)
119 %{_libdir}/libprotobuf-nanopb.a
120 %endif
121
122 %if %{with apidocs}
123 %files apidocs
124 %defattr(644,root,root,755)
125 %doc docs/{logo,*.css,*.html,*.svg}
126 %endif
This page took 0.125615 seconds and 3 git commands to generate.