]>
Commit | Line | Data |
---|---|---|
729324b6 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without static_libs # static library | |
0c231361 | 4 | %bcond_without gpib # GPIB interface support |
96fc3c05 JB |
5 | %bcond_without java # Java bindings |
6 | %bcond_without python2 # CPython 2.x module | |
7 | %bcond_without python3 # CPython 3.x module | |
8 | %bcond_without ruby # Ruby module | |
729324b6 | 9 | |
ab08c75b | 10 | Summary: Basic hardware access drivers for logic analyzers |
729324b6 | 11 | Summary(pl.UTF-8): Podstawowe sterowniki dostępu do sprzętu dla analizatorów logicznych |
ab08c75b | 12 | Name: libsigrok |
8d790d2d | 13 | Version: 0.4.0 |
03b7ac53 | 14 | Release: 5 |
ab08c75b AM |
15 | License: GPL v3+ |
16 | Group: Libraries | |
9e646453 | 17 | Source0: http://sigrok.org/download/source/libsigrok/%{name}-%{version}.tar.gz |
8d790d2d | 18 | # Source0-md5: 6cd64b94be0b8ce7224de8c823f735aa |
96fc3c05 JB |
19 | Patch0: %{name}-python.patch |
20 | Patch1: %{name}-missing.patch | |
21 | Patch2: %{name}-ruby.patch | |
22 | Patch3: %{name}-java.patch | |
729324b6 | 23 | URL: http://www.sigrok.org/ |
812109b6 JB |
24 | BuildRequires: autoconf >= 2.63 |
25 | BuildRequires: automake >= 1:1.11 | |
26 | #BuildRequires: check >= 0.9.4 | |
ab08c75b | 27 | BuildRequires: doxygen |
812109b6 JB |
28 | BuildRequires: gcc >= 6:4.0 |
29 | BuildRequires: glib2-devel >= 1:2.32.0 | |
96fc3c05 | 30 | BuildRequires: glibmm-devel >= 2.32.0 |
ab08c75b | 31 | BuildRequires: graphviz |
96fc3c05 JB |
32 | %{?with_java:BuildRequires: jdk} |
33 | BuildRequires: libftdi1-devel >= 1.0 | |
96fc3c05 | 34 | BuildRequires: libieee1284-devel |
ffc133da | 35 | BuildRequires: librevisa-devel >= 0.0.20130812 |
8d790d2d | 36 | BuildRequires: libserialport-devel >= 0.1.1 |
96fc3c05 | 37 | BuildRequires: libstdc++-devel >= 6:4.7 |
812109b6 JB |
38 | BuildRequires: libtool >= 2:2 |
39 | BuildRequires: libusb-devel >= 1.0.16 | |
40 | BuildRequires: libzip-devel >= 0.10 | |
0c231361 | 41 | %{?with_gpib:BuildRequires: linux-gpib-devel} |
940b9d4f | 42 | BuildRequires: pkgconfig >= 1:0.22 |
96fc3c05 JB |
43 | # required also for C++ binding |
44 | BuildRequires: python >= 1:2.7 | |
8d790d2d | 45 | %if %{with python2} |
96fc3c05 | 46 | BuildRequires: python-modules >= 1:2.7 |
8d790d2d | 47 | BuildRequires: python-numpy-devel |
96fc3c05 | 48 | BuildRequires: python-pygobject3-devel >= 3.0.0 |
8d790d2d AM |
49 | BuildRequires: python-setuptools |
50 | %endif | |
51 | %if %{with python3} | |
96fc3c05 | 52 | BuildRequires: python3-modules >= 1:3.2 |
8d790d2d | 53 | BuildRequires: python3-numpy-devel |
96fc3c05 | 54 | BuildRequires: python3-pygobject3-devel >= 3.0.0 |
8d790d2d AM |
55 | BuildRequires: python3-setuptools |
56 | %endif | |
96fc3c05 JB |
57 | BuildRequires: rpm-pythonprov |
58 | BuildRequires: rpmbuild(macros) >= 1.612 | |
59 | %{?with_ruby:BuildRequires: ruby-devel} | |
60 | %{?with_java:BuildRequires: swig} | |
61 | %if %{with python2} || %{with python3} | |
62 | BuildRequires: swig-python | |
63 | %endif | |
64 | %{?with_ruby:BuildRequires: swig-ruby >= 3.0.8} | |
ffc133da | 65 | Requires: glib2 >= 1:2.32.0 |
96fc3c05 | 66 | Requires: libftdi1 >= 1.0 |
ffc133da | 67 | Requires: librevisa >= 0.0.20130812 |
96fc3c05 | 68 | Requires: libserialport >= 0.1.1 |
ffc133da JB |
69 | Requires: libusb >= 1.0.16 |
70 | Requires: libzip >= 0.10 | |
940b9d4f | 71 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
ab08c75b AM |
72 | |
73 | %description | |
729324b6 JB |
74 | libsigrok is a shared library written in C which provides the basic |
75 | API for talking to logic analyzer hardware and reading/writing the | |
ab08c75b AM |
76 | acquired data into various input/output file formats. |
77 | ||
729324b6 JB |
78 | %description -l pl.UTF-8 |
79 | libsigrok to napisana w C biblioteka współdzielona udostępniająca | |
80 | podstawowe API do komunikacji ze sprzętowymi analizatorami logicznymi | |
81 | oraz odczytu/zapisu uzyskanych danych z/do różnych formatów plików | |
82 | wejściowych/wyjściowych. | |
83 | ||
ab08c75b | 84 | %package devel |
729324b6 JB |
85 | Summary: Development files for libsigrok |
86 | Summary(pl.UTF-8): Pliki programistyczne biblioteki libsigrok | |
ab08c75b AM |
87 | Group: Development/Libraries |
88 | Requires: %{name} = %{version}-%{release} | |
812109b6 | 89 | Requires: glib2-devel >= 1:2.32.0 |
96fc3c05 JB |
90 | Requires: libftdi1-devel >= 1.0 |
91 | Requires: libieee1284-devel | |
ffc133da | 92 | Requires: librevisa-devel >= 0.0.20130812 |
96fc3c05 | 93 | Requires: libserialport-devel >= 0.1.1 |
812109b6 JB |
94 | Requires: libusb-devel >= 1.0.16 |
95 | Requires: libzip-devel >= 0.10 | |
ab08c75b AM |
96 | |
97 | %description devel | |
729324b6 JB |
98 | This package contains the header files for developing applications |
99 | that use libsigrok. | |
100 | ||
101 | %description devel -l pl.UTF-8 | |
102 | Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji | |
103 | wykorzystujących bibliotekę libsigrok. | |
104 | ||
105 | %package static | |
106 | Summary: Static libsigrok library | |
107 | Summary(pl.UTF-8): Statyczna biblioteka libsigrok | |
108 | Group: Development/Libraries | |
109 | Requires: %{name} = %{version}-%{release} | |
110 | ||
111 | %description static | |
112 | Static libsigrok library. | |
113 | ||
114 | %description static -l pl.UTF-8 | |
115 | Statyczna biblioteka libsigrok. | |
ab08c75b | 116 | |
8d790d2d | 117 | %package c++ |
96fc3c05 JB |
118 | Summary: C++ bindings for libsigrok library |
119 | Summary(pl.UTF-8): Wiązania C++ do biblioteki libsigrok | |
120 | Group: Libraries | |
8d790d2d | 121 | Requires: %{name} = %{version}-%{release} |
96fc3c05 | 122 | Requires: glibmm >= 2.32.0 |
8d790d2d AM |
123 | |
124 | %description c++ | |
96fc3c05 | 125 | C++ bindings for libsigrok library. |
8d790d2d AM |
126 | |
127 | %description c++ -l pl.UTF-8 | |
96fc3c05 | 128 | Wiązania C++ do biblioteki libsigrok. |
8d790d2d AM |
129 | |
130 | %package c++-devel | |
96fc3c05 JB |
131 | Summary: Header files for libsigrokcxx based applications |
132 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libsigrokcxx | |
8d790d2d AM |
133 | Group: Development/Libraries |
134 | Requires: %{name}-c++ = %{version}-%{release} | |
96fc3c05 JB |
135 | Requires: %{name}-devel = %{version}-%{release} |
136 | Requires: glibmm-devel >= 2.32.0 | |
137 | Requires: libstdc++-devel | |
8d790d2d AM |
138 | |
139 | %description c++-devel | |
96fc3c05 JB |
140 | This package includes the header files necessary to develop |
141 | applications that use libsigrokcxx library. | |
8d790d2d AM |
142 | |
143 | %description c++-devel -l pl.UTF-8 | |
144 | Pakiet ten zawiera pliki nagłówkowe niezbędne do kompilacji programów | |
96fc3c05 | 145 | z wykorzystaniem biblioteki libsigrokcxx. |
8d790d2d AM |
146 | |
147 | %package c++-static | |
96fc3c05 JB |
148 | Summary: Static libsigrokcxx library |
149 | Summary(pl.UTF-8): Biblioteka statyczna libsigrokcxx | |
8d790d2d AM |
150 | Group: Development/Libraries |
151 | Requires: %{name}-c++-devel = %{version}-%{release} | |
152 | ||
153 | %description c++-static | |
96fc3c05 | 154 | Static libsigrokcxx library. |
8d790d2d AM |
155 | |
156 | %description c++-static -l pl.UTF-8 | |
96fc3c05 JB |
157 | Biblioteka statyczna libsigrokcxx. |
158 | ||
159 | %package -n java-sigrok | |
160 | Summary: Java bindings for libsigrok library | |
161 | Summary(pl.UTF-8): Wiązania Javy do biblioteki libsigrok | |
162 | Group: Libraries/Java | |
163 | Requires: %{name}-c++ = %{version}-%{release} | |
164 | Requires: jre | |
165 | ||
166 | %description -n java-sigrok | |
167 | Java bindings for libsigrok library. | |
8d790d2d | 168 | |
96fc3c05 JB |
169 | %description -n java-sigrok -l pl.UTF-8 |
170 | Wiązania Javy do biblioteki libsigrok. | |
171 | ||
172 | %package -n python-sigrok | |
173 | Summary: Python 2 bindings for libsigrok library | |
174 | Summary(pl.UTF-8): Wiązania Pythona 2 do biblioteki libsigrok | |
8d790d2d | 175 | Group: Libraries/Python |
96fc3c05 JB |
176 | Requires: %{name}-c++ = %{version}-%{release} |
177 | Requires: python-modules >= 1:2.7 | |
178 | ||
179 | %description -n python-sigrok | |
180 | Python 2 bindings for libsigrok library. | |
8d790d2d | 181 | |
96fc3c05 JB |
182 | %description -n python-sigrok -l pl.UTF-8 |
183 | Wiązania Pythona 2 do biblioteki libsigrok. | |
8d790d2d | 184 | |
96fc3c05 JB |
185 | %package -n python3-sigrok |
186 | Summary: Python 3 bindings for libsigrok library | |
187 | Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki libsigrok | |
8d790d2d | 188 | Group: Libraries/Python |
96fc3c05 JB |
189 | Requires: %{name}-c++ = %{version}-%{release} |
190 | Requires: python3-modules >= 1:3.2 | |
191 | ||
192 | %description -n python3-sigrok | |
193 | Python 3 bindings for libsigrok library. | |
194 | ||
195 | %description -n python3-sigrok -l pl.UTF-8 | |
196 | Wiązania Pythona 3 do biblioteki libsigrok. | |
197 | ||
198 | %package -n ruby-sigrok | |
199 | Summary: Ruby bindings for libsigrok library | |
200 | Summary(pl.UTF-8): Wiązania języka Ruby do biblioteki libsigrok | |
201 | Group: Libraries/Java | |
202 | Requires: %{name}-c++ = %{version}-%{release} | |
203 | Requires: ruby | |
204 | ||
205 | %description -n ruby-sigrok | |
206 | Ruby bindings for libsigrok library. | |
8d790d2d | 207 | |
96fc3c05 JB |
208 | %description -n ruby-sigrok -l pl.UTF-8 |
209 | Wiązania języka Ruby do biblioteki libsigrok. | |
8d790d2d | 210 | |
ab08c75b | 211 | %prep |
9e646453 | 212 | %setup -q |
96fc3c05 JB |
213 | %patch0 -p1 |
214 | %patch1 -p1 | |
215 | %patch2 -p1 | |
216 | %patch3 -p1 | |
ab08c75b AM |
217 | |
218 | %build | |
041136c7 | 219 | %{__libtoolize} |
8d790d2d | 220 | %{__aclocal} -I m4 |
729324b6 | 221 | %{__autoconf} |
041136c7 AM |
222 | %{__autoheader} |
223 | %{__automake} | |
8d790d2d AM |
224 | |
225 | %if %{with python3} | |
96fc3c05 JB |
226 | install -d build-py3 |
227 | cd build-py3 | |
8d790d2d | 228 | |
96fc3c05 | 229 | ../%configure \ |
8d790d2d AM |
230 | PYTHON="%{__python3}" \ |
231 | --disable-all-drivers \ | |
8d790d2d | 232 | --disable-java \ |
96fc3c05 JB |
233 | --disable-ruby \ |
234 | --disable-silent-rules \ | |
8d790d2d AM |
235 | --disable-static \ |
236 | --enable-python | |
237 | %{__make} python-build | |
238 | cd .. | |
239 | %endif | |
240 | ||
241 | %configure \ | |
242 | PYTHON="%{__python}" \ | |
041136c7 | 243 | --enable-all-drivers \ |
96fc3c05 JB |
244 | --enable-java%{!?with_java:=no} \ |
245 | --enable-python%{!?with_python2:=no} \ | |
246 | --enable-ruby%{!?with_ruby:=no} \ | |
729324b6 | 247 | --disable-silent-rules \ |
0c231361 JB |
248 | %{!?with_static_libs:--disable-static} \ |
249 | --with-libgpib%{!?with_gpib:=no} | |
ab08c75b AM |
250 | |
251 | %{__make} | |
252 | ||
253 | doxygen Doxyfile | |
254 | ||
255 | %install | |
256 | rm -rf $RPM_BUILD_ROOT | |
729324b6 | 257 | install -d $RPM_BUILD_ROOT{/lib/udev/rules.d,%{_datadir}/sigrok-firmware} |
c1c16ad7 | 258 | |
8d790d2d | 259 | %if %{with python3} |
96fc3c05 | 260 | %{__make} -C build-py3 python-install \ |
8d790d2d AM |
261 | DESTDIR=$RPM_BUILD_ROOT |
262 | %endif | |
263 | ||
ab08c75b AM |
264 | %{__make} install \ |
265 | DESTDIR=$RPM_BUILD_ROOT | |
266 | ||
c1c16ad7 AM |
267 | sed -e 's#plugdev#usb#g' contrib/z60_libsigrok.rules > $RPM_BUILD_ROOT/lib/udev/rules.d/60-libsigrok.rules |
268 | ||
812109b6 | 269 | # obsoleted by pkg-config |
8d790d2d | 270 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libsigrok{,cxx}.la |
812109b6 | 271 | |
96fc3c05 JB |
272 | %if %{with python2} |
273 | %py_postclean | |
274 | %endif | |
275 | ||
ab08c75b AM |
276 | %clean |
277 | rm -rf $RPM_BUILD_ROOT | |
278 | ||
729324b6 JB |
279 | %post -p /sbin/ldconfig |
280 | %postun -p /sbin/ldconfig | |
281 | ||
8d790d2d AM |
282 | %post c++ -p /sbin/ldconfig |
283 | %postun c++ -p /sbin/ldconfig | |
284 | ||
ab08c75b AM |
285 | %files |
286 | %defattr(644,root,root,755) | |
812109b6 | 287 | %doc ChangeLog NEWS README README.devices |
ab08c75b | 288 | %attr(755,root,root) %{_libdir}/libsigrok.so.*.*.* |
8d790d2d | 289 | %attr(755,root,root) %ghost %{_libdir}/libsigrok.so.3 |
c1c16ad7 | 290 | /lib/udev/rules.d/60-libsigrok.rules |
d65f705a | 291 | %{_datadir}/sigrok-firmware |
ab08c75b AM |
292 | |
293 | %files devel | |
294 | %defattr(644,root,root,755) | |
041136c7 | 295 | %doc doxy/html-api/* |
940b9d4f | 296 | %attr(755,root,root) %{_libdir}/libsigrok.so |
729324b6 | 297 | %{_includedir}/libsigrok |
041136c7 | 298 | %{_pkgconfigdir}/libsigrok.pc |
729324b6 JB |
299 | |
300 | %if %{with static_libs} | |
301 | %files static | |
302 | %defattr(644,root,root,755) | |
303 | %{_libdir}/libsigrok.a | |
304 | %endif | |
8d790d2d AM |
305 | |
306 | %files c++ | |
307 | %defattr(644,root,root,755) | |
308 | %attr(755,root,root) %{_libdir}/libsigrokcxx.so.*.*.* | |
309 | %attr(755,root,root) %ghost %{_libdir}/libsigrokcxx.so.3 | |
310 | ||
311 | %files c++-devel | |
312 | %defattr(644,root,root,755) | |
313 | %attr(755,root,root) %{_libdir}/libsigrokcxx.so | |
314 | %{_includedir}/libsigrokcxx | |
315 | %{_pkgconfigdir}/libsigrokcxx.pc | |
316 | ||
317 | %if %{with static_libs} | |
318 | %files c++-static | |
319 | %defattr(644,root,root,755) | |
320 | %{_libdir}/libsigrokcxx.a | |
321 | %endif | |
322 | ||
96fc3c05 JB |
323 | %if %{with java} |
324 | %files -n java-sigrok | |
8d790d2d | 325 | %defattr(644,root,root,755) |
96fc3c05 JB |
326 | %attr(755,root,root) %{_libdir}/libsigrok_java_core_classes.so |
327 | %{_javadir}/sigrok-core.jar | |
8d790d2d | 328 | %endif |
96fc3c05 JB |
329 | |
330 | %if %{with python2} | |
331 | %files -n python-sigrok | |
332 | %defattr(644,root,root,755) | |
333 | %dir %{py_sitedir}/sigrok | |
334 | %dir %{py_sitedir}/sigrok/core | |
335 | %attr(755,root,root) %{py_sitedir}/sigrok/core/_classes.so | |
336 | %{py_sitedir}/sigrok/core/*.py[co] | |
337 | %{py_sitedir}/libsigrok-%{version}-py*.egg-info | |
338 | %{py_sitedir}/libsigrok-%{version}-py*.pth | |
8d790d2d AM |
339 | %endif |
340 | ||
341 | %if %{with python3} | |
96fc3c05 JB |
342 | %files -n python3-sigrok |
343 | %defattr(644,root,root,755) | |
344 | %dir %{py3_sitedir}/sigrok | |
345 | %dir %{py3_sitedir}/sigrok/core | |
346 | %attr(755,root,root) %{py3_sitedir}/sigrok/core/_classes.cpython-*.so | |
347 | %{py3_sitedir}/sigrok/core/*.py | |
348 | %{py3_sitedir}/sigrok/core/__pycache__ | |
349 | %{py3_sitedir}/libsigrok-%{version}-py*.egg-info | |
350 | %{py3_sitedir}/libsigrok-%{version}-py*.pth | |
351 | %endif | |
352 | ||
353 | %if %{with ruby} | |
354 | %files -n ruby-sigrok | |
8d790d2d | 355 | %defattr(644,root,root,755) |
96fc3c05 | 356 | %attr(755,root,root) %{ruby_vendorarchdir}/sigrok.so |
8d790d2d | 357 | %endif |