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