]>
Commit | Line | Data |
---|---|---|
8ea07acb JB |
1 | # TODO: |
2 | # - rust bindings (--enable-bindings-rust, needs vendoring; BR: cargo, rust) | |
3 | # - tests (BR: kmod-devel >= 18, libmount-devel >= 2.33.1, glib2-devel >= 1:2.50 for library; bats for tools; catch2 for C++) | |
397de191 JB |
4 | # |
5 | # Conditional build: | |
6 | %bcond_without apidocs # Doxygen API documentation | |
7 | %bcond_without python # Python binding | |
8 | %bcond_without static_libs # static libraries | |
9 | # | |
283c091b JP |
10 | Summary: Library for interacting with the Linux GPIO character device |
11 | Summary(pl.UTF-8): Biblioteka do obsługi linuksowych urządzeń znakowych GPIO | |
397de191 | 12 | Name: libgpiod |
026b13bf | 13 | Version: 2.1 |
93ed0a45 | 14 | Release: 1 |
397de191 JB |
15 | License: LGPL v2.1+ |
16 | Group: Libraries | |
17 | Source0: https://www.kernel.org/pub/software/libs/libgpiod/%{name}-%{version}.tar.xz | |
026b13bf | 18 | # Source0-md5: 42e576d44c261411c9e58bba8a87e7f5 |
8ea07acb | 19 | Patch0: %{name}-python.patch |
397de191 | 20 | URL: https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/ |
bf0a9e3b JP |
21 | BuildRequires: autoconf >= 2.69 |
22 | BuildRequires: autoconf-archive | |
23 | BuildRequires: automake | |
397de191 | 24 | %{?with_apidocs:BuildRequires: doxygen} |
1628dfdd | 25 | BuildRequires: help2man |
83f32c77 | 26 | BuildRequires: libedit-devel >= 3.1 |
8ea07acb | 27 | BuildRequires: libstdc++-devel >= 6:7 |
bf0a9e3b | 28 | BuildRequires: libtool |
83f32c77 JP |
29 | BuildRequires: linux-libc-headers >= 7:5.5 |
30 | BuildRequires: pkgconfig | |
a8d94ba4 JP |
31 | %if %{with python} |
32 | BuildRequires: python3 >= 1:3.9 | |
33 | BuildRequires: python3-devel >= 1:3.9 | |
34 | BuildRequires: python3-modules >= 1:3.9 | |
35 | BuildRequires: python3-setuptools | |
36 | %endif | |
3f8bbb9b | 37 | BuildRequires: rpm-build >= 4.6 |
397de191 JB |
38 | BuildRequires: tar >= 1:1.22 |
39 | BuildRequires: xz | |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
43 | Since Linux 4.8 the GPIO sysfs interface is deprecated. User space | |
44 | should use the character device instead. This library encapsulates the | |
45 | ioctl calls and data structures behind a straightforward API. | |
46 | ||
47 | %description -l pl.UTF-8 | |
48 | Od wersja Linuksa 4.8 interfejs sysfs do GPIO jest przestarzały. | |
49 | Przestrzeń użytkownika powinna zamiast niego używać urządzenia | |
50 | znakowego. Ta biblioteka kryje wywołania ioctl i struktury danych za | |
51 | bezpośrednim API. | |
52 | ||
53 | %package devel | |
54 | Summary: Header files for libgpiod library | |
55 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libgpiod | |
56 | Group: Development/Libraries | |
57 | Requires: %{name} = %{version}-%{release} | |
58 | ||
59 | %description devel | |
60 | Header files for libgpiod library. | |
61 | ||
62 | %description devel -l pl.UTF-8 | |
63 | Pliki nagłówkowe biblioteki libgpiod. | |
64 | ||
65 | %package static | |
66 | Summary: Static libgpiod library | |
67 | Summary(pl.UTF-8): Statyczna biblioteka libgpiod | |
68 | Group: Development/Libraries | |
69 | Requires: %{name}-devel = %{version}-%{release} | |
70 | ||
71 | %description static | |
72 | Static libgpiod library. | |
73 | ||
74 | %description static -l pl.UTF-8 | |
75 | Statyczna biblioteka libgpiod. | |
76 | ||
77 | %package cxx | |
78 | Summary: C++ binding for libgpiod library | |
79 | Summary(pl.UTF-8): Interfejs C++ do biblioteki libgpiod | |
80 | Group: Libraries | |
81 | Requires: %{name} = %{version}-%{release} | |
82 | ||
83 | %description cxx | |
84 | High-level, object-oriented C++ binding for libgpiod library. | |
85 | ||
86 | %description cxx -l pl.UTF-8 | |
87 | Wysokopoziomowy, zorientowany obiektowo interfejs C++ do biblioteki | |
88 | libgpiod. | |
89 | ||
90 | %package cxx-devel | |
91 | Summary: Header files for libgpiodcxx library | |
92 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libgpiodcxx | |
93 | Group: Development/Libraries | |
94 | Requires: %{name}-cxx = %{version}-%{release} | |
95 | Requires: %{name}-devel = %{version}-%{release} | |
8ea07acb | 96 | Requires: libstdc++-devel >= 6:7 |
397de191 JB |
97 | |
98 | %description cxx-devel | |
99 | Header files for libgpiodcxx library. | |
100 | ||
101 | %description cxx-devel -l pl.UTF-8 | |
102 | Pliki nagłówkowe biblioteki libgpiodcxx. | |
103 | ||
104 | %package cxx-static | |
105 | Summary: Static libgpiodcxx library | |
106 | Summary(pl.UTF-8): Statyczna biblioteka libgpiodcxx | |
107 | Group: Development/Libraries | |
108 | Requires: %{name}-cxx-devel = %{version}-%{release} | |
109 | ||
110 | %description cxx-static | |
111 | Static libgpiodcxx library. | |
112 | ||
113 | %description cxx-static -l pl.UTF-8 | |
114 | Statyczna biblioteka libgpiodcxx. | |
115 | ||
283c091b JP |
116 | %package tools |
117 | Summary: Tools for interacting with the Linux GPIO character device | |
118 | Summary(pl.UTF-8): Narzędzia do obsługi linuksowych urządzeń znakowych GPIO | |
119 | Group: Application/System | |
120 | Requires: %{name} = %{version}-%{release} | |
121 | ||
122 | %description tools | |
123 | Tools for interacting with the Linux GPIO character device. | |
124 | ||
125 | %description tools -l pl.UTF-8 | |
126 | Narzędzia do obsługi linuksowych urządzeń znakowych GPIO. | |
127 | ||
397de191 JB |
128 | %package -n python3-gpiod |
129 | Summary: Pythona binding for libgpiod library | |
130 | Summary(pl.UTF-8): Interfejs Pythona do biblioteki libgpiod | |
131 | Group: Libraries/Python | |
132 | Requires: %{name} = %{version}-%{release} | |
133 | ||
134 | %description -n python3-gpiod | |
135 | High-level, object-oriented Python binding for libgpiod library. | |
136 | ||
137 | %description -n python3-gpiod -l pl.UTF-8 | |
138 | Wysokopoziomowy, zorientowany obiektowo interfejs Pythona do | |
139 | biblioteki libgpiod. | |
140 | ||
141 | %package apidocs | |
142 | Summary: API documentation for libgpiod library | |
143 | Summary(pl.UTF-8): Dokumentacja API biblioteki libgpiod | |
144 | Group: Documentation | |
397de191 | 145 | BuildArch: noarch |
397de191 JB |
146 | |
147 | %description apidocs | |
148 | API documentation for libgpiod library. | |
149 | ||
150 | %description apidocs -l pl.UTF-8 | |
151 | Dokumentacja API biblioteki libgpiod. | |
152 | ||
153 | %prep | |
154 | %setup -q | |
8ea07acb | 155 | %patch0 -p1 |
397de191 JB |
156 | |
157 | %build | |
bf0a9e3b JP |
158 | %{__libtoolize} |
159 | %{__aclocal} | |
160 | %{__autoconf} | |
161 | %{__autoheader} | |
162 | %{__automake} | |
397de191 JB |
163 | %configure \ |
164 | %{!?with_static_libs:--disable-static} \ | |
165 | --enable-bindings-cxx \ | |
166 | %{?with_python:--enable-bindings-python} \ | |
8ea07acb | 167 | --enable-gpioset-interactive \ |
397de191 JB |
168 | --disable-silent-rules \ |
169 | --enable-tools | |
170 | %{__make} | |
171 | ||
172 | %if %{with apidocs} | |
173 | %{__make} doc | |
174 | %endif | |
175 | ||
176 | %install | |
177 | rm -rf $RPM_BUILD_ROOT | |
178 | ||
179 | %{__make} install \ | |
180 | DESTDIR=$RPM_BUILD_ROOT | |
181 | ||
182 | # obsoleted by pkg-config | |
183 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpiod*.la | |
397de191 JB |
184 | |
185 | %clean | |
186 | rm -rf $RPM_BUILD_ROOT | |
187 | ||
188 | %post -p /sbin/ldconfig | |
189 | %postun -p /sbin/ldconfig | |
190 | ||
191 | %post cxx -p /sbin/ldconfig | |
192 | %postun cxx -p /sbin/ldconfig | |
193 | ||
194 | %files | |
195 | %defattr(644,root,root,755) | |
196 | %doc NEWS README | |
397de191 | 197 | %attr(755,root,root) %{_libdir}/libgpiod.so.*.*.* |
8ea07acb | 198 | %attr(755,root,root) %ghost %{_libdir}/libgpiod.so.3 |
397de191 JB |
199 | |
200 | %files devel | |
201 | %defattr(644,root,root,755) | |
202 | %attr(755,root,root) %{_libdir}/libgpiod.so | |
203 | %{_includedir}/gpiod.h | |
204 | %{_pkgconfigdir}/libgpiod.pc | |
205 | ||
206 | %if %{with static_libs} | |
207 | %files static | |
208 | %defattr(644,root,root,755) | |
209 | %{_libdir}/libgpiod.a | |
210 | %endif | |
211 | ||
212 | %files cxx | |
213 | %defattr(644,root,root,755) | |
214 | %attr(755,root,root) %{_libdir}/libgpiodcxx.so.*.*.* | |
8ea07acb | 215 | %attr(755,root,root) %ghost %{_libdir}/libgpiodcxx.so.2 |
397de191 JB |
216 | |
217 | %files cxx-devel | |
218 | %defattr(644,root,root,755) | |
219 | %attr(755,root,root) %{_libdir}/libgpiodcxx.so | |
220 | %{_includedir}/gpiod.hpp | |
8ea07acb | 221 | %{_includedir}/gpiodcxx |
397de191 JB |
222 | %{_pkgconfigdir}/libgpiodcxx.pc |
223 | ||
224 | %if %{with static_libs} | |
225 | %files cxx-static | |
226 | %defattr(644,root,root,755) | |
227 | %{_libdir}/libgpiodcxx.a | |
228 | %endif | |
229 | ||
283c091b JP |
230 | %files tools |
231 | %defattr(644,root,root,755) | |
232 | %attr(755,root,root) %{_bindir}/gpiodetect | |
233 | %attr(755,root,root) %{_bindir}/gpioget | |
234 | %attr(755,root,root) %{_bindir}/gpioinfo | |
235 | %attr(755,root,root) %{_bindir}/gpiomon | |
236 | %attr(755,root,root) %{_bindir}/gpionotify | |
237 | %attr(755,root,root) %{_bindir}/gpioset | |
238 | %{_mandir}/man1/gpiodetect.1* | |
239 | %{_mandir}/man1/gpioget.1* | |
240 | %{_mandir}/man1/gpioinfo.1* | |
241 | %{_mandir}/man1/gpiomon.1* | |
242 | %{_mandir}/man1/gpionotify.1* | |
243 | %{_mandir}/man1/gpioset.1* | |
244 | ||
397de191 JB |
245 | %if %{with python} |
246 | %files -n python3-gpiod | |
247 | %defattr(644,root,root,755) | |
8ea07acb JB |
248 | %dir %{py3_sitedir}/gpiod |
249 | %attr(755,root,root) %{py3_sitedir}/gpiod/_ext.cpython-*.so | |
250 | %{py3_sitedir}/gpiod/*.py | |
251 | %{py3_sitedir}/gpiod/__pycache__ | |
026b13bf | 252 | %{py3_sitedir}/gpiod-2.0.1-py*.egg-info |
397de191 JB |
253 | %endif |
254 | ||
255 | %if %{with apidocs} | |
256 | %files apidocs | |
257 | %defattr(644,root,root,755) | |
258 | %doc doc/html/* | |
259 | %endif |