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