]>
Commit | Line | Data |
---|---|---|
729324b6 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without static_libs # static library | |
96fc3c05 JB |
4 | %bcond_without java # Java bindings |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | %bcond_without ruby # Ruby module | |
729324b6 | 8 | |
ab08c75b | 9 | Summary: Basic hardware access drivers for logic analyzers |
729324b6 | 10 | Summary(pl.UTF-8): Podstawowe sterowniki dostępu do sprzętu dla analizatorów logicznych |
ab08c75b | 11 | Name: libsigrok |
8d790d2d AM |
12 | Version: 0.4.0 |
13 | Release: 1 | |
ab08c75b AM |
14 | License: GPL v3+ |
15 | Group: Libraries | |
9e646453 | 16 | Source0: http://sigrok.org/download/source/libsigrok/%{name}-%{version}.tar.gz |
8d790d2d | 17 | # Source0-md5: 6cd64b94be0b8ce7224de8c823f735aa |
96fc3c05 JB |
18 | Patch0: %{name}-python.patch |
19 | Patch1: %{name}-missing.patch | |
20 | Patch2: %{name}-ruby.patch | |
21 | Patch3: %{name}-java.patch | |
729324b6 | 22 | URL: http://www.sigrok.org/ |
812109b6 JB |
23 | BuildRequires: autoconf >= 2.63 |
24 | BuildRequires: automake >= 1:1.11 | |
25 | #BuildRequires: check >= 0.9.4 | |
ab08c75b | 26 | BuildRequires: doxygen |
812109b6 JB |
27 | BuildRequires: gcc >= 6:4.0 |
28 | BuildRequires: glib2-devel >= 1:2.32.0 | |
96fc3c05 | 29 | BuildRequires: glibmm-devel >= 2.32.0 |
ab08c75b | 30 | BuildRequires: graphviz |
96fc3c05 JB |
31 | %{?with_java:BuildRequires: jdk} |
32 | BuildRequires: libftdi1-devel >= 1.0 | |
33 | # TODO: | |
34 | #BuildRequires: libgpib-devel | |
35 | BuildRequires: libieee1284-devel | |
ffc133da | 36 | BuildRequires: librevisa-devel >= 0.0.20130812 |
8d790d2d | 37 | BuildRequires: libserialport-devel >= 0.1.1 |
96fc3c05 | 38 | BuildRequires: libstdc++-devel >= 6:4.7 |
812109b6 JB |
39 | BuildRequires: libtool >= 2:2 |
40 | BuildRequires: libusb-devel >= 1.0.16 | |
41 | BuildRequires: libzip-devel >= 0.10 | |
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 | |
96fc3c05 | 219 | #install -d autostuff |
041136c7 | 220 | %{__libtoolize} |
8d790d2d | 221 | %{__aclocal} -I m4 |
729324b6 | 222 | %{__autoconf} |
041136c7 AM |
223 | %{__autoheader} |
224 | %{__automake} | |
8d790d2d AM |
225 | |
226 | %if %{with python3} | |
96fc3c05 JB |
227 | install -d build-py3 |
228 | cd build-py3 | |
229 | #install -d .py3-bindings | |
230 | #cp -a * .py3-bindings | |
8d790d2d | 231 | |
96fc3c05 JB |
232 | #cd .py3-bindings |
233 | ../%configure \ | |
8d790d2d AM |
234 | PYTHON="%{__python3}" \ |
235 | --disable-all-drivers \ | |
8d790d2d | 236 | --disable-java \ |
96fc3c05 JB |
237 | --disable-ruby \ |
238 | --disable-silent-rules \ | |
8d790d2d AM |
239 | --disable-static \ |
240 | --enable-python | |
241 | %{__make} python-build | |
242 | cd .. | |
243 | %endif | |
244 | ||
245 | %configure \ | |
246 | PYTHON="%{__python}" \ | |
041136c7 | 247 | --enable-all-drivers \ |
96fc3c05 JB |
248 | --enable-java%{!?with_java:=no} \ |
249 | --enable-python%{!?with_python2:=no} \ | |
250 | --enable-ruby%{!?with_ruby:=no} \ | |
729324b6 JB |
251 | --disable-silent-rules \ |
252 | %{!?with_static_libs:--disable-static} | |
ab08c75b AM |
253 | |
254 | %{__make} | |
255 | ||
256 | doxygen Doxyfile | |
257 | ||
258 | %install | |
259 | rm -rf $RPM_BUILD_ROOT | |
729324b6 | 260 | install -d $RPM_BUILD_ROOT{/lib/udev/rules.d,%{_datadir}/sigrok-firmware} |
c1c16ad7 | 261 | |
8d790d2d | 262 | %if %{with python3} |
96fc3c05 JB |
263 | #%{__make} -C .py3-bindings python-install |
264 | %{__make} -C build-py3 python-install \ | |
8d790d2d AM |
265 | DESTDIR=$RPM_BUILD_ROOT |
266 | %endif | |
267 | ||
ab08c75b AM |
268 | %{__make} install \ |
269 | DESTDIR=$RPM_BUILD_ROOT | |
270 | ||
c1c16ad7 AM |
271 | sed -e 's#plugdev#usb#g' contrib/z60_libsigrok.rules > $RPM_BUILD_ROOT/lib/udev/rules.d/60-libsigrok.rules |
272 | ||
812109b6 | 273 | # obsoleted by pkg-config |
8d790d2d | 274 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libsigrok{,cxx}.la |
812109b6 | 275 | |
96fc3c05 JB |
276 | %if %{with python2} |
277 | %py_postclean | |
278 | %endif | |
279 | ||
ab08c75b AM |
280 | %clean |
281 | rm -rf $RPM_BUILD_ROOT | |
282 | ||
729324b6 JB |
283 | %post -p /sbin/ldconfig |
284 | %postun -p /sbin/ldconfig | |
285 | ||
8d790d2d AM |
286 | %post c++ -p /sbin/ldconfig |
287 | %postun c++ -p /sbin/ldconfig | |
288 | ||
ab08c75b AM |
289 | %files |
290 | %defattr(644,root,root,755) | |
812109b6 | 291 | %doc ChangeLog NEWS README README.devices |
ab08c75b | 292 | %attr(755,root,root) %{_libdir}/libsigrok.so.*.*.* |
8d790d2d | 293 | %attr(755,root,root) %ghost %{_libdir}/libsigrok.so.3 |
c1c16ad7 | 294 | /lib/udev/rules.d/60-libsigrok.rules |
d65f705a | 295 | %{_datadir}/sigrok-firmware |
ab08c75b AM |
296 | |
297 | %files devel | |
298 | %defattr(644,root,root,755) | |
041136c7 | 299 | %doc doxy/html-api/* |
940b9d4f | 300 | %attr(755,root,root) %{_libdir}/libsigrok.so |
729324b6 | 301 | %{_includedir}/libsigrok |
041136c7 | 302 | %{_pkgconfigdir}/libsigrok.pc |
729324b6 JB |
303 | |
304 | %if %{with static_libs} | |
305 | %files static | |
306 | %defattr(644,root,root,755) | |
307 | %{_libdir}/libsigrok.a | |
308 | %endif | |
8d790d2d AM |
309 | |
310 | %files c++ | |
311 | %defattr(644,root,root,755) | |
312 | %attr(755,root,root) %{_libdir}/libsigrokcxx.so.*.*.* | |
313 | %attr(755,root,root) %ghost %{_libdir}/libsigrokcxx.so.3 | |
314 | ||
315 | %files c++-devel | |
316 | %defattr(644,root,root,755) | |
317 | %attr(755,root,root) %{_libdir}/libsigrokcxx.so | |
318 | %{_includedir}/libsigrokcxx | |
319 | %{_pkgconfigdir}/libsigrokcxx.pc | |
320 | ||
321 | %if %{with static_libs} | |
322 | %files c++-static | |
323 | %defattr(644,root,root,755) | |
324 | %{_libdir}/libsigrokcxx.a | |
325 | %endif | |
326 | ||
96fc3c05 JB |
327 | %if %{with java} |
328 | %files -n java-sigrok | |
8d790d2d | 329 | %defattr(644,root,root,755) |
96fc3c05 JB |
330 | %attr(755,root,root) %{_libdir}/libsigrok_java_core_classes.so |
331 | %{_javadir}/sigrok-core.jar | |
8d790d2d | 332 | %endif |
96fc3c05 JB |
333 | |
334 | %if %{with python2} | |
335 | %files -n python-sigrok | |
336 | %defattr(644,root,root,755) | |
337 | %dir %{py_sitedir}/sigrok | |
338 | %dir %{py_sitedir}/sigrok/core | |
339 | %attr(755,root,root) %{py_sitedir}/sigrok/core/_classes.so | |
340 | %{py_sitedir}/sigrok/core/*.py[co] | |
341 | %{py_sitedir}/libsigrok-%{version}-py*.egg-info | |
342 | %{py_sitedir}/libsigrok-%{version}-py*.pth | |
8d790d2d AM |
343 | %endif |
344 | ||
345 | %if %{with python3} | |
96fc3c05 JB |
346 | %files -n python3-sigrok |
347 | %defattr(644,root,root,755) | |
348 | %dir %{py3_sitedir}/sigrok | |
349 | %dir %{py3_sitedir}/sigrok/core | |
350 | %attr(755,root,root) %{py3_sitedir}/sigrok/core/_classes.cpython-*.so | |
351 | %{py3_sitedir}/sigrok/core/*.py | |
352 | %{py3_sitedir}/sigrok/core/__pycache__ | |
353 | %{py3_sitedir}/libsigrok-%{version}-py*.egg-info | |
354 | %{py3_sitedir}/libsigrok-%{version}-py*.pth | |
355 | %endif | |
356 | ||
357 | %if %{with ruby} | |
358 | %files -n ruby-sigrok | |
8d790d2d | 359 | %defattr(644,root,root,755) |
96fc3c05 | 360 | %attr(755,root,root) %{ruby_vendorarchdir}/sigrok.so |
8d790d2d | 361 | %endif |