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