]> git.pld-linux.org Git - packages/linux-gpib.git/blame_incremental - linux-gpib.spec
- fix release
[packages/linux-gpib.git] / linux-gpib.spec
... / ...
CommitLineData
1#
2# Conditional build:
3%bcond_without kernel # kernel modules
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
7%bcond_without userspace # userspace packages
8%bcond_without verbose # verbose modules build (V=1)
9
10%bcond_without docs # documentation build
11%bcond_with hotplug # legacy hotplug support
12%bcond_without static_libs # static library
13%bcond_without guile # guile binding
14%bcond_without perl # Perl binding
15%bcond_without php # PHP binding
16%bcond_without python # Python 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}
25exit 1
26%endif
27
28%ifnarch %{ix86}
29%undefine with_drivers_isa
30%undefine with_drivers_pcmcia
31%endif
32
33%include /usr/lib/rpm/macros.perl
34%define php_name php%{?php_suffix}
35
36%define rel 5
37%define pname linux-gpib
38Summary: GPIB (IEEE 488) Linux support
39Summary(pl.UTF-8): Obsługa GPIB (IEEE 488) dla Linuksa
40Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
41Version: 4.0.3
42Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
43License: GPL v2+
44Group: Applications/System
45Source0: http://downloads.sourceforge.net/linux-gpib/%{pname}-%{version}.tar.gz
46# Source0-md5: 2d97191e538a57ba7350fcc011ee2596
47Patch0: %{pname}-include_file.patch
48Patch1: %{pname}-destdir.patch
49Patch2: %{pname}-python.patch
50Patch3: %{pname}-perl.patch
51Patch4: %{pname}-firmwaredir.patch
52Patch5: %{pname}-guile2.patch
53Patch6: %{pname}-php7.patch
54URL: http://linux-gpib.sourceforge.net/
55BuildRequires: autoconf >= 2.50
56BuildRequires: automake
57BuildRequires: libtool
58BuildRequires: rpmbuild(macros) >= 1.614
59%if %{with kernel}
60BuildRequires: kernel-module-build >= 3:2.6.8
61%endif
62%if %{with userspace}
63BuildRequires: bison
64%{?with_docs:BuildRequires: docbook-utils}
65BuildRequires: 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}
70BuildRequires: readline-devel
71%{?with_tcl:BuildRequires: tcl-devel}
72%endif
73Requires: %{pname}-libs = %{version}-%{release}
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
78BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
79
80%description
81The Linux GPIB package provides support for GPIB (IEEE 488) hardware.
82
83%description -l pl.UTF-8
84Pakiet Linux GPIB służy do obsługi sprzętu GPIB (IEEE 488).
85
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
90Requires: %{pname} = %{version}-%{release}
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
99%package libs
100Summary: Shared GPIB library
101Summary(pl.UTF-8): Biblioteka współdzielona GPIB
102Group: Libraries
103
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
114Requires: %{pname}-libs = %{version}-%{release}
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
126Requires: %{pname}-devel = %{version}-%{release}
127
128%description static
129Static GPIB library.
130
131%description static -l pl.UTF-8
132Biblioteka statyczna GPIB.
133
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
138Requires: %{pname}-libs = %{version}-%{release}
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
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
151Requires: %{pname}-libs = %{version}-%{release}
152
153%description -n perl-gpib
154Perl bindings for GPIB library.
155
156%description -n perl-gpib -l pl.UTF-8
157Wiązania Perla do biblioteki GPIB.
158
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}
164Requires: %{pname}-libs = %{version}-%{release}
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
173%package -n python-gpib
174Summary: Python bindings for GPIB library
175Summary(pl.UTF-8): Wiązania Pythona do biblioteki GPIB
176Group: Libraries/Python
177Requires: %{pname}-libs = %{version}-%{release}
178Requires: python-libs
179
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
190Requires: %{pname}-libs = %{version}-%{release}
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()\
241TOPDIR=$(pwd)\
242%build_kernel_modules -C drivers/gpib -m gpib -- EARLYCPPFLAGS="-I$TOPDIR -I$TOPDIR/drivers/gpib/include -I$TOPDIR/include"\
243cd drivers/gpib\
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\
245cd ../..\
246%{nil}
247
248%define install_kernel_pkg()\
249%{nil}
250
251%{?with_kernel:%{expand:%create_kernel_packages}}
252
253%prep
254%setup -q -n %{pname}-%{version}
255%patch0 -p1
256%patch1 -p1
257%patch2 -p1
258%patch3 -p1
259%patch4 -p1
260%patch5 -p1
261%patch6 -p1
262
263# disable modules build by default, just install userspace header
264echo 'SUBDIRS = gpib/include' > drivers/Makefile.am
265
266# need to inject -I options before $(LINUXINCLUDE), the simplest way is to override CC
267for f in drivers/gpib/*/Makefile ; do
268echo 'override CC += $(EARLYCPPFLAGS)' >> $f
269done
270
271%build
272%{__libtoolize}
273%{__aclocal} -I m4
274%{__autoconf}
275%{__autoheader}
276%{__automake}
277%if %{with guile}
278CPPFLAGS="%{rpmcppflags} -I/usr/include/guile/2.0"
279%endif
280%configure \
281 %{?with_drivers_isa:--enable-isa} \
282 %{?with_drivers_pcmcia:--enable-pcmcia} \
283 %{!?with_docs:--disable-documentation} \
284 %{!?with_guile:--disable-guile-binding} \
285 %{!?with_perl:--disable-perl-binding} \
286 %{!?with_php:--disable-php-binding} \
287 %{!?with_python:--disable-python-binding} \
288 %{?with_static_libs:--enable-static} \
289 %{!?with_tcl:--disable-tcl-binding} \
290 --with-linux-srcdir=%{_kernelsrcdir}
291
292%if %{with userspace}
293%{__make}
294%endif
295
296%if %{with kernel}
297%{expand:%build_kernel_packages}
298%endif
299
300%install
301rm -rf $RPM_BUILD_ROOT
302install -d $RPM_BUILD_ROOT%{_examplesdir}
303
304%if %{with kernel}
305%{expand:%install_kernel_packages}
306cp -a drivers/gpib/installed/* $RPM_BUILD_ROOT
307%endif
308
309%if %{with userspace}
310%{__make} install \
311 DESTDIR=$RPM_BUILD_ROOT \
312 HOTPLUG_USB_CONF_DIR=/lib/udev \
313 UDEV_RULES_DIR=/lib/udev/rules.d \
314 USB_FIRMWARE_DIR=/lib/firmware
315
316%if %{with hotplug}
317# use udev paths as base and legacy hotplug as addon (not the opposite)
318install -d $RPM_BUILD_ROOT/etc/hotplug/usb
319%{__mv} $RPM_BUILD_ROOT/lib/udev/*.usermap $RPM_BUILD_ROOT/etc/hotplug/usb
320ln -snf /lib/udev/agilent_82357a $RPM_BUILD_ROOT/etc/hotplug/usb/agilent_82357a
321ln -snf /lib/udev/ni_usb_gpib $RPM_BUILD_ROOT/etc/hotplug/usb/ni_usb_gpib
322%else
323%{__rm} $RPM_BUILD_ROOT/lib/udev/*.usermap
324%endif
325
326# obsoleted by pkg-config
327%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib.la
328
329%if %{with guile}
330%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.la
331%if %{with static_libs}
332%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.a
333%endif
334%endif
335
336%if %{with perl}
337%{__make} -C language/perl pure_install \
338 DESTDIR=$RPM_BUILD_ROOT
339
340cp -pr language/perl/examples $RPM_BUILD_ROOT%{_examplesdir}/perl-gpib-%{version}
341
342%{__rm} -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/LinuxGpib/.packlist
343%endif
344
345%if %{with php}
346install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
347cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/gpib.ini
348; Enable gpib extension module
349extension=gpib_php.so
350EOF
351
352%{__rm} $RPM_BUILD_ROOT%{php_extensiondir}/gpib_php.la
353%if %{with static_libs}
354%{__rm} $RPM_BUILD_ROOT%{php_extensiondir}/gpib_php.a
355%endif
356%endif
357
358%if %{with python}
359%py_postclean
360%endif
361
362%if %{with tcl}
363cp -pr language/tcl/examples $RPM_BUILD_ROOT%{_examplesdir}/tcl-gpib-%{version}
364
365%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.la
366%if %{with static_libs}
367%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.a
368%endif
369%endif
370
371%if %{with docs}
372# packaged as %doc
373%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/linux-gpib/html
374%endif
375%endif
376
377%clean
378rm -rf $RPM_BUILD_ROOT
379
380%post libs -p /sbin/ldconfig
381%postun libs -p /sbin/ldconfig
382
383%post -n guile-gpib -p /sbin/ldconfig
384%postun -n guile-gpib -p /sbin/ldconfig
385
386%post -n tcl-gpib -p /sbin/ldconfig
387%postun -n tcl-gpib -p /sbin/ldconfig
388
389%post -n %{php_name}-gpib
390%php_webserver_restart
391
392%postun -n %{php_name}-gpib
393if [ "$1" = 0 ]; then
394 %php_webserver_restart
395fi
396
397%if %{with userspace}
398%files
399%defattr(644,root,root,755)
400%attr(755,root,root) %{_bindir}/ibterm
401%attr(755,root,root) %{_bindir}/ibtest
402%attr(755,root,root) %{_sbindir}/gpib_config
403/lib/udev/rules.d/99-agilent_82357a.rules
404/lib/udev/rules.d/99-gpib-generic.rules
405/lib/udev/rules.d/99-ni_usb_gpib.rules
406%attr(755,root,root) /lib/udev/agilent_82357a
407%attr(755,root,root) /lib/udev/ni_usb_gpib
408
409%if %{with hotplug}
410%files hotplug
411%defattr(644,root,root,755)
412%attr(755,root,root) /etc/hotplug/usb/agilent_82357a
413%attr(755,root,root) /etc/hotplug/usb/ni_usb_gpib
414/etc/hotplug/usb/agilent_82357a.usermap
415/etc/hotplug/usb/ni_usb_gpib.usermap
416%endif
417
418%files libs
419%defattr(644,root,root,755)
420%doc AUTHORS ChangeLog README README.HAMEG README.hp82335 TODO
421%attr(755,root,root) %{_libdir}/libgpib.so.*.*.*
422%attr(755,root,root) %ghost %{_libdir}/libgpib.so.0
423
424%files devel
425%defattr(644,root,root,755)
426%attr(755,root,root) %{_libdir}/libgpib.so
427%{_includedir}/gpib
428%{_pkgconfigdir}/libgpib.pc
429
430%if %{with static_libs}
431%files static
432%defattr(644,root,root,755)
433%{_libdir}/libgpib.a
434%endif
435
436%if %{with guile}
437%files -n guile-gpib
438%defattr(644,root,root,755)
439%attr(755,root,root) %{_libdir}/libgpib-guile-%{version}.so
440%attr(755,root,root) %{_libdir}/libgpib-guile.so
441%endif
442
443%if %{with perl}
444%files -n perl-gpib
445%defattr(644,root,root,755)
446%doc language/perl/{Changes,README}
447%{perl_vendorarch}/LinuxGpib.pm
448%dir %{perl_vendorarch}/auto/LinuxGpib
449%attr(755,root,root) %{perl_vendorarch}/auto/LinuxGpib/LinuxGpib.so
450%{perl_vendorarch}/auto/LinuxGpib/autosplit.ix
451%{_mandir}/man3/LinuxGpib.3pm*
452%{_examplesdir}/perl-gpib-%{version}
453%endif
454
455%if %{with php}
456%files -n %{php_name}-gpib
457%defattr(644,root,root,755)
458%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/gpib.ini
459%attr(755,root,root) %{php_extensiondir}/gpib_php-%{version}.so
460%attr(755,root,root) %{php_extensiondir}/gpib_php.so
461%endif
462
463%if %{with python}
464%files -n python-gpib
465%defattr(644,root,root,755)
466%doc language/python/README
467%attr(755,root,root) %{py_sitedir}/gpib.so
468%{py_sitedir}/Gpib.py[co]
469%{py_sitedir}/gpib-1.0-py*.egg-info
470%endif
471
472%if %{with tcl}
473%files -n tcl-gpib
474%defattr(644,root,root,755)
475%doc language/tcl/README
476%attr(755,root,root) %{_libdir}/libgpib_tcl-%{version}.so
477%attr(755,root,root) %{_libdir}/libgpib_tcl.so
478%{_examplesdir}/tcl-gpib-%{version}
479%endif
480
481%if %{with docs}
482%files doc
483%defattr(644,root,root,755)
484%doc doc/doc_html/*
485%endif
486%endif
This page took 0.030176 seconds and 4 git commands to generate.