]> git.pld-linux.org Git - packages/linux-gpib.git/blob - linux-gpib.spec
- updated to 4.3.3
[packages/linux-gpib.git] / linux-gpib.spec
1 #
2 # Conditional build:
3 %bcond_without  kernel          # kernel modules
4 %bcond_without  drivers_isa     # ISA kernel drivers [ix86 only]
5 %bcond_without  drivers_usb     # USB kernel drivers
6 %bcond_without  userspace       # userspace packages
7 %bcond_without  verbose         # verbose modules build (V=1)
8
9 %bcond_without  doc             # documentation build
10 %bcond_with     hotplug         # legacy hotplug support
11 %bcond_without  static_libs     # static library
12 %bcond_without  guile           # guile binding
13 %bcond_without  perl            # Perl binding
14 %bcond_with     php             # PHP binding
15 %bcond_without  python          # Python (any) binding
16 %bcond_without  python2         # Python 2.x binding
17 %bcond_without  tcl             # Tcl binding
18
19 # The goal here is to have main, userspace, package built once with
20 # simple release number, and only rebuild kernel packages with kernel
21 # version as part of release number, without the need to bump release
22 # with every kernel change.
23 %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
24 %{error:kernel and userspace cannot be built at the same time on PLD builders}
25 exit 1
26 %endif
27
28 %ifnarch %{ix86}
29 %undefine       with_drivers_isa
30 %endif
31 %if %{without python}
32 %undefine       with_python2
33 %endif
34
35 %define         php_name        php%{?php_suffix}
36
37 %define         rel     1
38 %define         pname   linux-gpib
39 Summary:        GPIB (IEEE 488) Linux support
40 Summary(pl.UTF-8):      Obsługa GPIB (IEEE 488) dla Linuksa
41 Name:           %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
42 Version:        4.3.3
43 Release:        %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
44 License:        GPL v2+
45 Group:          Applications/System
46 Source0:        http://downloads.sourceforge.net/linux-gpib/%{pname}-%{version}.tar.gz
47 # Source0-md5:  1243aa44f788cf23f9b40ded54c14685
48 Patch2:         %{pname}-python.patch
49 Patch3:         %{pname}-perl.patch
50 Patch4:         %{pname}-firmwaredir.patch
51 Patch5:         %{pname}-guile2.patch
52 Patch6:         %{pname}-php7.patch
53 Patch8:         kernel-5.2.patch
54 URL:            http://linux-gpib.sourceforge.net/
55 BuildRequires:  autoconf >= 2.50
56 BuildRequires:  automake
57 BuildRequires:  libtool
58 BuildRequires:  rpmbuild(macros) >= 1.745
59 %if %{with kernel}
60 BuildRequires:  kernel-module-build >= 3:2.6.8
61 %endif
62 %if %{with userspace}
63 BuildRequires:  bison
64 %{?with_doc:BuildRequires:      docbook-utils}
65 BuildRequires:  flex
66 %{?with_guile:BuildRequires:    guile-devel >= 1.4}
67 %{?with_perl:BuildRequires:     perl-devel}
68 %{?with_php:BuildRequires:      %{php_name}-devel >= 3:5}
69 %{?with_python:BuildRequires:   python-devel >= 2}
70 BuildRequires:  readline-devel
71 %{?with_tcl:BuildRequires:      tcl-devel}
72 %endif
73 Requires:       %{pname}-libs = %{version}-%{release}
74 # for agilent_82357a and ni_usb_gpib
75 Suggests:       fxload
76 # for agilent_82357a, agilent/hp_82341, agilent/hp_82350a, ni_usb_gpib
77 Suggests:       linux-gpib-firmware
78 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
79
80 %description
81 The Linux GPIB package provides support for GPIB (IEEE 488) hardware.
82
83 %description -l pl.UTF-8
84 Pakiet Linux GPIB służy do obsługi sprzętu GPIB (IEEE 488).
85
86 %package hotplug
87 Summary:        Linux GPIB support for legacy USB hotplug
88 Summary(pl.UTF-8):      Obsługa Linux GPIB dla starego systemu hotplug USB
89 Group:          Applications/System
90 Requires:       %{pname} = %{version}-%{release}
91 Requires:       hotplug
92
93 %description hotplug
94 Linux GPIB support for legacy USB hotplug.
95
96 %description hotplug -l pl.UTF-8
97 Obsługa Linux GPIB dla starego systemu hotplug USB.
98
99 %package libs
100 Summary:        Shared GPIB library
101 Summary(pl.UTF-8):      Biblioteka współdzielona GPIB
102 Group:          Libraries
103
104 %description libs
105 Shared GPIB library.
106
107 %description libs -l pl.UTF-8
108 Biblioteka współdzielona GPIB.
109
110 %package devel
111 Summary:        Header file for GPIB library
112 Summary(pl.UTF-8):      Plik nagłówkowy biblioteki GPIB
113 Group:          Development/Libraries
114 Requires:       %{pname}-libs = %{version}-%{release}
115
116 %description devel
117 Header file for GPIB library.
118
119 %description devel -l pl.UTF-8
120 Plik nagłówkowy biblioteki GPIB.
121
122 %package static
123 Summary:        Static GPIB library
124 Summary(pl.UTF-8):      Biblioteka statyczna GPIB
125 Group:          Development/Libraries
126 Requires:       %{pname}-devel = %{version}-%{release}
127
128 %description static
129 Static GPIB library.
130
131 %description static -l pl.UTF-8
132 Biblioteka statyczna GPIB.
133
134 %package -n guile-gpib
135 Summary:        Guile bindings for GPIB library
136 Summary(pl.UTF-8):      Wiązania Guile do biblioteki GPIB
137 Group:          Development/Languages/Perl
138 Requires:       %{pname}-libs = %{version}-%{release}
139 Requires:       guile-libs
140
141 %description -n guile-gpib
142 Guile bindings for GPIB library.
143
144 %description -n guile-gpib -l pl.UTF-8
145 Wiązania Guile do biblioteki GPIB.
146
147 %package -n perl-gpib
148 Summary:        Perl bindings for GPIB library
149 Summary(pl.UTF-8):      Wiązania Perla do biblioteki GPIB
150 Group:          Development/Languages/Perl
151 Requires:       %{pname}-libs = %{version}-%{release}
152
153 %description -n perl-gpib
154 Perl bindings for GPIB library.
155
156 %description -n perl-gpib -l pl.UTF-8
157 Wiązania Perla do biblioteki GPIB.
158
159 %package -n %{php_name}-gpib
160 Summary:        PHP bindings for GPIB library
161 Summary(pl.UTF-8):      Wiązania PHP do biblioteki GPIB
162 Group:          Development/Languages/PHP
163 Provides:       php(gpib) = %{version}
164 Requires:       %{pname}-libs = %{version}-%{release}
165 %{?requires_php_extension}
166
167 %description -n %{php_name}-gpib
168 PHP bindings for GPIB library.
169
170 %description -n %{php_name}-gpib -l pl.UTF-8
171 Wiązania PHP do biblioteki GPIB.
172
173 %package -n python-gpib
174 Summary:        Python 2 bindings for GPIB library
175 Summary(pl.UTF-8):      Wiązania Pythona 2 do biblioteki GPIB
176 Group:          Libraries/Python
177 Requires:       %{pname}-libs = %{version}-%{release}
178 Requires:       python-libs
179
180 %description -n python-gpib
181 Python 2 bindings for GPIB library.
182
183 %description -n python-gpib -l pl.UTF-8
184 Wiązania Pythona 2 do biblioteki GPIB.
185
186 %package -n python3-gpib
187 Summary:        Python 3 bindings for GPIB library
188 Summary(pl.UTF-8):      Wiązania Pythona 3 do biblioteki GPIB
189 Group:          Libraries/Python
190 Requires:       %{pname}-libs = %{version}-%{release}
191 Requires:       python3-libs
192
193 %description -n python3-gpib
194 Python 3 bindings for GPIB library.
195
196 %description -n python3-gpib -l pl.UTF-8
197 Wiązania Pythona 3 do biblioteki GPIB.
198
199 %package -n tcl-gpib
200 Summary:        Tcl bindings for GPIB library
201 Summary(pl.UTF-8):      Wiązania Tcl-a do biblioteki GPIB
202 Group:          Libraries
203 Requires:       %{pname}-libs = %{version}-%{release}
204 Requires:       tcl
205
206 %description -n tcl-gpib
207 Tcl bindings for GPIB library.
208
209 %description -n tcl-gpib -l pl.UTF-8
210 Wiązania Tcl-a do biblioteki GPIB.
211
212 %package doc
213 Summary:        Linux-GPIB tools and library documentation
214 Summary(pl.UTF-8):      Dokumentacja narzędzi i biblioteki Linux-GPIB
215 License:        GFDL v1.2+ or GPL v2+
216 Group:          Documentation
217
218 %description doc
219 Linux-GPIB tools and library documentation.
220
221 %description doc -l pl.UTF-8
222 Dokumentacja narzędzi i biblioteki Linux-GPIB.
223
224 %define kernel_pkg()\
225 %package -n kernel%{_alt_kernel}-gpib\
226 Summary:        Linux GPIB drivers\
227 Summary(pl.UTF-8):      Sterowniki GPIB dla Linuksa\
228 Release:        %{rel}@%{_kernel_ver_str}\
229 Group:          Base/Kernel\
230 Requires(post,postun):  /sbin/depmod\
231 %requires_releq_kernel\
232 Requires(postun):       %releq_kernel\
233 \
234 %description -n kernel%{_alt_kernel}-gpib\
235 This package contains Linux drivers for GPIB (IEEE 488) hardware.\
236 \
237 %description -n kernel%{_alt_kernel}-gpib -l pl.UTF-8\
238 Ten pakiet zawiera sterowniki dla Linuksa do urządzeń GPIB (IEEE 488).\
239 \
240 %if %{with kernel}\
241 %files -n kernel%{_alt_kernel}-gpib\
242 %defattr(644,root,root,755)\
243 /lib/modules/%{_kernel_ver}/kernel/gpib\
244 %endif\
245 \
246 %post -n kernel%{_alt_kernel}-gpib\
247 %depmod %{_kernel_ver}\
248 \
249 %postun -n kernel%{_alt_kernel}-gpib\
250 %depmod %{_kernel_ver}\
251 %{nil}
252
253 %define build_kernel_pkg()\
254 %{__make} VERBOSE=1 LINUX_SRCDIR=%{_kernelsrcdir}\
255 cd drivers/gpib\
256 %ifarch %{ix86}\
257 %install_kernel_modules -D installed -m agilent_82350b/agilent_82350b,cb7210/cb7210,cec/cec_gpib,hp_82335/hp82335,ines/ines_gpib,nec7210/nec7210,sys/gpib_common,tms9914/tms9914,tnt4882/tnt4882%{?with_drivers_isa:,pc2/pc2_gpib}%{?with_drivers_usb:,agilent_82357a/agilent_82357a,lpvo_usb_gpib/lpvo_usb_gpib,ni_usb/ni_usb_gpib} -d kernel/gpib\
258 %else\
259 %install_kernel_modules -D installed -m agilent_82350b/agilent_82350b,cb7210/cb7210,cec/cec_gpib,hp_82335/hp82335,hp_82341/hp_82341,ines/ines_gpib,nec7210/nec7210,sys/gpib_common,tms9914/tms9914,tnt4882/tnt4882%{?with_drivers_isa:,pc2/pc2_gpib}%{?with_drivers_usb:,agilent_82357a/agilent_82357a,lpvo_usb_gpib/lpvo_usb_gpib,ni_usb/ni_usb_gpib} -d kernel/gpib\
260 %endif\
261 cd ../..\
262 %{nil}
263
264 %define install_kernel_pkg()\
265 %{nil}
266
267 %{?with_kernel:%{expand:%create_kernel_packages}}
268
269 %prep
270 %setup -q -n %{pname}-%{version}
271 %if %{with userspace}
272 tar xzf linux-gpib-user-%{version}.tar.gz
273 cd linux-gpib-user-%{version}
274 %patch2 -p1
275 %patch3 -p1
276 %patch4 -p1
277 %patch5 -p1
278 #%patch6 -p1
279 cd ..
280 %endif
281
282 %if %{with kernel}
283 tar xzf linux-gpib-kernel-%{version}.tar.gz
284 cd linux-gpib-kernel-%{version}
285 %ifarch %{ix86}
286 %patch8 -p1
287 %endif
288 %endif
289
290 %build
291 %if %{with userspace}
292 cd linux-gpib-user-%{version}
293 %{__libtoolize}
294 %{__aclocal}
295 %{__autoconf}
296 %{__autoheader}
297 %{__automake}
298 %if %{with guile}
299 CPPFLAGS="%{rpmcppflags} -I/usr/include/guile/2.2"
300 %endif
301 %configure \
302         --with-udev-libdir=/lib/udev \
303         %{!?with_doc:--disable-documentation} \
304         %{!?with_guile:--disable-guile-binding} \
305         %{!?with_perl:--disable-perl-binding} \
306         %{!?with_php:--disable-php-binding} \
307         %{!?with_python:--disable-python-binding} \
308         %{?with_static_libs:--enable-static} \
309         %{!?with_tcl:--disable-tcl-binding}
310
311 %{__make}
312
313 %if %{with python2}
314 cd language/python
315 %py_build
316 cd ../..
317 %endif
318 cd ..
319 %endif
320
321 %if %{with kernel}
322 cd linux-gpib-kernel-%{version}
323 %{expand:%build_kernel_packages}
324 %endif
325
326 %install
327 rm -rf $RPM_BUILD_ROOT
328 install -d $RPM_BUILD_ROOT%{_examplesdir}
329
330 %if %{with kernel}
331 cd linux-gpib-kernel-%{version}
332 %{expand:%install_kernel_packages}
333 cp -a drivers/gpib/installed/* $RPM_BUILD_ROOT
334 cd ..
335 %endif
336
337 %if %{with userspace}
338 cd linux-gpib-user-%{version}
339 %{__make} install \
340         DESTDIR=$RPM_BUILD_ROOT \
341         HOTPLUG_USB_CONF_DIR=/lib/udev \
342         UDEV_RULES_DIR=/lib/udev/rules.d \
343         USB_FIRMWARE_DIR=/lib/firmware
344
345 %if %{with python2}
346 cd language/python
347 %py_install
348 cd ../..
349 %endif
350
351 %if %{with hotplug}
352 # use udev paths as base and legacy hotplug as addon (not the opposite)
353 install -d $RPM_BUILD_ROOT/etc/hotplug/usb
354 %{__mv} $RPM_BUILD_ROOT/lib/udev/*.usermap $RPM_BUILD_ROOT/etc/hotplug/usb
355 ln -snf /lib/udev/agilent_82357a $RPM_BUILD_ROOT/etc/hotplug/usb/agilent_82357a
356 ln -snf /lib/udev/ni_usb_gpib $RPM_BUILD_ROOT/etc/hotplug/usb/ni_usb_gpib
357 %endif
358
359 # obsoleted by pkg-config
360 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib.la
361
362 %if %{with guile}
363 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.la
364 %if %{with static_libs}
365 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.a
366 %endif
367 %endif
368
369 %if %{with perl}
370 %{__make} -C language/perl pure_install \
371         DESTDIR=$RPM_BUILD_ROOT
372
373 cp -pr language/perl/examples $RPM_BUILD_ROOT%{_examplesdir}/perl-gpib-%{version}
374
375 %{__rm} -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/LinuxGpib/.packlist
376 %endif
377
378 %if %{with php}
379 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
380 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/gpib.ini
381 ; Enable gpib extension module
382 extension=gpib_php.so
383 EOF
384
385 %{__rm} $RPM_BUILD_ROOT%{php_extensiondir}/gpib_php.la
386 %if %{with static_libs}
387 %{__rm} $RPM_BUILD_ROOT%{php_extensiondir}/gpib_php.a
388 %endif
389 %endif
390
391 %if %{with python}
392 %py_postclean
393 %endif
394
395 %if %{with tcl}
396 cp -pr language/tcl/examples $RPM_BUILD_ROOT%{_examplesdir}/tcl-gpib-%{version}
397
398 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.la
399 %if %{with static_libs}
400 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.a
401 %endif
402 %endif
403
404 %if %{with doc}
405 # packaged as %doc
406 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/linux-gpib-user/html
407 %endif
408 %endif
409
410 %clean
411 rm -rf $RPM_BUILD_ROOT
412
413 %post   libs -p /sbin/ldconfig
414 %postun libs -p /sbin/ldconfig
415
416 %post   -n guile-gpib -p /sbin/ldconfig
417 %postun -n guile-gpib -p /sbin/ldconfig
418
419 %post   -n tcl-gpib -p /sbin/ldconfig
420 %postun -n tcl-gpib -p /sbin/ldconfig
421
422 %post   -n %{php_name}-gpib
423 %php_webserver_restart
424
425 %postun -n %{php_name}-gpib
426 if [ "$1" = 0 ]; then
427         %php_webserver_restart
428 fi
429
430 %if %{with userspace}
431 %files
432 %defattr(644,root,root,755)
433 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/gpib.conf
434 %attr(755,root,root) %{_bindir}/ibterm
435 %attr(755,root,root) %{_bindir}/ibtest
436 %attr(755,root,root) %{_sbindir}/gpib_config
437 /lib/udev/rules.d/98-gpib-generic.rules
438 /lib/udev/rules.d/99-agilent_82357a.rules
439 /lib/udev/rules.d/99-ni_usb_gpib.rules
440 %attr(755,root,root) /lib/udev/gpib_udev_config
441 %attr(755,root,root) /lib/udev/gpib_udev_fxloader
442 %attr(755,root,root) /lib/udev/gpib_udevadm_wrapper
443
444 %if %{with hotplug}
445 %files hotplug
446 %defattr(644,root,root,755)
447 %attr(755,root,root) /etc/hotplug/usb/agilent_82357a
448 %attr(755,root,root) /etc/hotplug/usb/ni_usb_gpib
449 /etc/hotplug/usb/agilent_82357a.usermap
450 /etc/hotplug/usb/ni_usb_gpib.usermap
451 %endif
452
453 %files libs
454 %defattr(644,root,root,755)
455 %doc linux-gpib-user-%{version}/{AUTHORS,ChangeLog,README,README.HAMEG,README.hp82335,TODO}
456 %attr(755,root,root) %{_libdir}/libgpib.so.*.*.*
457 %attr(755,root,root) %ghost %{_libdir}/libgpib.so.0
458
459 %files devel
460 %defattr(644,root,root,755)
461 %attr(755,root,root) %{_libdir}/libgpib.so
462 %{_includedir}/gpib
463 %{_pkgconfigdir}/libgpib.pc
464
465 %if %{with static_libs}
466 %files static
467 %defattr(644,root,root,755)
468 %{_libdir}/libgpib.a
469 %endif
470
471 %if %{with guile}
472 %files -n guile-gpib
473 %defattr(644,root,root,755)
474 %attr(755,root,root) %{_libdir}/libgpib-guile-%{version}.so
475 %attr(755,root,root) %{_libdir}/libgpib-guile.so
476 %endif
477
478 %if %{with perl}
479 %files -n perl-gpib
480 %defattr(644,root,root,755)
481 %doc linux-gpib-user-%{version}/language/perl/{Changes,README}
482 %{perl_vendorarch}/LinuxGpib.pm
483 %dir %{perl_vendorarch}/auto/LinuxGpib
484 %attr(755,root,root) %{perl_vendorarch}/auto/LinuxGpib/LinuxGpib.so
485 %{perl_vendorarch}/auto/LinuxGpib/autosplit.ix
486 %{_mandir}/man3/LinuxGpib.3pm*
487 %{_examplesdir}/perl-gpib-%{version}
488 %endif
489
490 %if %{with php}
491 %files -n %{php_name}-gpib
492 %defattr(644,root,root,755)
493 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/gpib.ini
494 %attr(755,root,root) %{php_extensiondir}/gpib_php-%{version}.so
495 %attr(755,root,root) %{php_extensiondir}/gpib_php.so
496 %endif
497
498 %if %{with python2}
499 %files -n python-gpib
500 %defattr(644,root,root,755)
501 %doc linux-gpib-user-%{version}/language/python/README
502 %attr(755,root,root) %{py_sitedir}/gpib.so
503 %{py_sitedir}/Gpib.py[co]
504 %{py_sitedir}/gpib-1.0-py*.egg-info
505 %endif
506
507 %if %{with python}
508 %files -n python3-gpib
509 %defattr(644,root,root,755)
510 %doc linux-gpib-user-%{version}/language/python/README
511 %attr(755,root,root) %{py3_sitedir}/gpib.cpython-*.so
512 %{py3_sitedir}/Gpib.py
513 %{py3_sitedir}/__pycache__/Gpib.cpython-*.py[co]
514 %{py3_sitedir}/gpib-1.0-py*.egg-info
515 %endif
516
517 %if %{with tcl}
518 %files -n tcl-gpib
519 %defattr(644,root,root,755)
520 %doc linux-gpib-user-%{version}/language/tcl/README
521 %attr(755,root,root) %{_libdir}/libgpib_tcl-%{version}.so
522 %attr(755,root,root) %{_libdir}/libgpib_tcl.so
523 %{_examplesdir}/tcl-gpib-%{version}
524 %endif
525
526 %if %{with doc}
527 %files doc
528 %defattr(644,root,root,755)
529 %doc linux-gpib-user-%{version}/doc/doc_html/*
530 %endif
531 %endif
This page took 0.117019 seconds and 3 git commands to generate.