]>
Commit | Line | Data |
---|---|---|
2ee896be | 1 | # TODO: |
08f3bc97 | 2 | # - where to get firmware from? |
2ee896be JB |
3 | # - guile 2 support |
4 | # - PHP 7 support | |
d4054fe9 | 5 | # |
d4054fe9 | 6 | # Conditional build: |
2ee896be JB |
7 | %bcond_without kernel # kernel modules |
8 | %bcond_without userspace # userspace packages | |
9 | %bcond_without verbose # verbose modules build (V=1) | |
df990a65 | 10 | |
2ee896be | 11 | %bcond_without docs # documentation build |
08f3bc97 | 12 | %bcond_with hotplug # legacy hotplug support |
2ee896be JB |
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 | |
df990a65 | 19 | |
2ee896be JB |
20 | Summary: GPIB (IEEE 488) Linux support |
21 | Summary(pl.UTF-8): Obsługa GPIB (IEEE 488) dla Linuksa | |
d4054fe9 | 22 | Name: linux-gpib |
2ee896be JB |
23 | Version: 4.0.3 |
24 | %define rel 0.1 | |
25 | Release: %{rel} | |
26 | License: GPL v2+ | |
cc64c2aa | 27 | Group: Applications/System |
2ee896be JB |
28 | Source0: http://downloads.sourceforge.net/linux-gpib/%{name}-%{version}.tar.gz |
29 | # Source0-md5: 2d97191e538a57ba7350fcc011ee2596 | |
8eefbf3b | 30 | Patch0: %{name}-include_file.patch |
2ee896be JB |
31 | Patch1: %{name}-destdir.patch |
32 | Patch2: %{name}-python.patch | |
33 | Patch3: %{name}-perl.patch | |
08f3bc97 | 34 | Patch4: %{name}-firmwaredir.patch |
d4054fe9 | 35 | URL: http://linux-gpib.sourceforge.net/ |
2ee896be JB |
36 | BuildRequires: autoconf >= 2.50 |
37 | BuildRequires: automake | |
38 | BuildRequires: libtool | |
39 | BuildRequires: rpmbuild(macros) >= 1.614 | |
d4054fe9 | 40 | %if %{with kernel} |
2ee896be | 41 | BuildRequires: kernel-module-build >= 3:2.6.8 |
d4054fe9 | 42 | %endif |
2ee896be JB |
43 | %if %{with userspace} |
44 | BuildRequires: bison | |
45 | %{?with_docs:BuildRequires: docbook-utils} | |
46 | BuildRequires: flex | |
47 | %{?with_guile:BuildRequires: guile-devel < 5:2.0} | |
df990a65 | 48 | %{?with_perl:BuildRequires: perl-devel} |
2ee896be JB |
49 | %{?with_php:BuildRequires: php-devel < 4:7} |
50 | %{?with_python:BuildRequires: python-devel >= 2} | |
51 | BuildRequires: readline-devel | |
df990a65 | 52 | %{?with_tcl:BuildRequires: tcl-devel} |
2ee896be JB |
53 | %endif |
54 | Requires: %{name}-libs = %{version}-%{release} | |
d4054fe9 | 55 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
56 | ||
57 | %description | |
cc64c2aa | 58 | The Linux GPIB package provides support for GPIB (IEEE 488) hardware. |
d4054fe9 | 59 | |
bc9733fa JR |
60 | %description -l pl.UTF-8 |
61 | Pakiet Linux GPIB służy do obsługi sprzętu GPIB (IEEE 488). | |
d4054fe9 | 62 | |
08f3bc97 JB |
63 | %package hotplug |
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} | |
68 | Requires: hotplug | |
69 | ||
70 | %description hotplug | |
71 | Linux GPIB support for legacy USB hotplug. | |
72 | ||
73 | %description hotplug -l pl.UTF-8 | |
74 | Obsługa Linux GPIB dla starego systemu hotplug USB. | |
75 | ||
2ee896be JB |
76 | %package libs |
77 | Summary: Shared GPIB library | |
78 | Summary(pl.UTF-8): Biblioteka współdzielona GPIB | |
79 | Group: Libraries | |
d7b3679a | 80 | |
2ee896be JB |
81 | %description libs |
82 | Shared GPIB library. | |
83 | ||
84 | %description libs -l pl.UTF-8 | |
85 | Biblioteka współdzielona GPIB. | |
86 | ||
87 | %package devel | |
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} | |
92 | ||
93 | %description devel | |
94 | Header file for GPIB library. | |
95 | ||
96 | %description devel -l pl.UTF-8 | |
97 | Plik nagłówkowy biblioteki GPIB. | |
98 | ||
99 | %package static | |
100 | Summary: Static GPIB library | |
101 | Summary(pl.UTF-8): Biblioteka statyczna GPIB | |
102 | Group: Development/Libraries | |
103 | Requires: %{name}-devel = %{version}-%{release} | |
104 | ||
105 | %description static | |
106 | Static GPIB library. | |
107 | ||
108 | %description static -l pl.UTF-8 | |
109 | Biblioteka statyczna GPIB. | |
110 | ||
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} | |
d7b3679a | 116 | |
2ee896be JB |
117 | %description -n perl-gpib |
118 | Perl bindings for GPIB library. | |
d7b3679a | 119 | |
2ee896be JB |
120 | %description -n perl-gpib -l pl.UTF-8 |
121 | Wiązania Perla do biblioteki GPIB. | |
d7b3679a | 122 | |
2ee896be JB |
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 | |
d7b3679a | 129 | |
2ee896be JB |
130 | %description -n python-gpib |
131 | Python bindings for GPIB library. | |
132 | ||
133 | %description -n python-gpib -l pl.UTF-8 | |
134 | Wiązania Pythona do biblioteki GPIB. | |
135 | ||
136 | %package -n tcl-gpib | |
137 | Summary: Tcl bindings for GPIB library | |
138 | Summary(pl.UTF-8): Wiązania Tcl-a do biblioteki GPIB | |
139 | Group: Libraries | |
140 | Requires: %{name}-libs = %{version}-%{release} | |
141 | Requires: tcl | |
142 | ||
143 | %description -n tcl-gpib | |
144 | Tcl bindings for GPIB library. | |
145 | ||
146 | %description -n tcl-gpib -l pl.UTF-8 | |
147 | Wiązania Tcl-a do biblioteki GPIB. | |
148 | ||
149 | %package doc | |
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+ | |
153 | Group: Documentation | |
154 | ||
155 | %description doc | |
156 | Linux-GPIB tools and library documentation. | |
157 | ||
158 | %description doc -l pl.UTF-8 | |
159 | Dokumentacja narzędzi i biblioteki Linux-GPIB. | |
160 | ||
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}\ | |
166 | Group: Base/Kernel\ | |
167 | Requires(post,postun): /sbin/depmod\ | |
168 | %requires_releq_kernel\ | |
169 | Requires(postun): %releq_kernel\ | |
170 | \ | |
171 | %description -n kernel%{_alt_kernel}-gpib\ | |
172 | This package contains Linux drivers for GPIB (IEEE 488) hardware.\ | |
173 | \ | |
174 | %description -n kernel%{_alt_kernel}-gpib -l pl.UTF-8\ | |
175 | Ten pakiet zawiera sterowniki dla Linuksa do urządzeń GPIB (IEEE 488).\ | |
176 | \ | |
177 | %if %{with kernel}\ | |
178 | %files -n kernel%{_alt_kernel}-gpib\ | |
179 | %defattr(644,root,root,755)\ | |
180 | /lib/modules/%{_kernel_ver}/kernel/gpib\ | |
181 | %endif\ | |
182 | \ | |
183 | %post -n kernel%{_alt_kernel}-gpib\ | |
184 | %depmod %{_kernel_ver}\ | |
185 | \ | |
186 | %postun -n kernel%{_alt_kernel}-gpib\ | |
187 | %depmod %{_kernel_ver}\ | |
188 | %{nil} | |
189 | ||
190 | %define build_kernel_pkg()\ | |
191 | TOPDIR=$(pwd)\ | |
192 | %build_kernel_modules -C drivers/gpib -m gpib -- EARLYCPPFLAGS="-I$TOPDIR -I$TOPDIR/drivers/gpib/include -I$TOPDIR/include"\ | |
193 | cd drivers/gpib\ | |
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\ | |
195 | %{nil} | |
196 | ||
197 | %define install_kernel_pkg()\ | |
198 | %{nil} | |
199 | ||
200 | %{?with_kernel:%{expand:%create_kernel_packages}} | |
d7b3679a | 201 | |
d4054fe9 | 202 | %prep |
d7b3679a | 203 | %setup -q |
8eefbf3b | 204 | %patch0 -p1 |
2ee896be JB |
205 | %patch1 -p1 |
206 | %patch2 -p1 | |
207 | %patch3 -p1 | |
08f3bc97 | 208 | %patch4 -p1 |
2ee896be JB |
209 | |
210 | # disable modules build by default, just install userspace header | |
211 | echo 'SUBDIRS = gpib/include' > drivers/Makefile.am | |
212 | ||
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 | |
216 | done | |
d7b3679a | 217 | |
d4054fe9 | 218 | %build |
d7b3679a | 219 | %{__libtoolize} |
2ee896be | 220 | %{__aclocal} -I m4 |
d7b3679a | 221 | %{__autoconf} |
2ee896be | 222 | %{__autoheader} |
d7b3679a | 223 | %{__automake} |
d7b3679a | 224 | %configure \ |
2ee896be JB |
225 | %ifarch %{ix86} |
226 | --enable-isa \ | |
227 | --enable-pcmcia \ | |
228 | %endif | |
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} | |
d7b3679a | 237 | |
2ee896be | 238 | %if %{with userspace} |
9e3b7024 | 239 | %{__make} |
2ee896be | 240 | %endif |
d7b3679a | 241 | |
2ee896be JB |
242 | %if %{with kernel} |
243 | %{expand:%build_kernel_packages} | |
244 | %endif | |
d4054fe9 | 245 | |
246 | %install | |
247 | rm -rf $RPM_BUILD_ROOT | |
2ee896be | 248 | install -d $RPM_BUILD_ROOT%{_examplesdir} |
d4054fe9 | 249 | |
8eefbf3b | 250 | %if %{with kernel} |
2ee896be JB |
251 | %{expand:%install_kernel_packages} |
252 | cp -a drivers/gpib/installed/* $RPM_BUILD_ROOT | |
8eefbf3b MWP |
253 | %endif |
254 | ||
d4054fe9 | 255 | %if %{with userspace} |
9e3b7024 | 256 | %{__make} install \ |
08f3bc97 JB |
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 | |
2ee896be JB |
266 | |
267 | # obsoleted by pkg-config | |
268 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib.la | |
269 | ||
270 | %if %{with perl} | |
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 | |
275 | %endif | |
276 | ||
277 | %if %{with python} | |
278 | %py_postclean | |
279 | %endif | |
280 | ||
281 | %if %{with tcl} | |
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 | |
286 | %endif | |
287 | %endif | |
288 | ||
289 | %if %{with docs} | |
290 | # packaged as %doc | |
291 | %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/linux-gpib/html | |
292 | %endif | |
d4054fe9 | 293 | %endif |
294 | ||
d4054fe9 | 295 | %clean |
296 | rm -rf $RPM_BUILD_ROOT | |
297 | ||
2ee896be JB |
298 | %post libs -p /sbin/ldconfig |
299 | %postun libs -p /sbin/ldconfig | |
d4054fe9 | 300 | |
2ee896be JB |
301 | %if %{with userspace} |
302 | %files | |
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 | |
08f3bc97 JB |
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 | |
313 | # TODO: | |
314 | #/lib/firmware/agilent_82357a/82357a_fw.hex | |
315 | #/lib/firmware/agilent_82357a/measat_releaseX1.8.hex | |
316 | %dir /lib/firmware/ni_usb_gpib | |
317 | # TODO: | |
318 | #/lib/firmware/ni_usb_gpib/niusbb_firmware.hex | |
319 | #/lib/firmware/ni_usb_gpib/niusbb_loader.hex | |
320 | ||
321 | %if %{with hotplug} | |
322 | %files hotplug | |
323 | %defattr(644,root,root,755) | |
2ee896be JB |
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 | |
08f3bc97 | 328 | %endif |
d4054fe9 | 329 | |
2ee896be | 330 | %files libs |
0e4898e2 | 331 | %defattr(644,root,root,755) |
2ee896be JB |
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 | |
335 | ||
336 | %files devel | |
337 | %defattr(644,root,root,755) | |
338 | %attr(755,root,root) %{_libdir}/libgpib.so | |
339 | %{_includedir}/gpib | |
340 | %{_pkgconfigdir}/libgpib.pc | |
341 | ||
342 | %if %{with static_libs} | |
343 | %files static | |
344 | %defattr(644,root,root,755) | |
345 | %{_libdir}/libgpib.a | |
346 | %endif | |
347 | ||
348 | %if %{with perl} | |
349 | %files -n perl-gpib | |
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} | |
358 | %endif | |
359 | ||
360 | %if %{with python} | |
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 | |
367 | %endif | |
368 | ||
369 | %if %{with tcl} | |
370 | %files -n tcl-gpib | |
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} | |
376 | %endif | |
377 | ||
378 | %if %{with docs} | |
379 | %files doc | |
380 | %defattr(644,root,root,755) | |
381 | %doc doc/doc_html/* | |
382 | %endif | |
1fc85825 | 383 | %endif |