2 # - where to get firmware from?
5 %bcond_without kernel # kernel modules
6 %bcond_without userspace # userspace packages
7 %bcond_without verbose # verbose modules build (V=1)
9 %bcond_without docs # documentation build
10 %bcond_with hotplug # legacy hotplug support
11 %bcond_without static_libs # static library
12 %bcond_without guile # guile binding
13 %bcond_without perl # Perl binding
14 %bcond_without php # PHP binding
15 %bcond_without python # Python binding
16 %bcond_without tcl # Tcl binding
18 %include /usr/lib/rpm/macros.perl
19 %define php_name php%{?php_suffix}
20 Summary: GPIB (IEEE 488) Linux support
21 Summary(pl.UTF-8): Obsługa GPIB (IEEE 488) dla Linuksa
27 Group: Applications/System
28 Source0: http://downloads.sourceforge.net/linux-gpib/%{name}-%{version}.tar.gz
29 # Source0-md5: 2d97191e538a57ba7350fcc011ee2596
30 Patch0: %{name}-include_file.patch
31 Patch1: %{name}-destdir.patch
32 Patch2: %{name}-python.patch
33 Patch3: %{name}-perl.patch
34 Patch4: %{name}-firmwaredir.patch
35 Patch5: %{name}-guile2.patch
36 Patch6: %{name}-php7.patch
37 URL: http://linux-gpib.sourceforge.net/
38 BuildRequires: autoconf >= 2.50
39 BuildRequires: automake
40 BuildRequires: libtool
41 BuildRequires: rpmbuild(macros) >= 1.614
43 BuildRequires: kernel-module-build >= 3:2.6.8
47 %{?with_docs:BuildRequires: docbook-utils}
49 %{?with_guile:BuildRequires: guile-devel >= 1.4}
50 %{?with_perl:BuildRequires: perl-devel}
51 %{?with_php:BuildRequires: %{php_name}-devel >= 3:5}
52 %{?with_python:BuildRequires: python-devel >= 2}
53 BuildRequires: readline-devel
54 %{?with_tcl:BuildRequires: tcl-devel}
56 Requires: %{name}-libs = %{version}-%{release}
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60 The Linux GPIB package provides support for GPIB (IEEE 488) hardware.
62 %description -l pl.UTF-8
63 Pakiet Linux GPIB służy do obsługi sprzętu GPIB (IEEE 488).
66 Summary: Linux GPIB support for legacy USB hotplug
67 Summary(pl.UTF-8): Obsługa Linux GPIB dla starego systemu hotplug USB
68 Group: Applications/System
69 Requires: %{name} = %{version}-%{release}
73 Linux GPIB support for legacy USB hotplug.
75 %description hotplug -l pl.UTF-8
76 Obsługa Linux GPIB dla starego systemu hotplug USB.
79 Summary: Shared GPIB library
80 Summary(pl.UTF-8): Biblioteka współdzielona GPIB
86 %description libs -l pl.UTF-8
87 Biblioteka współdzielona GPIB.
90 Summary: Header file for GPIB library
91 Summary(pl.UTF-8): Plik nagłówkowy biblioteki GPIB
92 Group: Development/Libraries
93 Requires: %{name}-libs = %{version}-%{release}
96 Header file for GPIB library.
98 %description devel -l pl.UTF-8
99 Plik nagłówkowy biblioteki GPIB.
102 Summary: Static GPIB library
103 Summary(pl.UTF-8): Biblioteka statyczna GPIB
104 Group: Development/Libraries
105 Requires: %{name}-devel = %{version}-%{release}
110 %description static -l pl.UTF-8
111 Biblioteka statyczna GPIB.
113 %package -n guile-gpib
114 Summary: Guile bindings for GPIB library
115 Summary(pl.UTF-8): Wiązania Guile do biblioteki GPIB
116 Group: Development/Languages/Perl
117 Requires: %{name}-libs = %{version}-%{release}
120 %description -n guile-gpib
121 Guile bindings for GPIB library.
123 %description -n guile-gpib -l pl.UTF-8
124 Wiązania Guile do biblioteki GPIB.
126 %package -n perl-gpib
127 Summary: Perl bindings for GPIB library
128 Summary(pl.UTF-8): Wiązania Perla do biblioteki GPIB
129 Group: Development/Languages/Perl
130 Requires: %{name}-libs = %{version}-%{release}
132 %description -n perl-gpib
133 Perl bindings for GPIB library.
135 %description -n perl-gpib -l pl.UTF-8
136 Wiązania Perla do biblioteki GPIB.
138 %package -n %{php_name}-gpib
139 Summary: PHP bindings for GPIB library
140 Summary(pl.UTF-8): Wiązania PHP do biblioteki GPIB
141 Group: Development/Languages/PHP
142 Provides: php(gpib) = %{version}
143 Requires: %{name}-libs = %{version}-%{release}
144 %{?requires_php_extension}
146 %description -n %{php_name}-gpib
147 PHP bindings for GPIB library.
149 %description -n %{php_name}-gpib -l pl.UTF-8
150 Wiązania PHP do biblioteki GPIB.
152 %package -n python-gpib
153 Summary: Python bindings for GPIB library
154 Summary(pl.UTF-8): Wiązania Pythona do biblioteki GPIB
155 Group: Libraries/Python
156 Requires: %{name}-libs = %{version}-%{release}
157 Requires: python-libs
159 %description -n python-gpib
160 Python bindings for GPIB library.
162 %description -n python-gpib -l pl.UTF-8
163 Wiązania Pythona do biblioteki GPIB.
166 Summary: Tcl bindings for GPIB library
167 Summary(pl.UTF-8): Wiązania Tcl-a do biblioteki GPIB
169 Requires: %{name}-libs = %{version}-%{release}
172 %description -n tcl-gpib
173 Tcl bindings for GPIB library.
175 %description -n tcl-gpib -l pl.UTF-8
176 Wiązania Tcl-a do biblioteki GPIB.
179 Summary: Linux-GPIB tools and library documentation
180 Summary(pl.UTF-8): Dokumentacja narzędzi i biblioteki Linux-GPIB
181 License: GFDL v1.2+ or GPL v2+
185 Linux-GPIB tools and library documentation.
187 %description doc -l pl.UTF-8
188 Dokumentacja narzędzi i biblioteki Linux-GPIB.
190 %define kernel_pkg()\
191 %package -n kernel%{_alt_kernel}-gpib\
192 Summary: Linux GPIB drivers\
193 Summary(pl.UTF-8): Sterowniki GPIB dla Linuksa\
194 Release: %{rel}@%{_kernel_ver_str}\
196 Requires(post,postun): /sbin/depmod\
197 %requires_releq_kernel\
198 Requires(postun): %releq_kernel\
200 %description -n kernel%{_alt_kernel}-gpib\
201 This package contains Linux drivers for GPIB (IEEE 488) hardware.\
203 %description -n kernel%{_alt_kernel}-gpib -l pl.UTF-8\
204 Ten pakiet zawiera sterowniki dla Linuksa do urządzeń GPIB (IEEE 488).\
207 %files -n kernel%{_alt_kernel}-gpib\
208 %defattr(644,root,root,755)\
209 /lib/modules/%{_kernel_ver}/kernel/gpib\
212 %post -n kernel%{_alt_kernel}-gpib\
213 %depmod %{_kernel_ver}\
215 %postun -n kernel%{_alt_kernel}-gpib\
216 %depmod %{_kernel_ver}\
219 %define build_kernel_pkg()\
221 %build_kernel_modules -C drivers/gpib -m gpib -- EARLYCPPFLAGS="-I$TOPDIR -I$TOPDIR/drivers/gpib/include -I$TOPDIR/include"\
223 %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\
226 %define install_kernel_pkg()\
229 %{?with_kernel:%{expand:%create_kernel_packages}}
241 # disable modules build by default, just install userspace header
242 echo 'SUBDIRS = gpib/include' > drivers/Makefile.am
244 # need to inject -I options before $(LINUXINCLUDE), the simplest way is to override CC
245 for f in drivers/gpib/*/Makefile ; do
246 echo 'override CC += $(EARLYCPPFLAGS)' >> $f
256 CPPFLAGS="%{rpmcppflags} -I/usr/include/guile/2.0"
263 %{!?with_docs:--disable-documentation} \
264 %{!?with_guile:--disable-guile-binding} \
265 %{!?with_perl:--disable-perl-binding} \
266 %{!?with_php:--disable-php-binding} \
267 %{!?with_python:--disable-python-binding} \
268 %{?with_static_libs:--enable-static} \
269 %{!?with_tcl:--disable-tcl-binding} \
270 --with-linux-srcdir=%{_kernelsrcdir}
272 %if %{with userspace}
277 %{expand:%build_kernel_packages}
281 rm -rf $RPM_BUILD_ROOT
282 install -d $RPM_BUILD_ROOT%{_examplesdir}
285 %{expand:%install_kernel_packages}
286 cp -a drivers/gpib/installed/* $RPM_BUILD_ROOT
289 %if %{with userspace}
291 DESTDIR=$RPM_BUILD_ROOT \
292 HOTPLUG_USB_CONF_DIR=/lib/udev \
293 UDEV_RULES_DIR=/lib/udev/rules.d \
294 USB_FIRMWARE_DIR=/lib/firmware
295 # use udev paths as base and legacy hotplug as addon (not the opposite)
296 install -d $RPM_BUILD_ROOT/etc/hotplug/usb
297 %{__mv} $RPM_BUILD_ROOT/lib/udev/*.usermap $RPM_BUILD_ROOT/etc/hotplug/usb
298 ln -snf /lib/udev/agilent_82357a $RPM_BUILD_ROOT/etc/hotplug/usb/agilent_82357a
299 ln -snf /lib/udev/ni_usb_gpib $RPM_BUILD_ROOT/etc/hotplug/usb/ni_usb_gpib
301 # obsoleted by pkg-config
302 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib.la
305 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.la
306 %if %{with static_libs}
307 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.a
312 %{__make} -C language/perl pure_install \
313 DESTDIR=$RPM_BUILD_ROOT
315 cp -pr language/perl/examples $RPM_BUILD_ROOT%{_examplesdir}/perl-gpib-%{version}
317 %{__rm} -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/LinuxGpib/.packlist
321 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
322 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/gpib.ini
323 ; Enable gpib extension module
324 extension=gpib_php.so
327 %{__rm} $RPM_BUILD_ROOT%{php_extensiondir}/gpib_php.la
328 %if %{with static_libs}
329 %{__rm} $RPM_BUILD_ROOT%{php_extensiondir}/gpib_php.a
338 cp -pr language/tcl/examples $RPM_BUILD_ROOT%{_examplesdir}/tcl-gpib-%{version}
340 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.la
341 %if %{with static_libs}
342 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.a
348 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/linux-gpib/html
353 rm -rf $RPM_BUILD_ROOT
355 %post libs -p /sbin/ldconfig
356 %postun libs -p /sbin/ldconfig
358 %post -n guile-gpib -p /sbin/ldconfig
359 %postun -n guile-gpib -p /sbin/ldconfig
361 %post -n tcl-gpib -p /sbin/ldconfig
362 %postun -n tcl-gpib -p /sbin/ldconfig
364 %post -n %{php_name}-gpib
365 %php_webserver_restart
367 %postun -n %{php_name}-gpib
368 if [ "$1" = 0 ]; then
369 %php_webserver_restart
372 %if %{with userspace}
374 %defattr(644,root,root,755)
375 %attr(755,root,root) %{_bindir}/ibterm
376 %attr(755,root,root) %{_bindir}/ibtest
377 %attr(755,root,root) %{_sbindir}/gpib_config
378 /lib/udev/rules.d/99-agilent_82357a.rules
379 /lib/udev/rules.d/99-gpib-generic.rules
380 /lib/udev/rules.d/99-ni_usb_gpib.rules
381 %attr(755,root,root) /lib/udev/agilent_82357a
382 %attr(755,root,root) /lib/udev/ni_usb_gpib
383 %dir /lib/firmware/agilent_82357a
385 #/lib/firmware/agilent_82357a/82357a_fw.hex
386 #/lib/firmware/agilent_82357a/measat_releaseX1.8.hex
387 %dir /lib/firmware/ni_usb_gpib
389 #/lib/firmware/ni_usb_gpib/niusbb_firmware.hex
390 #/lib/firmware/ni_usb_gpib/niusbb_loader.hex
394 %defattr(644,root,root,755)
395 %attr(755,root,root) /etc/hotplug/usb/agilent_82357a
396 %attr(755,root,root) /etc/hotplug/usb/ni_usb_gpib
397 /etc/hotplug/usb/agilent_82357a.usermap
398 /etc/hotplug/usb/ni_usb_gpib.usermap
402 %defattr(644,root,root,755)
403 %doc AUTHORS ChangeLog README README.HAMEG README.hp82335 TODO
404 %attr(755,root,root) %{_libdir}/libgpib.so.*.*.*
405 %attr(755,root,root) %ghost %{_libdir}/libgpib.so.0
408 %defattr(644,root,root,755)
409 %attr(755,root,root) %{_libdir}/libgpib.so
411 %{_pkgconfigdir}/libgpib.pc
413 %if %{with static_libs}
415 %defattr(644,root,root,755)
421 %defattr(644,root,root,755)
422 %attr(755,root,root) %{_libdir}/libgpib-guile-%{version}.so
423 %attr(755,root,root) %{_libdir}/libgpib-guile.so
428 %defattr(644,root,root,755)
429 %doc language/perl/{Changes,README}
430 %{perl_vendorarch}/LinuxGpib.pm
431 %dir %{perl_vendorarch}/auto/LinuxGpib
432 %attr(755,root,root) %{perl_vendorarch}/auto/LinuxGpib/LinuxGpib.so
433 %{perl_vendorarch}/auto/LinuxGpib/autosplit.ix
434 %{_mandir}/man3/LinuxGpib.3pm*
435 %{_examplesdir}/perl-gpib-%{version}
439 %files -n %{php_name}-gpib
440 %defattr(644,root,root,755)
441 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/gpib.ini
442 %attr(755,root,root) %{php_extensiondir}/gpib_php-%{version}.so
443 %attr(755,root,root) %{php_extensiondir}/gpib_php.so
447 %files -n python-gpib
448 %defattr(644,root,root,755)
449 %doc language/python/README
450 %attr(755,root,root) %{py_sitedir}/gpib.so
451 %{py_sitedir}/Gpib.py[co]
452 %{py_sitedir}/gpib-1.0-py*.egg-info
457 %defattr(644,root,root,755)
458 %doc language/tcl/README
459 %attr(755,root,root) %{_libdir}/libgpib_tcl-%{version}.so
460 %attr(755,root,root) %{_libdir}/libgpib_tcl.so
461 %{_examplesdir}/tcl-gpib-%{version}
466 %defattr(644,root,root,755)