]>
Commit | Line | Data |
---|---|---|
2ee896be | 1 | # TODO: |
08f3bc97 | 2 | # - where to get firmware from? |
2ee896be | 3 | # - PHP 7 support |
d4054fe9 | 4 | # |
d4054fe9 | 5 | # Conditional build: |
2ee896be JB |
6 | %bcond_without kernel # kernel modules |
7 | %bcond_without userspace # userspace packages | |
8 | %bcond_without verbose # verbose modules build (V=1) | |
df990a65 | 9 | |
2ee896be | 10 | %bcond_without docs # documentation build |
08f3bc97 | 11 | %bcond_with hotplug # legacy hotplug support |
2ee896be | 12 | %bcond_without static_libs # static library |
91dbb874 | 13 | %bcond_without guile # guile binding |
2ee896be JB |
14 | %bcond_without perl # Perl binding |
15 | %bcond_without php # PHP binding | |
16 | %bcond_without python # Python binding | |
17 | %bcond_without tcl # Tcl binding | |
df990a65 | 18 | |
2ee896be JB |
19 | Summary: GPIB (IEEE 488) Linux support |
20 | Summary(pl.UTF-8): Obsługa GPIB (IEEE 488) dla Linuksa | |
d4054fe9 | 21 | Name: linux-gpib |
2ee896be JB |
22 | Version: 4.0.3 |
23 | %define rel 0.1 | |
24 | Release: %{rel} | |
25 | License: GPL v2+ | |
cc64c2aa | 26 | Group: Applications/System |
2ee896be JB |
27 | Source0: http://downloads.sourceforge.net/linux-gpib/%{name}-%{version}.tar.gz |
28 | # Source0-md5: 2d97191e538a57ba7350fcc011ee2596 | |
8eefbf3b | 29 | Patch0: %{name}-include_file.patch |
2ee896be JB |
30 | Patch1: %{name}-destdir.patch |
31 | Patch2: %{name}-python.patch | |
32 | Patch3: %{name}-perl.patch | |
08f3bc97 | 33 | Patch4: %{name}-firmwaredir.patch |
91dbb874 | 34 | Patch5: %{name}-guile2.patch |
d4054fe9 | 35 | URL: http://linux-gpib.sourceforge.net/ |
2ee896be JB |
36 | BuildRequires: autoconf >= 2.50 |
37 | BuildRequires: automake | |
38 | BuildRequires: libtool | |
39 | BuildRequires: rpmbuild(macros) >= 1.614 | |
d4054fe9 | 40 | %if %{with kernel} |
2ee896be | 41 | BuildRequires: kernel-module-build >= 3:2.6.8 |
d4054fe9 | 42 | %endif |
2ee896be JB |
43 | %if %{with userspace} |
44 | BuildRequires: bison | |
45 | %{?with_docs:BuildRequires: docbook-utils} | |
46 | BuildRequires: flex | |
91dbb874 | 47 | %{?with_guile:BuildRequires: guile-devel >= 1.4} |
df990a65 | 48 | %{?with_perl:BuildRequires: perl-devel} |
2ee896be JB |
49 | %{?with_php:BuildRequires: php-devel < 4:7} |
50 | %{?with_python:BuildRequires: python-devel >= 2} | |
51 | BuildRequires: readline-devel | |
df990a65 | 52 | %{?with_tcl:BuildRequires: tcl-devel} |
2ee896be JB |
53 | %endif |
54 | Requires: %{name}-libs = %{version}-%{release} | |
d4054fe9 | 55 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
56 | ||
57 | %description | |
cc64c2aa | 58 | The Linux GPIB package provides support for GPIB (IEEE 488) hardware. |
d4054fe9 | 59 | |
bc9733fa JR |
60 | %description -l pl.UTF-8 |
61 | Pakiet Linux GPIB służy do obsługi sprzętu GPIB (IEEE 488). | |
d4054fe9 | 62 | |
08f3bc97 JB |
63 | %package hotplug |
64 | Summary: Linux GPIB support for legacy USB hotplug | |
65 | Summary(pl.UTF-8): Obsługa Linux GPIB dla starego systemu hotplug USB | |
66 | Group: Applications/System | |
67 | Requires: %{name} = %{version}-%{release} | |
68 | Requires: hotplug | |
69 | ||
70 | %description hotplug | |
71 | Linux GPIB support for legacy USB hotplug. | |
72 | ||
73 | %description hotplug -l pl.UTF-8 | |
74 | Obsługa Linux GPIB dla starego systemu hotplug USB. | |
75 | ||
2ee896be JB |
76 | %package libs |
77 | Summary: Shared GPIB library | |
78 | Summary(pl.UTF-8): Biblioteka współdzielona GPIB | |
79 | Group: Libraries | |
d7b3679a | 80 | |
2ee896be JB |
81 | %description libs |
82 | Shared GPIB library. | |
83 | ||
84 | %description libs -l pl.UTF-8 | |
85 | Biblioteka współdzielona GPIB. | |
86 | ||
87 | %package devel | |
88 | Summary: Header file for GPIB library | |
89 | Summary(pl.UTF-8): Plik nagłówkowy biblioteki GPIB | |
90 | Group: Development/Libraries | |
91 | Requires: %{name}-libs = %{version}-%{release} | |
92 | ||
93 | %description devel | |
94 | Header file for GPIB library. | |
95 | ||
96 | %description devel -l pl.UTF-8 | |
97 | Plik nagłówkowy biblioteki GPIB. | |
98 | ||
99 | %package static | |
100 | Summary: Static GPIB library | |
101 | Summary(pl.UTF-8): Biblioteka statyczna GPIB | |
102 | Group: Development/Libraries | |
103 | Requires: %{name}-devel = %{version}-%{release} | |
104 | ||
105 | %description static | |
106 | Static GPIB library. | |
107 | ||
108 | %description static -l pl.UTF-8 | |
109 | Biblioteka statyczna GPIB. | |
110 | ||
91dbb874 JB |
111 | %package -n guile-gpib |
112 | Summary: Guile bindings for GPIB library | |
113 | Summary(pl.UTF-8): Wiązania Guile do biblioteki GPIB | |
114 | Group: Development/Languages/Perl | |
115 | Requires: %{name}-libs = %{version}-%{release} | |
116 | Requires: guile-libs | |
117 | ||
118 | %description -n guile-gpib | |
119 | Guile bindings for GPIB library. | |
120 | ||
121 | %description -n guile-gpib -l pl.UTF-8 | |
122 | Wiązania Guile do biblioteki GPIB. | |
123 | ||
2ee896be JB |
124 | %package -n perl-gpib |
125 | Summary: Perl bindings for GPIB library | |
126 | Summary(pl.UTF-8): Wiązania Perla do biblioteki GPIB | |
127 | Group: Development/Languages/Perl | |
128 | Requires: %{name}-libs = %{version}-%{release} | |
d7b3679a | 129 | |
2ee896be JB |
130 | %description -n perl-gpib |
131 | Perl bindings for GPIB library. | |
d7b3679a | 132 | |
2ee896be JB |
133 | %description -n perl-gpib -l pl.UTF-8 |
134 | Wiązania Perla do biblioteki GPIB. | |
d7b3679a | 135 | |
2ee896be JB |
136 | %package -n python-gpib |
137 | Summary: Python bindings for GPIB library | |
138 | Summary(pl.UTF-8): Wiązania Pythona do biblioteki GPIB | |
139 | Group: Libraries/Python | |
140 | Requires: %{name}-libs = %{version}-%{release} | |
141 | Requires: python-libs | |
d7b3679a | 142 | |
2ee896be JB |
143 | %description -n python-gpib |
144 | Python bindings for GPIB library. | |
145 | ||
146 | %description -n python-gpib -l pl.UTF-8 | |
147 | Wiązania Pythona do biblioteki GPIB. | |
148 | ||
149 | %package -n tcl-gpib | |
150 | Summary: Tcl bindings for GPIB library | |
151 | Summary(pl.UTF-8): Wiązania Tcl-a do biblioteki GPIB | |
152 | Group: Libraries | |
153 | Requires: %{name}-libs = %{version}-%{release} | |
154 | Requires: tcl | |
155 | ||
156 | %description -n tcl-gpib | |
157 | Tcl bindings for GPIB library. | |
158 | ||
159 | %description -n tcl-gpib -l pl.UTF-8 | |
160 | Wiązania Tcl-a do biblioteki GPIB. | |
161 | ||
162 | %package doc | |
163 | Summary: Linux-GPIB tools and library documentation | |
164 | Summary(pl.UTF-8): Dokumentacja narzędzi i biblioteki Linux-GPIB | |
165 | License: GFDL v1.2+ or GPL v2+ | |
166 | Group: Documentation | |
167 | ||
168 | %description doc | |
169 | Linux-GPIB tools and library documentation. | |
170 | ||
171 | %description doc -l pl.UTF-8 | |
172 | Dokumentacja narzędzi i biblioteki Linux-GPIB. | |
173 | ||
174 | %define kernel_pkg()\ | |
175 | %package -n kernel%{_alt_kernel}-gpib\ | |
176 | Summary: Linux GPIB drivers\ | |
177 | Summary(pl.UTF-8): Sterowniki GPIB dla Linuksa\ | |
178 | Release: %{rel}@%{_kernel_ver_str}\ | |
179 | Group: Base/Kernel\ | |
180 | Requires(post,postun): /sbin/depmod\ | |
181 | %requires_releq_kernel\ | |
182 | Requires(postun): %releq_kernel\ | |
183 | \ | |
184 | %description -n kernel%{_alt_kernel}-gpib\ | |
185 | This package contains Linux drivers for GPIB (IEEE 488) hardware.\ | |
186 | \ | |
187 | %description -n kernel%{_alt_kernel}-gpib -l pl.UTF-8\ | |
188 | Ten pakiet zawiera sterowniki dla Linuksa do urządzeń GPIB (IEEE 488).\ | |
189 | \ | |
190 | %if %{with kernel}\ | |
191 | %files -n kernel%{_alt_kernel}-gpib\ | |
192 | %defattr(644,root,root,755)\ | |
193 | /lib/modules/%{_kernel_ver}/kernel/gpib\ | |
194 | %endif\ | |
195 | \ | |
196 | %post -n kernel%{_alt_kernel}-gpib\ | |
197 | %depmod %{_kernel_ver}\ | |
198 | \ | |
199 | %postun -n kernel%{_alt_kernel}-gpib\ | |
200 | %depmod %{_kernel_ver}\ | |
201 | %{nil} | |
202 | ||
203 | %define build_kernel_pkg()\ | |
204 | TOPDIR=$(pwd)\ | |
205 | %build_kernel_modules -C drivers/gpib -m gpib -- EARLYCPPFLAGS="-I$TOPDIR -I$TOPDIR/drivers/gpib/include -I$TOPDIR/include"\ | |
206 | cd drivers/gpib\ | |
207 | %install_kernel_modules -D installed -m agilent_82350b/agilent_82350b,agilent_82357a/agilent_82357a,cb7210/cb7210,cec/cec_gpib,hp_82335/hp82335,hp_82341/hp_82341,ines/ines_gpib,lpvo_usb_gpib/lpvo_usb_gpib,nec7210/nec7210,ni_usb/ni_usb_gpib,pc2/pc2_gpib,sys/gpib_common,tms9914/tms9914,tnt4882/tnt4882 -d kernel/gpib\ | |
208 | %{nil} | |
209 | ||
210 | %define install_kernel_pkg()\ | |
211 | %{nil} | |
212 | ||
213 | %{?with_kernel:%{expand:%create_kernel_packages}} | |
d7b3679a | 214 | |
d4054fe9 | 215 | %prep |
d7b3679a | 216 | %setup -q |
8eefbf3b | 217 | %patch0 -p1 |
2ee896be JB |
218 | %patch1 -p1 |
219 | %patch2 -p1 | |
220 | %patch3 -p1 | |
08f3bc97 | 221 | %patch4 -p1 |
91dbb874 | 222 | %patch5 -p1 |
2ee896be JB |
223 | |
224 | # disable modules build by default, just install userspace header | |
225 | echo 'SUBDIRS = gpib/include' > drivers/Makefile.am | |
226 | ||
227 | # need to inject -I options before $(LINUXINCLUDE), the simplest way is to override CC | |
228 | for f in drivers/gpib/*/Makefile ; do | |
229 | echo 'override CC += $(EARLYCPPFLAGS)' >> $f | |
230 | done | |
d7b3679a | 231 | |
d4054fe9 | 232 | %build |
d7b3679a | 233 | %{__libtoolize} |
2ee896be | 234 | %{__aclocal} -I m4 |
d7b3679a | 235 | %{__autoconf} |
2ee896be | 236 | %{__autoheader} |
d7b3679a | 237 | %{__automake} |
91dbb874 JB |
238 | %if %{with guile} |
239 | CPPFLAGS="%{rpmcppflags} -I/usr/include/guile/2.0" | |
240 | %endif | |
d7b3679a | 241 | %configure \ |
2ee896be JB |
242 | %ifarch %{ix86} |
243 | --enable-isa \ | |
244 | --enable-pcmcia \ | |
245 | %endif | |
246 | %{!?with_docs:--disable-documentation} \ | |
247 | %{!?with_guile:--disable-guile-binding} \ | |
248 | %{!?with_perl:--disable-perl-binding} \ | |
249 | %{!?with_php:--disable-php-binding} \ | |
250 | %{!?with_python:--disable-python-binding} \ | |
251 | %{?with_static_libs:--enable-static} \ | |
252 | %{!?with_tcl:--disable-tcl-binding} \ | |
253 | --with-linux-srcdir=%{_kernelsrcdir} | |
d7b3679a | 254 | |
2ee896be | 255 | %if %{with userspace} |
9e3b7024 | 256 | %{__make} |
2ee896be | 257 | %endif |
d7b3679a | 258 | |
2ee896be JB |
259 | %if %{with kernel} |
260 | %{expand:%build_kernel_packages} | |
261 | %endif | |
d4054fe9 | 262 | |
263 | %install | |
264 | rm -rf $RPM_BUILD_ROOT | |
2ee896be | 265 | install -d $RPM_BUILD_ROOT%{_examplesdir} |
d4054fe9 | 266 | |
8eefbf3b | 267 | %if %{with kernel} |
2ee896be JB |
268 | %{expand:%install_kernel_packages} |
269 | cp -a drivers/gpib/installed/* $RPM_BUILD_ROOT | |
8eefbf3b MWP |
270 | %endif |
271 | ||
d4054fe9 | 272 | %if %{with userspace} |
9e3b7024 | 273 | %{__make} install \ |
08f3bc97 JB |
274 | DESTDIR=$RPM_BUILD_ROOT \ |
275 | HOTPLUG_USB_CONF_DIR=/lib/udev \ | |
276 | UDEV_RULES_DIR=/lib/udev/rules.d \ | |
277 | USB_FIRMWARE_DIR=/lib/firmware | |
278 | # use udev paths as base and legacy hotplug as addon (not the opposite) | |
279 | install -d $RPM_BUILD_ROOT/etc/hotplug/usb | |
280 | %{__mv} $RPM_BUILD_ROOT/lib/udev/*.usermap $RPM_BUILD_ROOT/etc/hotplug/usb | |
281 | ln -snf /lib/udev/agilent_82357a $RPM_BUILD_ROOT/etc/hotplug/usb/agilent_82357a | |
282 | ln -snf /lib/udev/ni_usb_gpib $RPM_BUILD_ROOT/etc/hotplug/usb/ni_usb_gpib | |
2ee896be JB |
283 | |
284 | # obsoleted by pkg-config | |
285 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib.la | |
286 | ||
91dbb874 JB |
287 | %if %{with guile} |
288 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.la | |
289 | %if %{with static_libs} | |
290 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.a | |
291 | %endif | |
292 | %endif | |
293 | ||
2ee896be JB |
294 | %if %{with perl} |
295 | %{__make} -C language/perl pure_install \ | |
296 | DESTDIR=$RPM_BUILD_ROOT | |
297 | cp -pr language/perl/examples $RPM_BUILD_ROOT%{_examplesdir}/perl-gpib-%{version} | |
298 | %{__rm} -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/LinuxGpib/.packlist | |
299 | %endif | |
300 | ||
301 | %if %{with python} | |
302 | %py_postclean | |
303 | %endif | |
304 | ||
305 | %if %{with tcl} | |
306 | cp -pr language/tcl/examples $RPM_BUILD_ROOT%{_examplesdir}/tcl-gpib-%{version} | |
307 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.la | |
308 | %if %{with static_libs} | |
309 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.a | |
310 | %endif | |
311 | %endif | |
312 | ||
313 | %if %{with docs} | |
314 | # packaged as %doc | |
315 | %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/linux-gpib/html | |
316 | %endif | |
d4054fe9 | 317 | %endif |
318 | ||
d4054fe9 | 319 | %clean |
320 | rm -rf $RPM_BUILD_ROOT | |
321 | ||
2ee896be JB |
322 | %post libs -p /sbin/ldconfig |
323 | %postun libs -p /sbin/ldconfig | |
d4054fe9 | 324 | |
91dbb874 JB |
325 | %post -n guile-gpib -p /sbin/ldconfig |
326 | %postun -n guile-gpib -p /sbin/ldconfig | |
327 | ||
328 | %post -n tcl-gpib -p /sbin/ldconfig | |
329 | %postun -n tcl-gpib -p /sbin/ldconfig | |
330 | ||
2ee896be JB |
331 | %if %{with userspace} |
332 | %files | |
333 | %defattr(644,root,root,755) | |
334 | %attr(755,root,root) %{_bindir}/ibterm | |
335 | %attr(755,root,root) %{_bindir}/ibtest | |
336 | %attr(755,root,root) %{_sbindir}/gpib_config | |
08f3bc97 JB |
337 | /lib/udev/rules.d/99-agilent_82357a.rules |
338 | /lib/udev/rules.d/99-gpib-generic.rules | |
339 | /lib/udev/rules.d/99-ni_usb_gpib.rules | |
340 | %attr(755,root,root) /lib/udev/agilent_82357a | |
341 | %attr(755,root,root) /lib/udev/ni_usb_gpib | |
342 | %dir /lib/firmware/agilent_82357a | |
343 | # TODO: | |
344 | #/lib/firmware/agilent_82357a/82357a_fw.hex | |
345 | #/lib/firmware/agilent_82357a/measat_releaseX1.8.hex | |
346 | %dir /lib/firmware/ni_usb_gpib | |
347 | # TODO: | |
348 | #/lib/firmware/ni_usb_gpib/niusbb_firmware.hex | |
349 | #/lib/firmware/ni_usb_gpib/niusbb_loader.hex | |
350 | ||
351 | %if %{with hotplug} | |
352 | %files hotplug | |
353 | %defattr(644,root,root,755) | |
2ee896be JB |
354 | %attr(755,root,root) /etc/hotplug/usb/agilent_82357a |
355 | %attr(755,root,root) /etc/hotplug/usb/ni_usb_gpib | |
356 | /etc/hotplug/usb/agilent_82357a.usermap | |
357 | /etc/hotplug/usb/ni_usb_gpib.usermap | |
08f3bc97 | 358 | %endif |
d4054fe9 | 359 | |
2ee896be | 360 | %files libs |
0e4898e2 | 361 | %defattr(644,root,root,755) |
2ee896be JB |
362 | %doc AUTHORS ChangeLog README README.HAMEG README.hp82335 TODO |
363 | %attr(755,root,root) %{_libdir}/libgpib.so.*.*.* | |
364 | %attr(755,root,root) %ghost %{_libdir}/libgpib.so.0 | |
365 | ||
366 | %files devel | |
367 | %defattr(644,root,root,755) | |
368 | %attr(755,root,root) %{_libdir}/libgpib.so | |
369 | %{_includedir}/gpib | |
370 | %{_pkgconfigdir}/libgpib.pc | |
371 | ||
372 | %if %{with static_libs} | |
373 | %files static | |
374 | %defattr(644,root,root,755) | |
375 | %{_libdir}/libgpib.a | |
376 | %endif | |
377 | ||
91dbb874 JB |
378 | %if %{with guile} |
379 | %files -n guile-gpib | |
380 | %defattr(644,root,root,755) | |
381 | %attr(755,root,root) %{_libdir}/libgpib-guile-%{version}.so | |
382 | %attr(755,root,root) %{_libdir}/libgpib-guile.so | |
383 | %endif | |
384 | ||
2ee896be JB |
385 | %if %{with perl} |
386 | %files -n perl-gpib | |
387 | %defattr(644,root,root,755) | |
388 | %doc language/perl/{Changes,README} | |
389 | %{perl_vendorarch}/LinuxGpib.pm | |
390 | %dir %{perl_vendorarch}/auto/LinuxGpib | |
391 | %attr(755,root,root) %{perl_vendorarch}/auto/LinuxGpib/LinuxGpib.so | |
392 | %{perl_vendorarch}/auto/LinuxGpib/autosplit.ix | |
393 | %{_mandir}/man3/LinuxGpib.3pm* | |
394 | %{_examplesdir}/perl-gpib-%{version} | |
395 | %endif | |
396 | ||
397 | %if %{with python} | |
398 | %files -n python-gpib | |
399 | %defattr(644,root,root,755) | |
400 | %doc language/python/README | |
401 | %attr(755,root,root) %{py_sitedir}/gpib.so | |
402 | %{py_sitedir}/Gpib.py[co] | |
403 | %{py_sitedir}/gpib-1.0-py*.egg-info | |
404 | %endif | |
405 | ||
406 | %if %{with tcl} | |
407 | %files -n tcl-gpib | |
408 | %defattr(644,root,root,755) | |
409 | %doc language/tcl/README | |
410 | %attr(755,root,root) %{_libdir}/libgpib_tcl-%{version}.so | |
411 | %attr(755,root,root) %{_libdir}/libgpib_tcl.so | |
412 | %{_examplesdir}/tcl-gpib-%{version} | |
413 | %endif | |
414 | ||
415 | %if %{with docs} | |
416 | %files doc | |
417 | %defattr(644,root,root,755) | |
418 | %doc doc/doc_html/* | |
419 | %endif | |
1fc85825 | 420 | %endif |