2 # - resolve udev vs hotplug issues (use /lib/udev/rules.d, don't require /etc/hotplug dir with udev)
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_without static_libs # static library
13 %bcond_with 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 URL: http://linux-gpib.sourceforge.net/
34 BuildRequires: autoconf >= 2.50
35 BuildRequires: automake
36 BuildRequires: libtool
37 BuildRequires: rpmbuild(macros) >= 1.614
39 BuildRequires: kernel-module-build >= 3:2.6.8
43 %{?with_docs:BuildRequires: docbook-utils}
45 %{?with_guile:BuildRequires: guile-devel < 5:2.0}
46 %{?with_perl:BuildRequires: perl-devel}
47 %{?with_php:BuildRequires: php-devel < 4:7}
48 %{?with_python:BuildRequires: python-devel >= 2}
49 BuildRequires: readline-devel
50 %{?with_tcl:BuildRequires: tcl-devel}
52 Requires: %{name}-libs = %{version}-%{release}
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 The Linux GPIB package provides support for GPIB (IEEE 488) hardware.
58 %description -l pl.UTF-8
59 Pakiet Linux GPIB służy do obsługi sprzętu GPIB (IEEE 488).
62 Summary: Shared GPIB library
63 Summary(pl.UTF-8): Biblioteka współdzielona GPIB
69 %description libs -l pl.UTF-8
70 Biblioteka współdzielona GPIB.
73 Summary: Header file for GPIB library
74 Summary(pl.UTF-8): Plik nagłówkowy biblioteki GPIB
75 Group: Development/Libraries
76 Requires: %{name}-libs = %{version}-%{release}
79 Header file for GPIB library.
81 %description devel -l pl.UTF-8
82 Plik nagłówkowy biblioteki GPIB.
85 Summary: Static GPIB library
86 Summary(pl.UTF-8): Biblioteka statyczna GPIB
87 Group: Development/Libraries
88 Requires: %{name}-devel = %{version}-%{release}
93 %description static -l pl.UTF-8
94 Biblioteka statyczna GPIB.
97 Summary: Perl bindings for GPIB library
98 Summary(pl.UTF-8): Wiązania Perla do biblioteki GPIB
99 Group: Development/Languages/Perl
100 Requires: %{name}-libs = %{version}-%{release}
102 %description -n perl-gpib
103 Perl bindings for GPIB library.
105 %description -n perl-gpib -l pl.UTF-8
106 Wiązania Perla do biblioteki GPIB.
108 %package -n python-gpib
109 Summary: Python bindings for GPIB library
110 Summary(pl.UTF-8): Wiązania Pythona do biblioteki GPIB
111 Group: Libraries/Python
112 Requires: %{name}-libs = %{version}-%{release}
113 Requires: python-libs
115 %description -n python-gpib
116 Python bindings for GPIB library.
118 %description -n python-gpib -l pl.UTF-8
119 Wiązania Pythona do biblioteki GPIB.
122 Summary: Tcl bindings for GPIB library
123 Summary(pl.UTF-8): Wiązania Tcl-a do biblioteki GPIB
125 Requires: %{name}-libs = %{version}-%{release}
128 %description -n tcl-gpib
129 Tcl bindings for GPIB library.
131 %description -n tcl-gpib -l pl.UTF-8
132 Wiązania Tcl-a do biblioteki GPIB.
135 Summary: Linux-GPIB tools and library documentation
136 Summary(pl.UTF-8): Dokumentacja narzędzi i biblioteki Linux-GPIB
137 License: GFDL v1.2+ or GPL v2+
141 Linux-GPIB tools and library documentation.
143 %description doc -l pl.UTF-8
144 Dokumentacja narzędzi i biblioteki Linux-GPIB.
146 %define kernel_pkg()\
147 %package -n kernel%{_alt_kernel}-gpib\
148 Summary: Linux GPIB drivers\
149 Summary(pl.UTF-8): Sterowniki GPIB dla Linuksa\
150 Release: %{rel}@%{_kernel_ver_str}\
152 Requires(post,postun): /sbin/depmod\
153 %requires_releq_kernel\
154 Requires(postun): %releq_kernel\
156 %description -n kernel%{_alt_kernel}-gpib\
157 This package contains Linux drivers for GPIB (IEEE 488) hardware.\
159 %description -n kernel%{_alt_kernel}-gpib -l pl.UTF-8\
160 Ten pakiet zawiera sterowniki dla Linuksa do urządzeń GPIB (IEEE 488).\
163 %files -n kernel%{_alt_kernel}-gpib\
164 %defattr(644,root,root,755)\
165 /lib/modules/%{_kernel_ver}/kernel/gpib\
168 %post -n kernel%{_alt_kernel}-gpib\
169 %depmod %{_kernel_ver}\
171 %postun -n kernel%{_alt_kernel}-gpib\
172 %depmod %{_kernel_ver}\
175 %define build_kernel_pkg()\
177 %build_kernel_modules -C drivers/gpib -m gpib -- EARLYCPPFLAGS="-I$TOPDIR -I$TOPDIR/drivers/gpib/include -I$TOPDIR/include"\
179 %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\
182 %define install_kernel_pkg()\
185 %{?with_kernel:%{expand:%create_kernel_packages}}
194 # disable modules build by default, just install userspace header
195 echo 'SUBDIRS = gpib/include' > drivers/Makefile.am
197 # need to inject -I options before $(LINUXINCLUDE), the simplest way is to override CC
198 for f in drivers/gpib/*/Makefile ; do
199 echo 'override CC += $(EARLYCPPFLAGS)' >> $f
213 %{!?with_docs:--disable-documentation} \
214 %{!?with_guile:--disable-guile-binding} \
215 %{!?with_perl:--disable-perl-binding} \
216 %{!?with_php:--disable-php-binding} \
217 %{!?with_python:--disable-python-binding} \
218 %{?with_static_libs:--enable-static} \
219 %{!?with_tcl:--disable-tcl-binding} \
220 --with-linux-srcdir=%{_kernelsrcdir}
222 %if %{with userspace}
227 %{expand:%build_kernel_packages}
231 rm -rf $RPM_BUILD_ROOT
232 install -d $RPM_BUILD_ROOT%{_examplesdir}
235 %{expand:%install_kernel_packages}
236 cp -a drivers/gpib/installed/* $RPM_BUILD_ROOT
239 %if %{with userspace}
241 DESTDIR=$RPM_BUILD_ROOT
243 # obsoleted by pkg-config
244 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib.la
247 %{__make} -C language/perl pure_install \
248 DESTDIR=$RPM_BUILD_ROOT
249 cp -pr language/perl/examples $RPM_BUILD_ROOT%{_examplesdir}/perl-gpib-%{version}
250 %{__rm} -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/LinuxGpib/.packlist
258 cp -pr language/tcl/examples $RPM_BUILD_ROOT%{_examplesdir}/tcl-gpib-%{version}
259 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.la
260 %if %{with static_libs}
261 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.a
267 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/linux-gpib/html
272 rm -rf $RPM_BUILD_ROOT
274 %post libs -p /sbin/ldconfig
275 %postun libs -p /sbin/ldconfig
277 %if %{with userspace}
279 %defattr(644,root,root,755)
280 %attr(755,root,root) %{_bindir}/ibterm
281 %attr(755,root,root) %{_bindir}/ibtest
282 %attr(755,root,root) %{_sbindir}/gpib_config
283 # TODO: move to /lib/udev/rules.d
284 /etc/udev/rules.d/99-agilent_82357a.rules
285 /etc/udev/rules.d/99-gpib-generic.rules
286 /etc/udev/rules.d/99-ni_usb_gpib.rules
287 # TODO: paths to fix (scripts used also in udev .rules)
288 %attr(755,root,root) /etc/hotplug/usb/agilent_82357a
289 %attr(755,root,root) /etc/hotplug/usb/ni_usb_gpib
290 /etc/hotplug/usb/agilent_82357a.usermap
291 /etc/hotplug/usb/ni_usb_gpib.usermap
292 # /lib/firmware/...; and where are the files?
293 %dir %{_datadir}/usb/agilent_82357a
294 %dir %{_datadir}/usb/ni_usb_gpib
297 %defattr(644,root,root,755)
298 %doc AUTHORS ChangeLog README README.HAMEG README.hp82335 TODO
299 %attr(755,root,root) %{_libdir}/libgpib.so.*.*.*
300 %attr(755,root,root) %ghost %{_libdir}/libgpib.so.0
303 %defattr(644,root,root,755)
304 %attr(755,root,root) %{_libdir}/libgpib.so
306 %{_pkgconfigdir}/libgpib.pc
308 %if %{with static_libs}
310 %defattr(644,root,root,755)
316 %defattr(644,root,root,755)
317 %doc language/perl/{Changes,README}
318 %{perl_vendorarch}/LinuxGpib.pm
319 %dir %{perl_vendorarch}/auto/LinuxGpib
320 %attr(755,root,root) %{perl_vendorarch}/auto/LinuxGpib/LinuxGpib.so
321 %{perl_vendorarch}/auto/LinuxGpib/autosplit.ix
322 %{_mandir}/man3/LinuxGpib.3pm*
323 %{_examplesdir}/perl-gpib-%{version}
327 %files -n python-gpib
328 %defattr(644,root,root,755)
329 %doc language/python/README
330 %attr(755,root,root) %{py_sitedir}/gpib.so
331 %{py_sitedir}/Gpib.py[co]
332 %{py_sitedir}/gpib-1.0-py*.egg-info
337 %defattr(644,root,root,755)
338 %doc language/tcl/README
339 %attr(755,root,root) %{_libdir}/libgpib_tcl-%{version}.so
340 %attr(755,root,root) %{_libdir}/libgpib_tcl.so
341 %{_examplesdir}/tcl-gpib-%{version}
346 %defattr(644,root,root,755)