2 # - where to get firmware from?
7 %bcond_without kernel # kernel modules
8 %bcond_without userspace # userspace packages
9 %bcond_without verbose # verbose modules build (V=1)
11 %bcond_without docs # documentation build
12 %bcond_with hotplug # legacy hotplug support
13 %bcond_without static_libs # static library
14 %bcond_with guile # guile binding
15 %bcond_without perl # Perl binding
16 %bcond_without php # PHP binding
17 %bcond_without python # Python binding
18 %bcond_without tcl # Tcl binding
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 URL: http://linux-gpib.sourceforge.net/
36 BuildRequires: autoconf >= 2.50
37 BuildRequires: automake
38 BuildRequires: libtool
39 BuildRequires: rpmbuild(macros) >= 1.614
41 BuildRequires: kernel-module-build >= 3:2.6.8
45 %{?with_docs:BuildRequires: docbook-utils}
47 %{?with_guile:BuildRequires: guile-devel < 5:2.0}
48 %{?with_perl:BuildRequires: perl-devel}
49 %{?with_php:BuildRequires: php-devel < 4:7}
50 %{?with_python:BuildRequires: python-devel >= 2}
51 BuildRequires: readline-devel
52 %{?with_tcl:BuildRequires: tcl-devel}
54 Requires: %{name}-libs = %{version}-%{release}
55 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58 The Linux GPIB package provides support for GPIB (IEEE 488) hardware.
60 %description -l pl.UTF-8
61 Pakiet Linux GPIB służy do obsługi sprzętu GPIB (IEEE 488).
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}
71 Linux GPIB support for legacy USB hotplug.
73 %description hotplug -l pl.UTF-8
74 Obsługa Linux GPIB dla starego systemu hotplug USB.
77 Summary: Shared GPIB library
78 Summary(pl.UTF-8): Biblioteka współdzielona GPIB
84 %description libs -l pl.UTF-8
85 Biblioteka współdzielona GPIB.
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}
94 Header file for GPIB library.
96 %description devel -l pl.UTF-8
97 Plik nagłówkowy biblioteki GPIB.
100 Summary: Static GPIB library
101 Summary(pl.UTF-8): Biblioteka statyczna GPIB
102 Group: Development/Libraries
103 Requires: %{name}-devel = %{version}-%{release}
108 %description static -l pl.UTF-8
109 Biblioteka statyczna GPIB.
111 %package -n perl-gpib
112 Summary: Perl bindings for GPIB library
113 Summary(pl.UTF-8): Wiązania Perla do biblioteki GPIB
114 Group: Development/Languages/Perl
115 Requires: %{name}-libs = %{version}-%{release}
117 %description -n perl-gpib
118 Perl bindings for GPIB library.
120 %description -n perl-gpib -l pl.UTF-8
121 Wiązania Perla do biblioteki GPIB.
123 %package -n python-gpib
124 Summary: Python bindings for GPIB library
125 Summary(pl.UTF-8): Wiązania Pythona do biblioteki GPIB
126 Group: Libraries/Python
127 Requires: %{name}-libs = %{version}-%{release}
128 Requires: python-libs
130 %description -n python-gpib
131 Python bindings for GPIB library.
133 %description -n python-gpib -l pl.UTF-8
134 Wiązania Pythona do biblioteki GPIB.
137 Summary: Tcl bindings for GPIB library
138 Summary(pl.UTF-8): Wiązania Tcl-a do biblioteki GPIB
140 Requires: %{name}-libs = %{version}-%{release}
143 %description -n tcl-gpib
144 Tcl bindings for GPIB library.
146 %description -n tcl-gpib -l pl.UTF-8
147 Wiązania Tcl-a do biblioteki GPIB.
150 Summary: Linux-GPIB tools and library documentation
151 Summary(pl.UTF-8): Dokumentacja narzędzi i biblioteki Linux-GPIB
152 License: GFDL v1.2+ or GPL v2+
156 Linux-GPIB tools and library documentation.
158 %description doc -l pl.UTF-8
159 Dokumentacja narzędzi i biblioteki Linux-GPIB.
161 %define kernel_pkg()\
162 %package -n kernel%{_alt_kernel}-gpib\
163 Summary: Linux GPIB drivers\
164 Summary(pl.UTF-8): Sterowniki GPIB dla Linuksa\
165 Release: %{rel}@%{_kernel_ver_str}\
167 Requires(post,postun): /sbin/depmod\
168 %requires_releq_kernel\
169 Requires(postun): %releq_kernel\
171 %description -n kernel%{_alt_kernel}-gpib\
172 This package contains Linux drivers for GPIB (IEEE 488) hardware.\
174 %description -n kernel%{_alt_kernel}-gpib -l pl.UTF-8\
175 Ten pakiet zawiera sterowniki dla Linuksa do urządzeń GPIB (IEEE 488).\
178 %files -n kernel%{_alt_kernel}-gpib\
179 %defattr(644,root,root,755)\
180 /lib/modules/%{_kernel_ver}/kernel/gpib\
183 %post -n kernel%{_alt_kernel}-gpib\
184 %depmod %{_kernel_ver}\
186 %postun -n kernel%{_alt_kernel}-gpib\
187 %depmod %{_kernel_ver}\
190 %define build_kernel_pkg()\
192 %build_kernel_modules -C drivers/gpib -m gpib -- EARLYCPPFLAGS="-I$TOPDIR -I$TOPDIR/drivers/gpib/include -I$TOPDIR/include"\
194 %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\
197 %define install_kernel_pkg()\
200 %{?with_kernel:%{expand:%create_kernel_packages}}
210 # disable modules build by default, just install userspace header
211 echo 'SUBDIRS = gpib/include' > drivers/Makefile.am
213 # need to inject -I options before $(LINUXINCLUDE), the simplest way is to override CC
214 for f in drivers/gpib/*/Makefile ; do
215 echo 'override CC += $(EARLYCPPFLAGS)' >> $f
229 %{!?with_docs:--disable-documentation} \
230 %{!?with_guile:--disable-guile-binding} \
231 %{!?with_perl:--disable-perl-binding} \
232 %{!?with_php:--disable-php-binding} \
233 %{!?with_python:--disable-python-binding} \
234 %{?with_static_libs:--enable-static} \
235 %{!?with_tcl:--disable-tcl-binding} \
236 --with-linux-srcdir=%{_kernelsrcdir}
238 %if %{with userspace}
243 %{expand:%build_kernel_packages}
247 rm -rf $RPM_BUILD_ROOT
248 install -d $RPM_BUILD_ROOT%{_examplesdir}
251 %{expand:%install_kernel_packages}
252 cp -a drivers/gpib/installed/* $RPM_BUILD_ROOT
255 %if %{with userspace}
257 DESTDIR=$RPM_BUILD_ROOT \
258 HOTPLUG_USB_CONF_DIR=/lib/udev \
259 UDEV_RULES_DIR=/lib/udev/rules.d \
260 USB_FIRMWARE_DIR=/lib/firmware
261 # use udev paths as base and legacy hotplug as addon (not the opposite)
262 install -d $RPM_BUILD_ROOT/etc/hotplug/usb
263 %{__mv} $RPM_BUILD_ROOT/lib/udev/*.usermap $RPM_BUILD_ROOT/etc/hotplug/usb
264 ln -snf /lib/udev/agilent_82357a $RPM_BUILD_ROOT/etc/hotplug/usb/agilent_82357a
265 ln -snf /lib/udev/ni_usb_gpib $RPM_BUILD_ROOT/etc/hotplug/usb/ni_usb_gpib
267 # obsoleted by pkg-config
268 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib.la
271 %{__make} -C language/perl pure_install \
272 DESTDIR=$RPM_BUILD_ROOT
273 cp -pr language/perl/examples $RPM_BUILD_ROOT%{_examplesdir}/perl-gpib-%{version}
274 %{__rm} -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/LinuxGpib/.packlist
282 cp -pr language/tcl/examples $RPM_BUILD_ROOT%{_examplesdir}/tcl-gpib-%{version}
283 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.la
284 %if %{with static_libs}
285 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.a
291 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/linux-gpib/html
296 rm -rf $RPM_BUILD_ROOT
298 %post libs -p /sbin/ldconfig
299 %postun libs -p /sbin/ldconfig
301 %if %{with userspace}
303 %defattr(644,root,root,755)
304 %attr(755,root,root) %{_bindir}/ibterm
305 %attr(755,root,root) %{_bindir}/ibtest
306 %attr(755,root,root) %{_sbindir}/gpib_config
307 /lib/udev/rules.d/99-agilent_82357a.rules
308 /lib/udev/rules.d/99-gpib-generic.rules
309 /lib/udev/rules.d/99-ni_usb_gpib.rules
310 %attr(755,root,root) /lib/udev/agilent_82357a
311 %attr(755,root,root) /lib/udev/ni_usb_gpib
312 %dir /lib/firmware/agilent_82357a
314 #/lib/firmware/agilent_82357a/82357a_fw.hex
315 #/lib/firmware/agilent_82357a/measat_releaseX1.8.hex
316 %dir /lib/firmware/ni_usb_gpib
318 #/lib/firmware/ni_usb_gpib/niusbb_firmware.hex
319 #/lib/firmware/ni_usb_gpib/niusbb_loader.hex
323 %defattr(644,root,root,755)
324 %attr(755,root,root) /etc/hotplug/usb/agilent_82357a
325 %attr(755,root,root) /etc/hotplug/usb/ni_usb_gpib
326 /etc/hotplug/usb/agilent_82357a.usermap
327 /etc/hotplug/usb/ni_usb_gpib.usermap
331 %defattr(644,root,root,755)
332 %doc AUTHORS ChangeLog README README.HAMEG README.hp82335 TODO
333 %attr(755,root,root) %{_libdir}/libgpib.so.*.*.*
334 %attr(755,root,root) %ghost %{_libdir}/libgpib.so.0
337 %defattr(644,root,root,755)
338 %attr(755,root,root) %{_libdir}/libgpib.so
340 %{_pkgconfigdir}/libgpib.pc
342 %if %{with static_libs}
344 %defattr(644,root,root,755)
350 %defattr(644,root,root,755)
351 %doc language/perl/{Changes,README}
352 %{perl_vendorarch}/LinuxGpib.pm
353 %dir %{perl_vendorarch}/auto/LinuxGpib
354 %attr(755,root,root) %{perl_vendorarch}/auto/LinuxGpib/LinuxGpib.so
355 %{perl_vendorarch}/auto/LinuxGpib/autosplit.ix
356 %{_mandir}/man3/LinuxGpib.3pm*
357 %{_examplesdir}/perl-gpib-%{version}
361 %files -n python-gpib
362 %defattr(644,root,root,755)
363 %doc language/python/README
364 %attr(755,root,root) %{py_sitedir}/gpib.so
365 %{py_sitedir}/Gpib.py[co]
366 %{py_sitedir}/gpib-1.0-py*.egg-info
371 %defattr(644,root,root,755)
372 %doc language/tcl/README
373 %attr(755,root,root) %{_libdir}/libgpib_tcl-%{version}.so
374 %attr(755,root,root) %{_libdir}/libgpib_tcl.so
375 %{_examplesdir}/tcl-gpib-%{version}
380 %defattr(644,root,root,755)