]> git.pld-linux.org Git - packages/libgpiod.git/blob - libgpiod.spec
move tools to subpackage
[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 %{?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
29 BuildRequires:  xz
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %description
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.
36
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
41 bezpośrednim API.
42
43 %package devel
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}
48
49 %description devel
50 Header files for libgpiod library.
51
52 %description devel -l pl.UTF-8
53 Pliki nagłówkowe biblioteki libgpiod.
54
55 %package static
56 Summary:        Static libgpiod library
57 Summary(pl.UTF-8):      Statyczna biblioteka libgpiod
58 Group:          Development/Libraries
59 Requires:       %{name}-devel = %{version}-%{release}
60
61 %description static
62 Static libgpiod library.
63
64 %description static -l pl.UTF-8
65 Statyczna biblioteka libgpiod.
66
67 %package cxx
68 Summary:        C++ binding for libgpiod library
69 Summary(pl.UTF-8):      Interfejs C++ do biblioteki libgpiod
70 Group:          Libraries
71 Requires:       %{name} = %{version}-%{release}
72
73 %description cxx
74 High-level, object-oriented C++ binding for libgpiod library.
75
76 %description cxx -l pl.UTF-8
77 Wysokopoziomowy, zorientowany obiektowo interfejs C++ do biblioteki
78 libgpiod.
79
80 %package cxx-devel
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
87
88 %description cxx-devel
89 Header files for libgpiodcxx library.
90
91 %description cxx-devel -l pl.UTF-8
92 Pliki nagłówkowe biblioteki libgpiodcxx.
93
94 %package cxx-static
95 Summary:        Static libgpiodcxx library
96 Summary(pl.UTF-8):      Statyczna biblioteka libgpiodcxx
97 Group:          Development/Libraries
98 Requires:       %{name}-cxx-devel = %{version}-%{release}
99
100 %description cxx-static
101 Static libgpiodcxx library.
102
103 %description cxx-static -l pl.UTF-8
104 Statyczna biblioteka libgpiodcxx.
105
106 %package tools
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}
111
112 %description tools
113 Tools for interacting with the Linux GPIO character device.
114
115 %description tools -l pl.UTF-8
116 Narzędzia do obsługi linuksowych urządzeń znakowych GPIO.
117
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}
123
124 %description -n python3-gpiod
125 High-level, object-oriented Python binding for libgpiod library.
126
127 %description -n python3-gpiod -l pl.UTF-8
128 Wysokopoziomowy, zorientowany obiektowo interfejs Pythona do
129 biblioteki libgpiod.
130
131 %package apidocs
132 Summary:        API documentation for libgpiod library
133 Summary(pl.UTF-8):      Dokumentacja API biblioteki libgpiod
134 Group:          Documentation
135 BuildArch:      noarch
136
137 %description apidocs
138 API documentation for libgpiod library.
139
140 %description apidocs -l pl.UTF-8
141 Dokumentacja API biblioteki libgpiod.
142
143 %prep
144 %setup -q
145 %patch0 -p1
146
147 %build
148 %configure \
149         %{!?with_static_libs:--disable-static} \
150         --enable-bindings-cxx \
151         %{?with_python:--enable-bindings-python} \
152         --enable-gpioset-interactive \
153         --disable-silent-rules \
154         --enable-tools
155 %{__make}
156
157 %if %{with apidocs}
158 %{__make} doc
159 %endif
160
161 %install
162 rm -rf $RPM_BUILD_ROOT
163
164 %{__make} install \
165         DESTDIR=$RPM_BUILD_ROOT
166
167 # obsoleted by pkg-config
168 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpiod*.la
169
170 %clean
171 rm -rf $RPM_BUILD_ROOT
172
173 %post   -p /sbin/ldconfig
174 %postun -p /sbin/ldconfig
175
176 %post   cxx -p /sbin/ldconfig
177 %postun cxx -p /sbin/ldconfig
178
179 %files
180 %defattr(644,root,root,755)
181 %doc NEWS README
182 %attr(755,root,root) %{_libdir}/libgpiod.so.*.*.*
183 %attr(755,root,root) %ghost %{_libdir}/libgpiod.so.3
184
185 %files devel
186 %defattr(644,root,root,755)
187 %attr(755,root,root) %{_libdir}/libgpiod.so
188 %{_includedir}/gpiod.h
189 %{_pkgconfigdir}/libgpiod.pc
190
191 %if %{with static_libs}
192 %files static
193 %defattr(644,root,root,755)
194 %{_libdir}/libgpiod.a
195 %endif
196
197 %files cxx
198 %defattr(644,root,root,755)
199 %attr(755,root,root) %{_libdir}/libgpiodcxx.so.*.*.*
200 %attr(755,root,root) %ghost %{_libdir}/libgpiodcxx.so.2
201
202 %files cxx-devel
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
208
209 %if %{with static_libs}
210 %files cxx-static
211 %defattr(644,root,root,755)
212 %{_libdir}/libgpiodcxx.a
213 %endif
214
215 %files tools
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*
229
230 %if %{with python}
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
238 %endif
239
240 %if %{with apidocs}
241 %files apidocs
242 %defattr(644,root,root,755)
243 %doc doc/html/*
244 %endif
This page took 0.094597 seconds and 4 git commands to generate.