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++)
6 %bcond_without apidocs # Doxygen API documentation
7 %bcond_without python # Python binding
8 %bcond_without static_libs # static libraries
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
17 Source0: https://www.kernel.org/pub/software/libs/libgpiod/%{name}-%{version}.tar.xz
18 # Source0-md5: 42e576d44c261411c9e58bba8a87e7f5
19 Patch0: %{name}-python.patch
20 URL: https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/
21 %{?with_apidocs:BuildRequires: doxygen}
22 BuildRequires: help2man
23 BuildRequires: libedit-devel >= 3.1
24 BuildRequires: libstdc++-devel >= 6:7
25 BuildRequires: linux-libc-headers >= 7:5.5
26 BuildRequires: pkgconfig
27 %{?with_python:BuildRequires: python3-devel >= 1:3.9}
28 BuildRequires: tar >= 1:1.22
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 Since Linux 4.8 the GPIO sysfs interface is deprecated. User space
34 should use the character device instead. This library encapsulates the
35 ioctl calls and data structures behind a straightforward API.
37 %description -l pl.UTF-8
38 Od wersja Linuksa 4.8 interfejs sysfs do GPIO jest przestarzały.
39 Przestrzeń użytkownika powinna zamiast niego używać urządzenia
40 znakowego. Ta biblioteka kryje wywołania ioctl i struktury danych za
44 Summary: Header files for libgpiod library
45 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libgpiod
46 Group: Development/Libraries
47 Requires: %{name} = %{version}-%{release}
50 Header files for libgpiod library.
52 %description devel -l pl.UTF-8
53 Pliki nagłówkowe biblioteki libgpiod.
56 Summary: Static libgpiod library
57 Summary(pl.UTF-8): Statyczna biblioteka libgpiod
58 Group: Development/Libraries
59 Requires: %{name}-devel = %{version}-%{release}
62 Static libgpiod library.
64 %description static -l pl.UTF-8
65 Statyczna biblioteka libgpiod.
68 Summary: C++ binding for libgpiod library
69 Summary(pl.UTF-8): Interfejs C++ do biblioteki libgpiod
71 Requires: %{name} = %{version}-%{release}
74 High-level, object-oriented C++ binding for libgpiod library.
76 %description cxx -l pl.UTF-8
77 Wysokopoziomowy, zorientowany obiektowo interfejs C++ do biblioteki
81 Summary: Header files for libgpiodcxx library
82 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libgpiodcxx
83 Group: Development/Libraries
84 Requires: %{name}-cxx = %{version}-%{release}
85 Requires: %{name}-devel = %{version}-%{release}
86 Requires: libstdc++-devel >= 6:7
88 %description cxx-devel
89 Header files for libgpiodcxx library.
91 %description cxx-devel -l pl.UTF-8
92 Pliki nagłówkowe biblioteki libgpiodcxx.
95 Summary: Static libgpiodcxx library
96 Summary(pl.UTF-8): Statyczna biblioteka libgpiodcxx
97 Group: Development/Libraries
98 Requires: %{name}-cxx-devel = %{version}-%{release}
100 %description cxx-static
101 Static libgpiodcxx library.
103 %description cxx-static -l pl.UTF-8
104 Statyczna biblioteka libgpiodcxx.
107 Summary: Tools for interacting with the Linux GPIO character device
108 Summary(pl.UTF-8): Narzędzia do obsługi linuksowych urządzeń znakowych GPIO
109 Group: Application/System
110 Requires: %{name} = %{version}-%{release}
113 Tools for interacting with the Linux GPIO character device.
115 %description tools -l pl.UTF-8
116 Narzędzia do obsługi linuksowych urządzeń znakowych GPIO.
118 %package -n python3-gpiod
119 Summary: Pythona binding for libgpiod library
120 Summary(pl.UTF-8): Interfejs Pythona do biblioteki libgpiod
121 Group: Libraries/Python
122 Requires: %{name} = %{version}-%{release}
124 %description -n python3-gpiod
125 High-level, object-oriented Python binding for libgpiod library.
127 %description -n python3-gpiod -l pl.UTF-8
128 Wysokopoziomowy, zorientowany obiektowo interfejs Pythona do
132 Summary: API documentation for libgpiod library
133 Summary(pl.UTF-8): Dokumentacja API biblioteki libgpiod
138 API documentation for libgpiod library.
140 %description apidocs -l pl.UTF-8
141 Dokumentacja API biblioteki libgpiod.
149 %{!?with_static_libs:--disable-static} \
150 --enable-bindings-cxx \
151 %{?with_python:--enable-bindings-python} \
152 --enable-gpioset-interactive \
153 --disable-silent-rules \
162 rm -rf $RPM_BUILD_ROOT
165 DESTDIR=$RPM_BUILD_ROOT
167 # obsoleted by pkg-config
168 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpiod*.la
171 rm -rf $RPM_BUILD_ROOT
173 %post -p /sbin/ldconfig
174 %postun -p /sbin/ldconfig
176 %post cxx -p /sbin/ldconfig
177 %postun cxx -p /sbin/ldconfig
180 %defattr(644,root,root,755)
182 %attr(755,root,root) %{_libdir}/libgpiod.so.*.*.*
183 %attr(755,root,root) %ghost %{_libdir}/libgpiod.so.3
186 %defattr(644,root,root,755)
187 %attr(755,root,root) %{_libdir}/libgpiod.so
188 %{_includedir}/gpiod.h
189 %{_pkgconfigdir}/libgpiod.pc
191 %if %{with static_libs}
193 %defattr(644,root,root,755)
194 %{_libdir}/libgpiod.a
198 %defattr(644,root,root,755)
199 %attr(755,root,root) %{_libdir}/libgpiodcxx.so.*.*.*
200 %attr(755,root,root) %ghost %{_libdir}/libgpiodcxx.so.2
203 %defattr(644,root,root,755)
204 %attr(755,root,root) %{_libdir}/libgpiodcxx.so
205 %{_includedir}/gpiod.hpp
206 %{_includedir}/gpiodcxx
207 %{_pkgconfigdir}/libgpiodcxx.pc
209 %if %{with static_libs}
211 %defattr(644,root,root,755)
212 %{_libdir}/libgpiodcxx.a
216 %defattr(644,root,root,755)
217 %attr(755,root,root) %{_bindir}/gpiodetect
218 %attr(755,root,root) %{_bindir}/gpioget
219 %attr(755,root,root) %{_bindir}/gpioinfo
220 %attr(755,root,root) %{_bindir}/gpiomon
221 %attr(755,root,root) %{_bindir}/gpionotify
222 %attr(755,root,root) %{_bindir}/gpioset
223 %{_mandir}/man1/gpiodetect.1*
224 %{_mandir}/man1/gpioget.1*
225 %{_mandir}/man1/gpioinfo.1*
226 %{_mandir}/man1/gpiomon.1*
227 %{_mandir}/man1/gpionotify.1*
228 %{_mandir}/man1/gpioset.1*
231 %files -n python3-gpiod
232 %defattr(644,root,root,755)
233 %dir %{py3_sitedir}/gpiod
234 %attr(755,root,root) %{py3_sitedir}/gpiod/_ext.cpython-*.so
235 %{py3_sitedir}/gpiod/*.py
236 %{py3_sitedir}/gpiod/__pycache__
237 %{py3_sitedir}/gpiod-2.0.1-py*.egg-info
242 %defattr(644,root,root,755)