2 # - where to get firmware from?
5 %bcond_without kernel # kernel modules
6 %bcond_without drivers_isa # ISA kernel drivers [ix86 only]
7 %bcond_without drivers_pcmcia # PCMCIA support in kernel drivers
8 %bcond_without drivers_usb # USB kernel drivers
9 %bcond_without userspace # userspace packages
10 %bcond_without verbose # verbose modules build (V=1)
12 %bcond_without docs # documentation build
13 %bcond_with hotplug # legacy hotplug support
14 %bcond_without static_libs # static library
15 %bcond_without guile # guile binding
16 %bcond_without perl # Perl binding
17 %bcond_without php # PHP binding
18 %bcond_without python # Python binding
19 %bcond_without tcl # Tcl binding
22 %undefine with_drivers_isa
23 %undefine with_drivers_pcmcia
25 %include /usr/lib/rpm/macros.perl
26 %define php_name php%{?php_suffix}
27 Summary: GPIB (IEEE 488) Linux support
28 Summary(pl.UTF-8): Obsługa GPIB (IEEE 488) dla Linuksa
34 Group: Applications/System
35 Source0: http://downloads.sourceforge.net/linux-gpib/%{name}-%{version}.tar.gz
36 # Source0-md5: 2d97191e538a57ba7350fcc011ee2596
37 Patch0: %{name}-include_file.patch
38 Patch1: %{name}-destdir.patch
39 Patch2: %{name}-python.patch
40 Patch3: %{name}-perl.patch
41 Patch4: %{name}-firmwaredir.patch
42 Patch5: %{name}-guile2.patch
43 Patch6: %{name}-php7.patch
44 URL: http://linux-gpib.sourceforge.net/
45 BuildRequires: autoconf >= 2.50
46 BuildRequires: automake
47 BuildRequires: libtool
48 BuildRequires: rpmbuild(macros) >= 1.614
50 BuildRequires: kernel-module-build >= 3:2.6.8
54 %{?with_docs:BuildRequires: docbook-utils}
56 %{?with_guile:BuildRequires: guile-devel >= 1.4}
57 %{?with_perl:BuildRequires: perl-devel}
58 %{?with_php:BuildRequires: %{php_name}-devel >= 3:5}
59 %{?with_python:BuildRequires: python-devel >= 2}
60 BuildRequires: readline-devel
61 %{?with_tcl:BuildRequires: tcl-devel}
63 Requires: %{name}-libs = %{version}-%{release}
64 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67 The Linux GPIB package provides support for GPIB (IEEE 488) hardware.
69 %description -l pl.UTF-8
70 Pakiet Linux GPIB służy do obsługi sprzętu GPIB (IEEE 488).
73 Summary: Linux GPIB support for legacy USB hotplug
74 Summary(pl.UTF-8): Obsługa Linux GPIB dla starego systemu hotplug USB
75 Group: Applications/System
76 Requires: %{name} = %{version}-%{release}
80 Linux GPIB support for legacy USB hotplug.
82 %description hotplug -l pl.UTF-8
83 Obsługa Linux GPIB dla starego systemu hotplug USB.
86 Summary: Shared GPIB library
87 Summary(pl.UTF-8): Biblioteka współdzielona GPIB
93 %description libs -l pl.UTF-8
94 Biblioteka współdzielona GPIB.
97 Summary: Header file for GPIB library
98 Summary(pl.UTF-8): Plik nagłówkowy biblioteki GPIB
99 Group: Development/Libraries
100 Requires: %{name}-libs = %{version}-%{release}
103 Header file for GPIB library.
105 %description devel -l pl.UTF-8
106 Plik nagłówkowy biblioteki GPIB.
109 Summary: Static GPIB library
110 Summary(pl.UTF-8): Biblioteka statyczna GPIB
111 Group: Development/Libraries
112 Requires: %{name}-devel = %{version}-%{release}
117 %description static -l pl.UTF-8
118 Biblioteka statyczna GPIB.
120 %package -n guile-gpib
121 Summary: Guile bindings for GPIB library
122 Summary(pl.UTF-8): Wiązania Guile do biblioteki GPIB
123 Group: Development/Languages/Perl
124 Requires: %{name}-libs = %{version}-%{release}
127 %description -n guile-gpib
128 Guile bindings for GPIB library.
130 %description -n guile-gpib -l pl.UTF-8
131 Wiązania Guile do biblioteki GPIB.
133 %package -n perl-gpib
134 Summary: Perl bindings for GPIB library
135 Summary(pl.UTF-8): Wiązania Perla do biblioteki GPIB
136 Group: Development/Languages/Perl
137 Requires: %{name}-libs = %{version}-%{release}
139 %description -n perl-gpib
140 Perl bindings for GPIB library.
142 %description -n perl-gpib -l pl.UTF-8
143 Wiązania Perla do biblioteki GPIB.
145 %package -n %{php_name}-gpib
146 Summary: PHP bindings for GPIB library
147 Summary(pl.UTF-8): Wiązania PHP do biblioteki GPIB
148 Group: Development/Languages/PHP
149 Provides: php(gpib) = %{version}
150 Requires: %{name}-libs = %{version}-%{release}
151 %{?requires_php_extension}
153 %description -n %{php_name}-gpib
154 PHP bindings for GPIB library.
156 %description -n %{php_name}-gpib -l pl.UTF-8
157 Wiązania PHP do biblioteki GPIB.
159 %package -n python-gpib
160 Summary: Python bindings for GPIB library
161 Summary(pl.UTF-8): Wiązania Pythona do biblioteki GPIB
162 Group: Libraries/Python
163 Requires: %{name}-libs = %{version}-%{release}
164 Requires: python-libs
166 %description -n python-gpib
167 Python bindings for GPIB library.
169 %description -n python-gpib -l pl.UTF-8
170 Wiązania Pythona do biblioteki GPIB.
173 Summary: Tcl bindings for GPIB library
174 Summary(pl.UTF-8): Wiązania Tcl-a do biblioteki GPIB
176 Requires: %{name}-libs = %{version}-%{release}
179 %description -n tcl-gpib
180 Tcl bindings for GPIB library.
182 %description -n tcl-gpib -l pl.UTF-8
183 Wiązania Tcl-a do biblioteki GPIB.
186 Summary: Linux-GPIB tools and library documentation
187 Summary(pl.UTF-8): Dokumentacja narzędzi i biblioteki Linux-GPIB
188 License: GFDL v1.2+ or GPL v2+
192 Linux-GPIB tools and library documentation.
194 %description doc -l pl.UTF-8
195 Dokumentacja narzędzi i biblioteki Linux-GPIB.
197 %define kernel_pkg()\
198 %package -n kernel%{_alt_kernel}-gpib\
199 Summary: Linux GPIB drivers\
200 Summary(pl.UTF-8): Sterowniki GPIB dla Linuksa\
201 Release: %{rel}@%{_kernel_ver_str}\
203 Requires(post,postun): /sbin/depmod\
204 %requires_releq_kernel\
205 Requires(postun): %releq_kernel\
207 %description -n kernel%{_alt_kernel}-gpib\
208 This package contains Linux drivers for GPIB (IEEE 488) hardware.\
210 %description -n kernel%{_alt_kernel}-gpib -l pl.UTF-8\
211 Ten pakiet zawiera sterowniki dla Linuksa do urządzeń GPIB (IEEE 488).\
214 %files -n kernel%{_alt_kernel}-gpib\
215 %defattr(644,root,root,755)\
216 /lib/modules/%{_kernel_ver}/kernel/gpib\
219 %post -n kernel%{_alt_kernel}-gpib\
220 %depmod %{_kernel_ver}\
222 %postun -n kernel%{_alt_kernel}-gpib\
223 %depmod %{_kernel_ver}\
226 %define build_kernel_pkg()\
228 %build_kernel_modules -C drivers/gpib -m gpib -- EARLYCPPFLAGS="-I$TOPDIR -I$TOPDIR/drivers/gpib/include -I$TOPDIR/include"\
230 %install_kernel_modules -D installed -m agilent_82350b/agilent_82350b,cb7210/cb7210,cec/cec_gpib,hp_82335/hp82335,hp_82341/hp_82341,ines/ines_gpib,nec7210/nec7210,sys/gpib_common,tms9914/tms9914,tnt4882/tnt4882%{?with_drivers_isa:,pc2/pc2_gpib}%{?with_drivers_usb:,agilent_82357a/agilent_82357a,lpvo_usb_gpib/lpvo_usb_gpib,ni_usb/ni_usb_gpib} -d kernel/gpib\
233 %define install_kernel_pkg()\
236 %{?with_kernel:%{expand:%create_kernel_packages}}
248 # disable modules build by default, just install userspace header
249 echo 'SUBDIRS = gpib/include' > drivers/Makefile.am
251 # need to inject -I options before $(LINUXINCLUDE), the simplest way is to override CC
252 for f in drivers/gpib/*/Makefile ; do
253 echo 'override CC += $(EARLYCPPFLAGS)' >> $f
263 CPPFLAGS="%{rpmcppflags} -I/usr/include/guile/2.0"
266 %{?with_drivers_isa:--enable-isa} \
267 %{?with_drivers_pcmcia:--enable-pcmcia} \
268 %{!?with_docs:--disable-documentation} \
269 %{!?with_guile:--disable-guile-binding} \
270 %{!?with_perl:--disable-perl-binding} \
271 %{!?with_php:--disable-php-binding} \
272 %{!?with_python:--disable-python-binding} \
273 %{?with_static_libs:--enable-static} \
274 %{!?with_tcl:--disable-tcl-binding} \
275 --with-linux-srcdir=%{_kernelsrcdir}
277 %if %{with userspace}
282 %{expand:%build_kernel_packages}
286 rm -rf $RPM_BUILD_ROOT
287 install -d $RPM_BUILD_ROOT%{_examplesdir}
290 %{expand:%install_kernel_packages}
291 cp -a drivers/gpib/installed/* $RPM_BUILD_ROOT
294 %if %{with userspace}
296 DESTDIR=$RPM_BUILD_ROOT \
297 HOTPLUG_USB_CONF_DIR=/lib/udev \
298 UDEV_RULES_DIR=/lib/udev/rules.d \
299 USB_FIRMWARE_DIR=/lib/firmware
302 # use udev paths as base and legacy hotplug as addon (not the opposite)
303 install -d $RPM_BUILD_ROOT/etc/hotplug/usb
304 %{__mv} $RPM_BUILD_ROOT/lib/udev/*.usermap $RPM_BUILD_ROOT/etc/hotplug/usb
305 ln -snf /lib/udev/agilent_82357a $RPM_BUILD_ROOT/etc/hotplug/usb/agilent_82357a
306 ln -snf /lib/udev/ni_usb_gpib $RPM_BUILD_ROOT/etc/hotplug/usb/ni_usb_gpib
308 %{__rm} $RPM_BUILD_ROOT/lib/udev/*.usermap
311 # obsoleted by pkg-config
312 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib.la
315 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.la
316 %if %{with static_libs}
317 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.a
322 %{__make} -C language/perl pure_install \
323 DESTDIR=$RPM_BUILD_ROOT
325 cp -pr language/perl/examples $RPM_BUILD_ROOT%{_examplesdir}/perl-gpib-%{version}
327 %{__rm} -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/LinuxGpib/.packlist
331 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
332 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/gpib.ini
333 ; Enable gpib extension module
334 extension=gpib_php.so
337 %{__rm} $RPM_BUILD_ROOT%{php_extensiondir}/gpib_php.la
338 %if %{with static_libs}
339 %{__rm} $RPM_BUILD_ROOT%{php_extensiondir}/gpib_php.a
348 cp -pr language/tcl/examples $RPM_BUILD_ROOT%{_examplesdir}/tcl-gpib-%{version}
350 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.la
351 %if %{with static_libs}
352 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.a
358 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/linux-gpib/html
363 rm -rf $RPM_BUILD_ROOT
365 %post libs -p /sbin/ldconfig
366 %postun libs -p /sbin/ldconfig
368 %post -n guile-gpib -p /sbin/ldconfig
369 %postun -n guile-gpib -p /sbin/ldconfig
371 %post -n tcl-gpib -p /sbin/ldconfig
372 %postun -n tcl-gpib -p /sbin/ldconfig
374 %post -n %{php_name}-gpib
375 %php_webserver_restart
377 %postun -n %{php_name}-gpib
378 if [ "$1" = 0 ]; then
379 %php_webserver_restart
382 %if %{with userspace}
384 %defattr(644,root,root,755)
385 %attr(755,root,root) %{_bindir}/ibterm
386 %attr(755,root,root) %{_bindir}/ibtest
387 %attr(755,root,root) %{_sbindir}/gpib_config
388 /lib/udev/rules.d/99-agilent_82357a.rules
389 /lib/udev/rules.d/99-gpib-generic.rules
390 /lib/udev/rules.d/99-ni_usb_gpib.rules
391 %attr(755,root,root) /lib/udev/agilent_82357a
392 %attr(755,root,root) /lib/udev/ni_usb_gpib
393 %dir /lib/firmware/agilent_82357a
395 #/lib/firmware/agilent_82357a/82357a_fw.hex
396 #/lib/firmware/agilent_82357a/measat_releaseX1.8.hex
397 %dir /lib/firmware/ni_usb_gpib
399 #/lib/firmware/ni_usb_gpib/niusbb_firmware.hex
400 #/lib/firmware/ni_usb_gpib/niusbb_loader.hex
404 %defattr(644,root,root,755)
405 %attr(755,root,root) /etc/hotplug/usb/agilent_82357a
406 %attr(755,root,root) /etc/hotplug/usb/ni_usb_gpib
407 /etc/hotplug/usb/agilent_82357a.usermap
408 /etc/hotplug/usb/ni_usb_gpib.usermap
412 %defattr(644,root,root,755)
413 %doc AUTHORS ChangeLog README README.HAMEG README.hp82335 TODO
414 %attr(755,root,root) %{_libdir}/libgpib.so.*.*.*
415 %attr(755,root,root) %ghost %{_libdir}/libgpib.so.0
418 %defattr(644,root,root,755)
419 %attr(755,root,root) %{_libdir}/libgpib.so
421 %{_pkgconfigdir}/libgpib.pc
423 %if %{with static_libs}
425 %defattr(644,root,root,755)
431 %defattr(644,root,root,755)
432 %attr(755,root,root) %{_libdir}/libgpib-guile-%{version}.so
433 %attr(755,root,root) %{_libdir}/libgpib-guile.so
438 %defattr(644,root,root,755)
439 %doc language/perl/{Changes,README}
440 %{perl_vendorarch}/LinuxGpib.pm
441 %dir %{perl_vendorarch}/auto/LinuxGpib
442 %attr(755,root,root) %{perl_vendorarch}/auto/LinuxGpib/LinuxGpib.so
443 %{perl_vendorarch}/auto/LinuxGpib/autosplit.ix
444 %{_mandir}/man3/LinuxGpib.3pm*
445 %{_examplesdir}/perl-gpib-%{version}
449 %files -n %{php_name}-gpib
450 %defattr(644,root,root,755)
451 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/gpib.ini
452 %attr(755,root,root) %{php_extensiondir}/gpib_php-%{version}.so
453 %attr(755,root,root) %{php_extensiondir}/gpib_php.so
457 %files -n python-gpib
458 %defattr(644,root,root,755)
459 %doc language/python/README
460 %attr(755,root,root) %{py_sitedir}/gpib.so
461 %{py_sitedir}/Gpib.py[co]
462 %{py_sitedir}/gpib-1.0-py*.egg-info
467 %defattr(644,root,root,755)
468 %doc language/tcl/README
469 %attr(755,root,root) %{_libdir}/libgpib_tcl-%{version}.so
470 %attr(755,root,root) %{_libdir}/libgpib_tcl.so
471 %{_examplesdir}/tcl-gpib-%{version}
476 %defattr(644,root,root,755)