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