2 # - where to get firmware from?
6 %bcond_without kernel # kernel modules
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
19 Summary: GPIB (IEEE 488) Linux support
20 Summary(pl.UTF-8): Obsługa GPIB (IEEE 488) dla Linuksa
26 Group: Applications/System
27 Source0: http://downloads.sourceforge.net/linux-gpib/%{name}-%{version}.tar.gz
28 # Source0-md5: 2d97191e538a57ba7350fcc011ee2596
29 Patch0: %{name}-include_file.patch
30 Patch1: %{name}-destdir.patch
31 Patch2: %{name}-python.patch
32 Patch3: %{name}-perl.patch
33 Patch4: %{name}-firmwaredir.patch
34 Patch5: %{name}-guile2.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 >= 1.4}
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 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}
118 %description -n guile-gpib
119 Guile bindings for GPIB library.
121 %description -n guile-gpib -l pl.UTF-8
122 Wiązania Guile do biblioteki GPIB.
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}
130 %description -n perl-gpib
131 Perl bindings for GPIB library.
133 %description -n perl-gpib -l pl.UTF-8
134 Wiązania Perla do biblioteki GPIB.
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
143 %description -n python-gpib
144 Python bindings for GPIB library.
146 %description -n python-gpib -l pl.UTF-8
147 Wiązania Pythona do biblioteki GPIB.
150 Summary: Tcl bindings for GPIB library
151 Summary(pl.UTF-8): Wiązania Tcl-a do biblioteki GPIB
153 Requires: %{name}-libs = %{version}-%{release}
156 %description -n tcl-gpib
157 Tcl bindings for GPIB library.
159 %description -n tcl-gpib -l pl.UTF-8
160 Wiązania Tcl-a do biblioteki GPIB.
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+
169 Linux-GPIB tools and library documentation.
171 %description doc -l pl.UTF-8
172 Dokumentacja narzędzi i biblioteki Linux-GPIB.
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}\
180 Requires(post,postun): /sbin/depmod\
181 %requires_releq_kernel\
182 Requires(postun): %releq_kernel\
184 %description -n kernel%{_alt_kernel}-gpib\
185 This package contains Linux drivers for GPIB (IEEE 488) hardware.\
187 %description -n kernel%{_alt_kernel}-gpib -l pl.UTF-8\
188 Ten pakiet zawiera sterowniki dla Linuksa do urządzeń GPIB (IEEE 488).\
191 %files -n kernel%{_alt_kernel}-gpib\
192 %defattr(644,root,root,755)\
193 /lib/modules/%{_kernel_ver}/kernel/gpib\
196 %post -n kernel%{_alt_kernel}-gpib\
197 %depmod %{_kernel_ver}\
199 %postun -n kernel%{_alt_kernel}-gpib\
200 %depmod %{_kernel_ver}\
203 %define build_kernel_pkg()\
205 %build_kernel_modules -C drivers/gpib -m gpib -- EARLYCPPFLAGS="-I$TOPDIR -I$TOPDIR/drivers/gpib/include -I$TOPDIR/include"\
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\
210 %define install_kernel_pkg()\
213 %{?with_kernel:%{expand:%create_kernel_packages}}
224 # disable modules build by default, just install userspace header
225 echo 'SUBDIRS = gpib/include' > drivers/Makefile.am
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
239 CPPFLAGS="%{rpmcppflags} -I/usr/include/guile/2.0"
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}
255 %if %{with userspace}
260 %{expand:%build_kernel_packages}
264 rm -rf $RPM_BUILD_ROOT
265 install -d $RPM_BUILD_ROOT%{_examplesdir}
268 %{expand:%install_kernel_packages}
269 cp -a drivers/gpib/installed/* $RPM_BUILD_ROOT
272 %if %{with userspace}
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
284 # obsoleted by pkg-config
285 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib.la
288 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.la
289 %if %{with static_libs}
290 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.a
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
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
315 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/linux-gpib/html
320 rm -rf $RPM_BUILD_ROOT
322 %post libs -p /sbin/ldconfig
323 %postun libs -p /sbin/ldconfig
325 %post -n guile-gpib -p /sbin/ldconfig
326 %postun -n guile-gpib -p /sbin/ldconfig
328 %post -n tcl-gpib -p /sbin/ldconfig
329 %postun -n tcl-gpib -p /sbin/ldconfig
331 %if %{with userspace}
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
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
344 #/lib/firmware/agilent_82357a/82357a_fw.hex
345 #/lib/firmware/agilent_82357a/measat_releaseX1.8.hex
346 %dir /lib/firmware/ni_usb_gpib
348 #/lib/firmware/ni_usb_gpib/niusbb_firmware.hex
349 #/lib/firmware/ni_usb_gpib/niusbb_loader.hex
353 %defattr(644,root,root,755)
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
361 %defattr(644,root,root,755)
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
367 %defattr(644,root,root,755)
368 %attr(755,root,root) %{_libdir}/libgpib.so
370 %{_pkgconfigdir}/libgpib.pc
372 %if %{with static_libs}
374 %defattr(644,root,root,755)
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
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}
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
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}
417 %defattr(644,root,root,755)