3 %bcond_without dist_kernel # allow non-distribution kernel
4 %bcond_without kernel # don't build kernel modules
5 %bcond_without up # don't build UP module
6 %bcond_without smp # don't build SMP module
7 %bcond_without userspace # don't build userspace module
8 %bcond_with verbose # verbose build (V=1)
16 Summary: GPIB Linux Support
17 Summary(pl.UTF-8): Sterowniki GPIB dla Linuksa
22 Group: Applications/System
23 Source0: http://dl.sourceforge.net/linux-gpib/%{name}-%{version}.tar.gz
24 # Source0-md5: 65044161fe86a815c9c159fe301d85c4
25 #Patch0: %{name}-Makefile.am.patch
26 URL: http://linux-gpib.sourceforge.net/
28 %{?with_dist_kernel:BuildRequires: kernel-module-build >= 3:2.6.7}
29 BuildRequires: rpmbuild(macros) >= 1.153
31 BuildRequires: kernel-headers >= 2.6.8
33 Requires(pre,post): kernel >= 2.6.8
34 Requires: kernel-up >= 2.6.8
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 The Linux GPIB package provides support for GPIB (IEEE 488) hardware.
40 %description -l pl.UTF-8
41 Pakiet Linux GPIB służy do obsługi sprzętu GPIB (IEEE 488).
45 %package -n kernel-%{mod_name}
46 Summary: Linux driver for %{name}
47 Summary(pl.UTF-8): Sterownik dla Linuksa do %{name}
48 Release: %{_rel}@%{_kernel_ver_str}
50 Requires(post,postun): /sbin/depmod
51 %if %{with dist_kernel}
52 %requires_releq_kernel_up
53 Requires(postun): %releq_kernel_up
56 %description -n kernel-%{mod_name}
57 This is driver for %{name} for Linux.
59 This package contains Linux module.
61 %description -n kernel-%{mod_name} -l pl.UTF-8
62 Sterownik dla Linuksa do %{name}.
64 Ten pakiet zawiera moduł jądra Linuksa.
66 %package -n kernel-smp-%{mod_name}
67 Summary: Linux SMP driver for %{name}
68 Summary(pl.UTF-8): Sterownik dla Linuksa SMP do %{name}
69 Release: %{_rel}@%{_kernel_ver_str}
71 Requires(post,postun): /sbin/depmod
72 %if %{with dist_kernel}
73 %requires_releq_kernel_smp
74 Requires(postun): %releq_kernel_smp
77 %description -n kernel-smp-%{mod_name}
78 This is driver for %{name} for Linux.
80 This package contains Linux SMP module.
82 %description -n kernel-smp-%{mod_name} -l pl.UTF-8
83 Sterownik dla Linuksa do %{name}.
85 Ten pakiet zawiera moduł jądra Linuksa SMP.
98 --disable-guile-binding \
99 --disable-perl-binding \
100 --disable-php-binding \
101 --disable-python-binding \
102 --disable-tcl-binding \
103 --disable-documentation
105 %if %{with userspace}
111 for i in tms9914 agilent_82350b agilent_82357a cb7210 hp82335 hp_82341 nec7210 tnt4882 cec ines pc2 sys ; do
115 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
116 if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
120 install -d include/{linux,config}
121 ln -sf %{_kernelsrcdir}/config-$cfg .config
122 ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h include/linux/autoconf.h
123 ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
124 ln -sf %{_kernelsrcdir}/Module.symvers-$cfg Module.symvers
125 touch include/config/MARKER
127 cp -rdp ../include/* include
128 install -d include/gpib
129 cp -rdp include/gpib_user.h include/gpib
130 cp -rdp ../../config.h include
132 %{__make} -C %{_kernelsrcdir} clean \
133 RCS_FIND_IGNORE="-name '*.ko' -o" \
136 %{__make} -C %{_kernelsrcdir} modules \
137 CC="%{__cc}" CPP="%{__cpp}" \
141 if [ "$i" = "sys" ]; then
144 if [ "$i" = "cec" ]; then
147 if [ "$i" = "ines" ]; then
150 if [ "$i" = "pc2" ]; then
161 rm -rf $RPM_BUILD_ROOT
162 HOTPLUG_USB_CONF_DIR=/etc/hotplug/usb
163 USB_FIRMWARE_DIR=/usr/share/usb/
165 install -d $RPM_BUILD_ROOT{$HOTPLUG_USB_CONF_DIR,$USB_FIRMWARE_DIR}
166 %if %{with userspace}
168 DESTDIR=$RPM_BUILD_ROOT \
169 HOTPLUG_USB_CONF_DIR=$RPM_BUILD_ROOT$HOTPLUG_USB_CONF_DIR \
170 USB_FIRMWARE_DIR=$RPM_BUILD_ROOT$USB_FIRMWARE_DIR
174 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
177 for i in agilent_82350b agilent_82357a cb7210 hp82335 hp_82341 nec7210 tms9914 tnt4882 cec ines pc2 sys; do
179 if [ "$i" == "sys" ]; then
182 if [ "$i" == "cec" ]; then
185 if [ "$i" == "ines" ]; then
188 if [ "$i" == "pc2" ]; then
192 install $i-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
193 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/$i.ko
194 %if %{with smp} && %{with dist_kernel}
196 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/$i.ko
203 rm -rf $RPM_BUILD_ROOT
205 %post -n kernel-%{mod_name}
206 %depmod %{_kernel_ver}
208 %postun -n kernel-%{mod_name}
209 %depmod %{_kernel_ver}
211 %post -n kernel-smp-%{mod_name}
212 %depmod %{_kernel_ver}smp
214 %postun -n kernel-smp-%{mod_name}
215 %depmod %{_kernel_ver}smp
218 %if %{with up} || %{without dist_kernel}
219 %files -n kernel-%{mod_name}
220 %defattr(644,root,root,755)
221 /lib/modules/%{_kernel_ver}/misc/*.ko*
224 %if %{with smp} && %{with dist_kernel}
225 %files -n kernel-smp-%{mod_name}
226 %defattr(644,root,root,755)
227 /lib/modules/%{_kernel_ver}smp/misc/*.ko*