3 %bcond_without kernel # kernel modules
4 %bcond_without drivers_isa # ISA kernel drivers [ix86 only]
5 %bcond_without drivers_pcmcia # PCMCIA support in kernel drivers
6 %bcond_without drivers_usb # USB kernel drivers
7 %bcond_without userspace # userspace packages
8 %bcond_without verbose # verbose modules build (V=1)
10 %bcond_without docs # documentation build
11 %bcond_with hotplug # legacy hotplug support
12 %bcond_without static_libs # static library
13 %bcond_without guile # guile binding
14 %bcond_without perl # Perl binding
15 %bcond_without php # PHP binding
16 %bcond_without python # Python binding
17 %bcond_without tcl # Tcl binding
20 %undefine with_drivers_isa
21 %undefine with_drivers_pcmcia
23 %include /usr/lib/rpm/macros.perl
24 %define php_name php%{?php_suffix}
25 Summary: GPIB (IEEE 488) Linux support
26 Summary(pl.UTF-8): Obsługa GPIB (IEEE 488) dla Linuksa
32 Group: Applications/System
33 Source0: http://downloads.sourceforge.net/linux-gpib/%{name}-%{version}.tar.gz
34 # Source0-md5: 2d97191e538a57ba7350fcc011ee2596
35 Patch0: %{name}-include_file.patch
36 Patch1: %{name}-destdir.patch
37 Patch2: %{name}-python.patch
38 Patch3: %{name}-perl.patch
39 Patch4: %{name}-firmwaredir.patch
40 Patch5: %{name}-guile2.patch
41 Patch6: %{name}-php7.patch
42 URL: http://linux-gpib.sourceforge.net/
43 BuildRequires: autoconf >= 2.50
44 BuildRequires: automake
45 BuildRequires: libtool
46 BuildRequires: rpmbuild(macros) >= 1.614
48 BuildRequires: kernel-module-build >= 3:2.6.8
52 %{?with_docs:BuildRequires: docbook-utils}
54 %{?with_guile:BuildRequires: guile-devel >= 1.4}
55 %{?with_perl:BuildRequires: perl-devel}
56 %{?with_php:BuildRequires: %{php_name}-devel >= 3:5}
57 %{?with_python:BuildRequires: python-devel >= 2}
58 BuildRequires: readline-devel
59 %{?with_tcl:BuildRequires: tcl-devel}
61 Requires: %{name}-libs = %{version}-%{release}
62 # for agilent_82357a and ni_usb_gpib
64 # for agilent_82357a, agilent/hp_82341, agilent/hp_82350a, ni_usb_gpib
65 Suggests: linux-gpib-firmware
66 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
69 The Linux GPIB package provides support for GPIB (IEEE 488) hardware.
71 %description -l pl.UTF-8
72 Pakiet Linux GPIB służy do obsługi sprzętu GPIB (IEEE 488).
75 Summary: Linux GPIB support for legacy USB hotplug
76 Summary(pl.UTF-8): Obsługa Linux GPIB dla starego systemu hotplug USB
77 Group: Applications/System
78 Requires: %{name} = %{version}-%{release}
82 Linux GPIB support for legacy USB hotplug.
84 %description hotplug -l pl.UTF-8
85 Obsługa Linux GPIB dla starego systemu hotplug USB.
88 Summary: Shared GPIB library
89 Summary(pl.UTF-8): Biblioteka współdzielona GPIB
95 %description libs -l pl.UTF-8
96 Biblioteka współdzielona GPIB.
99 Summary: Header file for GPIB library
100 Summary(pl.UTF-8): Plik nagłówkowy biblioteki GPIB
101 Group: Development/Libraries
102 Requires: %{name}-libs = %{version}-%{release}
105 Header file for GPIB library.
107 %description devel -l pl.UTF-8
108 Plik nagłówkowy biblioteki GPIB.
111 Summary: Static GPIB library
112 Summary(pl.UTF-8): Biblioteka statyczna GPIB
113 Group: Development/Libraries
114 Requires: %{name}-devel = %{version}-%{release}
119 %description static -l pl.UTF-8
120 Biblioteka statyczna GPIB.
122 %package -n guile-gpib
123 Summary: Guile bindings for GPIB library
124 Summary(pl.UTF-8): Wiązania Guile do biblioteki GPIB
125 Group: Development/Languages/Perl
126 Requires: %{name}-libs = %{version}-%{release}
129 %description -n guile-gpib
130 Guile bindings for GPIB library.
132 %description -n guile-gpib -l pl.UTF-8
133 Wiązania Guile do biblioteki GPIB.
135 %package -n perl-gpib
136 Summary: Perl bindings for GPIB library
137 Summary(pl.UTF-8): Wiązania Perla do biblioteki GPIB
138 Group: Development/Languages/Perl
139 Requires: %{name}-libs = %{version}-%{release}
141 %description -n perl-gpib
142 Perl bindings for GPIB library.
144 %description -n perl-gpib -l pl.UTF-8
145 Wiązania Perla do biblioteki GPIB.
147 %package -n %{php_name}-gpib
148 Summary: PHP bindings for GPIB library
149 Summary(pl.UTF-8): Wiązania PHP do biblioteki GPIB
150 Group: Development/Languages/PHP
151 Provides: php(gpib) = %{version}
152 Requires: %{name}-libs = %{version}-%{release}
153 %{?requires_php_extension}
155 %description -n %{php_name}-gpib
156 PHP bindings for GPIB library.
158 %description -n %{php_name}-gpib -l pl.UTF-8
159 Wiązania PHP do biblioteki GPIB.
161 %package -n python-gpib
162 Summary: Python bindings for GPIB library
163 Summary(pl.UTF-8): Wiązania Pythona do biblioteki GPIB
164 Group: Libraries/Python
165 Requires: %{name}-libs = %{version}-%{release}
166 Requires: python-libs
168 %description -n python-gpib
169 Python bindings for GPIB library.
171 %description -n python-gpib -l pl.UTF-8
172 Wiązania Pythona do biblioteki GPIB.
175 Summary: Tcl bindings for GPIB library
176 Summary(pl.UTF-8): Wiązania Tcl-a do biblioteki GPIB
178 Requires: %{name}-libs = %{version}-%{release}
181 %description -n tcl-gpib
182 Tcl bindings for GPIB library.
184 %description -n tcl-gpib -l pl.UTF-8
185 Wiązania Tcl-a do biblioteki GPIB.
188 Summary: Linux-GPIB tools and library documentation
189 Summary(pl.UTF-8): Dokumentacja narzędzi i biblioteki Linux-GPIB
190 License: GFDL v1.2+ or GPL v2+
194 Linux-GPIB tools and library documentation.
196 %description doc -l pl.UTF-8
197 Dokumentacja narzędzi i biblioteki Linux-GPIB.
199 %define kernel_pkg()\
200 %package -n kernel%{_alt_kernel}-gpib\
201 Summary: Linux GPIB drivers\
202 Summary(pl.UTF-8): Sterowniki GPIB dla Linuksa\
203 Release: %{rel}@%{_kernel_ver_str}\
205 Requires(post,postun): /sbin/depmod\
206 %requires_releq_kernel\
207 Requires(postun): %releq_kernel\
209 %description -n kernel%{_alt_kernel}-gpib\
210 This package contains Linux drivers for GPIB (IEEE 488) hardware.\
212 %description -n kernel%{_alt_kernel}-gpib -l pl.UTF-8\
213 Ten pakiet zawiera sterowniki dla Linuksa do urządzeń GPIB (IEEE 488).\
216 %files -n kernel%{_alt_kernel}-gpib\
217 %defattr(644,root,root,755)\
218 /lib/modules/%{_kernel_ver}/kernel/gpib\
221 %post -n kernel%{_alt_kernel}-gpib\
222 %depmod %{_kernel_ver}\
224 %postun -n kernel%{_alt_kernel}-gpib\
225 %depmod %{_kernel_ver}\
228 %define build_kernel_pkg()\
230 %build_kernel_modules -C drivers/gpib -m gpib -- EARLYCPPFLAGS="-I$TOPDIR -I$TOPDIR/drivers/gpib/include -I$TOPDIR/include"\
232 %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\
235 %define install_kernel_pkg()\
238 %{?with_kernel:%{expand:%create_kernel_packages}}
250 # disable modules build by default, just install userspace header
251 echo 'SUBDIRS = gpib/include' > drivers/Makefile.am
253 # need to inject -I options before $(LINUXINCLUDE), the simplest way is to override CC
254 for f in drivers/gpib/*/Makefile ; do
255 echo 'override CC += $(EARLYCPPFLAGS)' >> $f
265 CPPFLAGS="%{rpmcppflags} -I/usr/include/guile/2.0"
268 %{?with_drivers_isa:--enable-isa} \
269 %{?with_drivers_pcmcia:--enable-pcmcia} \
270 %{!?with_docs:--disable-documentation} \
271 %{!?with_guile:--disable-guile-binding} \
272 %{!?with_perl:--disable-perl-binding} \
273 %{!?with_php:--disable-php-binding} \
274 %{!?with_python:--disable-python-binding} \
275 %{?with_static_libs:--enable-static} \
276 %{!?with_tcl:--disable-tcl-binding} \
277 --with-linux-srcdir=%{_kernelsrcdir}
279 %if %{with userspace}
284 %{expand:%build_kernel_packages}
288 rm -rf $RPM_BUILD_ROOT
289 install -d $RPM_BUILD_ROOT%{_examplesdir}
292 %{expand:%install_kernel_packages}
293 cp -a drivers/gpib/installed/* $RPM_BUILD_ROOT
296 %if %{with userspace}
298 DESTDIR=$RPM_BUILD_ROOT \
299 HOTPLUG_USB_CONF_DIR=/lib/udev \
300 UDEV_RULES_DIR=/lib/udev/rules.d \
301 USB_FIRMWARE_DIR=/lib/firmware
304 # use udev paths as base and legacy hotplug as addon (not the opposite)
305 install -d $RPM_BUILD_ROOT/etc/hotplug/usb
306 %{__mv} $RPM_BUILD_ROOT/lib/udev/*.usermap $RPM_BUILD_ROOT/etc/hotplug/usb
307 ln -snf /lib/udev/agilent_82357a $RPM_BUILD_ROOT/etc/hotplug/usb/agilent_82357a
308 ln -snf /lib/udev/ni_usb_gpib $RPM_BUILD_ROOT/etc/hotplug/usb/ni_usb_gpib
310 %{__rm} $RPM_BUILD_ROOT/lib/udev/*.usermap
313 # obsoleted by pkg-config
314 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib.la
317 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.la
318 %if %{with static_libs}
319 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.a
324 %{__make} -C language/perl pure_install \
325 DESTDIR=$RPM_BUILD_ROOT
327 cp -pr language/perl/examples $RPM_BUILD_ROOT%{_examplesdir}/perl-gpib-%{version}
329 %{__rm} -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/LinuxGpib/.packlist
333 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
334 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/gpib.ini
335 ; Enable gpib extension module
336 extension=gpib_php.so
339 %{__rm} $RPM_BUILD_ROOT%{php_extensiondir}/gpib_php.la
340 %if %{with static_libs}
341 %{__rm} $RPM_BUILD_ROOT%{php_extensiondir}/gpib_php.a
350 cp -pr language/tcl/examples $RPM_BUILD_ROOT%{_examplesdir}/tcl-gpib-%{version}
352 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.la
353 %if %{with static_libs}
354 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.a
360 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/linux-gpib/html
365 rm -rf $RPM_BUILD_ROOT
367 %post libs -p /sbin/ldconfig
368 %postun libs -p /sbin/ldconfig
370 %post -n guile-gpib -p /sbin/ldconfig
371 %postun -n guile-gpib -p /sbin/ldconfig
373 %post -n tcl-gpib -p /sbin/ldconfig
374 %postun -n tcl-gpib -p /sbin/ldconfig
376 %post -n %{php_name}-gpib
377 %php_webserver_restart
379 %postun -n %{php_name}-gpib
380 if [ "$1" = 0 ]; then
381 %php_webserver_restart
384 %if %{with userspace}
386 %defattr(644,root,root,755)
387 %attr(755,root,root) %{_bindir}/ibterm
388 %attr(755,root,root) %{_bindir}/ibtest
389 %attr(755,root,root) %{_sbindir}/gpib_config
390 /lib/udev/rules.d/99-agilent_82357a.rules
391 /lib/udev/rules.d/99-gpib-generic.rules
392 /lib/udev/rules.d/99-ni_usb_gpib.rules
393 %attr(755,root,root) /lib/udev/agilent_82357a
394 %attr(755,root,root) /lib/udev/ni_usb_gpib
398 %defattr(644,root,root,755)
399 %attr(755,root,root) /etc/hotplug/usb/agilent_82357a
400 %attr(755,root,root) /etc/hotplug/usb/ni_usb_gpib
401 /etc/hotplug/usb/agilent_82357a.usermap
402 /etc/hotplug/usb/ni_usb_gpib.usermap
406 %defattr(644,root,root,755)
407 %doc AUTHORS ChangeLog README README.HAMEG README.hp82335 TODO
408 %attr(755,root,root) %{_libdir}/libgpib.so.*.*.*
409 %attr(755,root,root) %ghost %{_libdir}/libgpib.so.0
412 %defattr(644,root,root,755)
413 %attr(755,root,root) %{_libdir}/libgpib.so
415 %{_pkgconfigdir}/libgpib.pc
417 %if %{with static_libs}
419 %defattr(644,root,root,755)
425 %defattr(644,root,root,755)
426 %attr(755,root,root) %{_libdir}/libgpib-guile-%{version}.so
427 %attr(755,root,root) %{_libdir}/libgpib-guile.so
432 %defattr(644,root,root,755)
433 %doc language/perl/{Changes,README}
434 %{perl_vendorarch}/LinuxGpib.pm
435 %dir %{perl_vendorarch}/auto/LinuxGpib
436 %attr(755,root,root) %{perl_vendorarch}/auto/LinuxGpib/LinuxGpib.so
437 %{perl_vendorarch}/auto/LinuxGpib/autosplit.ix
438 %{_mandir}/man3/LinuxGpib.3pm*
439 %{_examplesdir}/perl-gpib-%{version}
443 %files -n %{php_name}-gpib
444 %defattr(644,root,root,755)
445 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/gpib.ini
446 %attr(755,root,root) %{php_extensiondir}/gpib_php-%{version}.so
447 %attr(755,root,root) %{php_extensiondir}/gpib_php.so
451 %files -n python-gpib
452 %defattr(644,root,root,755)
453 %doc language/python/README
454 %attr(755,root,root) %{py_sitedir}/gpib.so
455 %{py_sitedir}/Gpib.py[co]
456 %{py_sitedir}/gpib-1.0-py*.egg-info
461 %defattr(644,root,root,755)
462 %doc language/tcl/README
463 %attr(755,root,root) %{_libdir}/libgpib_tcl-%{version}.so
464 %attr(755,root,root) %{_libdir}/libgpib_tcl.so
465 %{_examplesdir}/tcl-gpib-%{version}
470 %defattr(644,root,root,755)