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