]>
Commit | Line | Data |
---|---|---|
397de191 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without apidocs # Doxygen API documentation | |
4 | %bcond_without python # Python binding | |
5 | %bcond_without static_libs # static libraries | |
6 | # | |
7 | Summary: Library and tools for interacting with the Linux GPIO character device | |
8 | Summary(pl.UTF-8): Biblioteka i narzędzia do obsługi linuksowych urządzeń znakowych GPIO | |
9 | Name: libgpiod | |
10 | Version: 1.1.1 | |
11 | Release: 1 | |
12 | License: LGPL v2.1+ | |
13 | Group: Libraries | |
14 | Source0: https://www.kernel.org/pub/software/libs/libgpiod/%{name}-%{version}.tar.xz | |
15 | # Source0-md5: e5e946cb01a35e5046a1a7a108d6a96d | |
16 | URL: https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/ | |
17 | %{?with_apidocs:BuildRequires: doxygen} | |
18 | BuildRequires: libstdc++-devel >= 6:4.7 | |
19 | BuildRequires: linux-libc-headers >= 6:4.8 | |
20 | %{?with_python:BuildRequires: python3-devel >= 1:3.2} | |
21 | BuildRequires: tar >= 1:1.22 | |
22 | BuildRequires: xz | |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
24 | ||
25 | %description | |
26 | Since Linux 4.8 the GPIO sysfs interface is deprecated. User space | |
27 | should use the character device instead. This library encapsulates the | |
28 | ioctl calls and data structures behind a straightforward API. | |
29 | ||
30 | %description -l pl.UTF-8 | |
31 | Od wersja Linuksa 4.8 interfejs sysfs do GPIO jest przestarzały. | |
32 | Przestrzeń użytkownika powinna zamiast niego używać urządzenia | |
33 | znakowego. Ta biblioteka kryje wywołania ioctl i struktury danych za | |
34 | bezpośrednim API. | |
35 | ||
36 | %package devel | |
37 | Summary: Header files for libgpiod library | |
38 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libgpiod | |
39 | Group: Development/Libraries | |
40 | Requires: %{name} = %{version}-%{release} | |
41 | ||
42 | %description devel | |
43 | Header files for libgpiod library. | |
44 | ||
45 | %description devel -l pl.UTF-8 | |
46 | Pliki nagłówkowe biblioteki libgpiod. | |
47 | ||
48 | %package static | |
49 | Summary: Static libgpiod library | |
50 | Summary(pl.UTF-8): Statyczna biblioteka libgpiod | |
51 | Group: Development/Libraries | |
52 | Requires: %{name}-devel = %{version}-%{release} | |
53 | ||
54 | %description static | |
55 | Static libgpiod library. | |
56 | ||
57 | %description static -l pl.UTF-8 | |
58 | Statyczna biblioteka libgpiod. | |
59 | ||
60 | %package cxx | |
61 | Summary: C++ binding for libgpiod library | |
62 | Summary(pl.UTF-8): Interfejs C++ do biblioteki libgpiod | |
63 | Group: Libraries | |
64 | Requires: %{name} = %{version}-%{release} | |
65 | ||
66 | %description cxx | |
67 | High-level, object-oriented C++ binding for libgpiod library. | |
68 | ||
69 | %description cxx -l pl.UTF-8 | |
70 | Wysokopoziomowy, zorientowany obiektowo interfejs C++ do biblioteki | |
71 | libgpiod. | |
72 | ||
73 | %package cxx-devel | |
74 | Summary: Header files for libgpiodcxx library | |
75 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libgpiodcxx | |
76 | Group: Development/Libraries | |
77 | Requires: %{name}-cxx = %{version}-%{release} | |
78 | Requires: %{name}-devel = %{version}-%{release} | |
79 | Requires: libstdc++-devel >= 6:4.7 | |
80 | ||
81 | %description cxx-devel | |
82 | Header files for libgpiodcxx library. | |
83 | ||
84 | %description cxx-devel -l pl.UTF-8 | |
85 | Pliki nagłówkowe biblioteki libgpiodcxx. | |
86 | ||
87 | %package cxx-static | |
88 | Summary: Static libgpiodcxx library | |
89 | Summary(pl.UTF-8): Statyczna biblioteka libgpiodcxx | |
90 | Group: Development/Libraries | |
91 | Requires: %{name}-cxx-devel = %{version}-%{release} | |
92 | ||
93 | %description cxx-static | |
94 | Static libgpiodcxx library. | |
95 | ||
96 | %description cxx-static -l pl.UTF-8 | |
97 | Statyczna biblioteka libgpiodcxx. | |
98 | ||
99 | %package -n python3-gpiod | |
100 | Summary: Pythona binding for libgpiod library | |
101 | Summary(pl.UTF-8): Interfejs Pythona do biblioteki libgpiod | |
102 | Group: Libraries/Python | |
103 | Requires: %{name} = %{version}-%{release} | |
104 | ||
105 | %description -n python3-gpiod | |
106 | High-level, object-oriented Python binding for libgpiod library. | |
107 | ||
108 | %description -n python3-gpiod -l pl.UTF-8 | |
109 | Wysokopoziomowy, zorientowany obiektowo interfejs Pythona do | |
110 | biblioteki libgpiod. | |
111 | ||
112 | %package apidocs | |
113 | Summary: API documentation for libgpiod library | |
114 | Summary(pl.UTF-8): Dokumentacja API biblioteki libgpiod | |
115 | Group: Documentation | |
116 | %if "%{_rpmversion}" >= "5" | |
117 | BuildArch: noarch | |
118 | %endif | |
119 | ||
120 | %description apidocs | |
121 | API documentation for libgpiod library. | |
122 | ||
123 | %description apidocs -l pl.UTF-8 | |
124 | Dokumentacja API biblioteki libgpiod. | |
125 | ||
126 | %prep | |
127 | %setup -q | |
128 | ||
129 | %build | |
130 | %configure \ | |
131 | %{!?with_static_libs:--disable-static} \ | |
132 | --enable-bindings-cxx \ | |
133 | %{?with_python:--enable-bindings-python} \ | |
134 | --disable-silent-rules \ | |
135 | --enable-tools | |
136 | %{__make} | |
137 | ||
138 | %if %{with apidocs} | |
139 | %{__make} doc | |
140 | %endif | |
141 | ||
142 | %install | |
143 | rm -rf $RPM_BUILD_ROOT | |
144 | ||
145 | %{__make} install \ | |
146 | DESTDIR=$RPM_BUILD_ROOT | |
147 | ||
148 | # obsoleted by pkg-config | |
149 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpiod*.la | |
150 | %if %{with python} | |
151 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/gpiod.la \ | |
152 | %{?with_static_libs:$RPM_BUILD_ROOT%{py3_sitedir}/gpiod.a} | |
153 | %endif | |
154 | ||
155 | %clean | |
156 | rm -rf $RPM_BUILD_ROOT | |
157 | ||
158 | %post -p /sbin/ldconfig | |
159 | %postun -p /sbin/ldconfig | |
160 | ||
161 | %post cxx -p /sbin/ldconfig | |
162 | %postun cxx -p /sbin/ldconfig | |
163 | ||
164 | %files | |
165 | %defattr(644,root,root,755) | |
166 | %doc NEWS README | |
167 | %attr(755,root,root) %{_bindir}/gpiodetect | |
168 | %attr(755,root,root) %{_bindir}/gpiofind | |
169 | %attr(755,root,root) %{_bindir}/gpioget | |
170 | %attr(755,root,root) %{_bindir}/gpioinfo | |
171 | %attr(755,root,root) %{_bindir}/gpiomon | |
172 | %attr(755,root,root) %{_bindir}/gpioset | |
173 | %attr(755,root,root) %{_libdir}/libgpiod.so.*.*.* | |
174 | %attr(755,root,root) %ghost %{_libdir}/libgpiod.so.2 | |
175 | ||
176 | %files devel | |
177 | %defattr(644,root,root,755) | |
178 | %attr(755,root,root) %{_libdir}/libgpiod.so | |
179 | %{_includedir}/gpiod.h | |
180 | %{_pkgconfigdir}/libgpiod.pc | |
181 | ||
182 | %if %{with static_libs} | |
183 | %files static | |
184 | %defattr(644,root,root,755) | |
185 | %{_libdir}/libgpiod.a | |
186 | %endif | |
187 | ||
188 | %files cxx | |
189 | %defattr(644,root,root,755) | |
190 | %attr(755,root,root) %{_libdir}/libgpiodcxx.so.*.*.* | |
191 | %attr(755,root,root) %ghost %{_libdir}/libgpiodcxx.so.1 | |
192 | ||
193 | %files cxx-devel | |
194 | %defattr(644,root,root,755) | |
195 | %attr(755,root,root) %{_libdir}/libgpiodcxx.so | |
196 | %{_includedir}/gpiod.hpp | |
197 | %{_pkgconfigdir}/libgpiodcxx.pc | |
198 | ||
199 | %if %{with static_libs} | |
200 | %files cxx-static | |
201 | %defattr(644,root,root,755) | |
202 | %{_libdir}/libgpiodcxx.a | |
203 | %endif | |
204 | ||
205 | %if %{with python} | |
206 | %files -n python3-gpiod | |
207 | %defattr(644,root,root,755) | |
208 | %attr(755,root,root) %{py3_sitedir}/gpiod.so | |
209 | %endif | |
210 | ||
211 | %if %{with apidocs} | |
212 | %files apidocs | |
213 | %defattr(644,root,root,755) | |
214 | %doc doc/html/* | |
215 | %endif |