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