]> git.pld-linux.org Git - packages/linux-gpib.git/blame - linux-gpib.spec
- updated to 4.0.3
[packages/linux-gpib.git] / linux-gpib.spec
CommitLineData
2ee896be
JB
1# TODO:
2# - resolve udev vs hotplug issues (use /lib/udev/rules.d, don't require /etc/hotplug dir with udev)
3# - guile 2 support
4# - PHP 7 support
d4054fe9 5#
d4054fe9 6# Conditional build:
2ee896be
JB
7%bcond_without kernel # kernel modules
8%bcond_without userspace # userspace packages
9%bcond_without verbose # verbose modules build (V=1)
df990a65 10
2ee896be
JB
11%bcond_without docs # documentation build
12%bcond_without static_libs # static library
13%bcond_with 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
df990a65 18
2ee896be
JB
19Summary: GPIB (IEEE 488) Linux support
20Summary(pl.UTF-8): Obsługa GPIB (IEEE 488) dla Linuksa
d4054fe9 21Name: linux-gpib
2ee896be
JB
22Version: 4.0.3
23%define rel 0.1
24Release: %{rel}
25License: GPL v2+
cc64c2aa 26Group: Applications/System
2ee896be
JB
27Source0: http://downloads.sourceforge.net/linux-gpib/%{name}-%{version}.tar.gz
28# Source0-md5: 2d97191e538a57ba7350fcc011ee2596
8eefbf3b 29Patch0: %{name}-include_file.patch
2ee896be
JB
30Patch1: %{name}-destdir.patch
31Patch2: %{name}-python.patch
32Patch3: %{name}-perl.patch
d4054fe9 33URL: http://linux-gpib.sourceforge.net/
2ee896be
JB
34BuildRequires: autoconf >= 2.50
35BuildRequires: automake
36BuildRequires: libtool
37BuildRequires: rpmbuild(macros) >= 1.614
d4054fe9 38%if %{with kernel}
2ee896be 39BuildRequires: kernel-module-build >= 3:2.6.8
d4054fe9 40%endif
2ee896be
JB
41%if %{with userspace}
42BuildRequires: bison
43%{?with_docs:BuildRequires: docbook-utils}
44BuildRequires: flex
45%{?with_guile:BuildRequires: guile-devel < 5:2.0}
df990a65 46%{?with_perl:BuildRequires: perl-devel}
2ee896be
JB
47%{?with_php:BuildRequires: php-devel < 4:7}
48%{?with_python:BuildRequires: python-devel >= 2}
49BuildRequires: readline-devel
df990a65 50%{?with_tcl:BuildRequires: tcl-devel}
2ee896be
JB
51%endif
52Requires: %{name}-libs = %{version}-%{release}
d4054fe9 53BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54
55%description
cc64c2aa 56The Linux GPIB package provides support for GPIB (IEEE 488) hardware.
d4054fe9 57
bc9733fa
JR
58%description -l pl.UTF-8
59Pakiet Linux GPIB służy do obsługi sprzętu GPIB (IEEE 488).
d4054fe9 60
2ee896be
JB
61%package libs
62Summary: Shared GPIB library
63Summary(pl.UTF-8): Biblioteka współdzielona GPIB
64Group: Libraries
d7b3679a 65
2ee896be
JB
66%description libs
67Shared GPIB library.
68
69%description libs -l pl.UTF-8
70Biblioteka współdzielona GPIB.
71
72%package devel
73Summary: Header file for GPIB library
74Summary(pl.UTF-8): Plik nagłówkowy biblioteki GPIB
75Group: Development/Libraries
76Requires: %{name}-libs = %{version}-%{release}
77
78%description devel
79Header file for GPIB library.
80
81%description devel -l pl.UTF-8
82Plik nagłówkowy biblioteki GPIB.
83
84%package static
85Summary: Static GPIB library
86Summary(pl.UTF-8): Biblioteka statyczna GPIB
87Group: Development/Libraries
88Requires: %{name}-devel = %{version}-%{release}
89
90%description static
91Static GPIB library.
92
93%description static -l pl.UTF-8
94Biblioteka statyczna GPIB.
95
96%package -n perl-gpib
97Summary: Perl bindings for GPIB library
98Summary(pl.UTF-8): Wiązania Perla do biblioteki GPIB
99Group: Development/Languages/Perl
100Requires: %{name}-libs = %{version}-%{release}
d7b3679a 101
2ee896be
JB
102%description -n perl-gpib
103Perl bindings for GPIB library.
d7b3679a 104
2ee896be
JB
105%description -n perl-gpib -l pl.UTF-8
106Wiązania Perla do biblioteki GPIB.
d7b3679a 107
2ee896be
JB
108%package -n python-gpib
109Summary: Python bindings for GPIB library
110Summary(pl.UTF-8): Wiązania Pythona do biblioteki GPIB
111Group: Libraries/Python
112Requires: %{name}-libs = %{version}-%{release}
113Requires: python-libs
d7b3679a 114
2ee896be
JB
115%description -n python-gpib
116Python bindings for GPIB library.
117
118%description -n python-gpib -l pl.UTF-8
119Wiązania Pythona do biblioteki GPIB.
120
121%package -n tcl-gpib
122Summary: Tcl bindings for GPIB library
123Summary(pl.UTF-8): Wiązania Tcl-a do biblioteki GPIB
124Group: Libraries
125Requires: %{name}-libs = %{version}-%{release}
126Requires: tcl
127
128%description -n tcl-gpib
129Tcl bindings for GPIB library.
130
131%description -n tcl-gpib -l pl.UTF-8
132Wiązania Tcl-a do biblioteki GPIB.
133
134%package doc
135Summary: Linux-GPIB tools and library documentation
136Summary(pl.UTF-8): Dokumentacja narzędzi i biblioteki Linux-GPIB
137License: GFDL v1.2+ or GPL v2+
138Group: Documentation
139
140%description doc
141Linux-GPIB tools and library documentation.
142
143%description doc -l pl.UTF-8
144Dokumentacja narzędzi i biblioteki Linux-GPIB.
145
146%define kernel_pkg()\
147%package -n kernel%{_alt_kernel}-gpib\
148Summary: Linux GPIB drivers\
149Summary(pl.UTF-8): Sterowniki GPIB dla Linuksa\
150Release: %{rel}@%{_kernel_ver_str}\
151Group: Base/Kernel\
152Requires(post,postun): /sbin/depmod\
153%requires_releq_kernel\
154Requires(postun): %releq_kernel\
155\
156%description -n kernel%{_alt_kernel}-gpib\
157This package contains Linux drivers for GPIB (IEEE 488) hardware.\
158\
159%description -n kernel%{_alt_kernel}-gpib -l pl.UTF-8\
160Ten pakiet zawiera sterowniki dla Linuksa do urządzeń GPIB (IEEE 488).\
161\
162%if %{with kernel}\
163%files -n kernel%{_alt_kernel}-gpib\
164%defattr(644,root,root,755)\
165/lib/modules/%{_kernel_ver}/kernel/gpib\
166%endif\
167\
168%post -n kernel%{_alt_kernel}-gpib\
169%depmod %{_kernel_ver}\
170\
171%postun -n kernel%{_alt_kernel}-gpib\
172%depmod %{_kernel_ver}\
173%{nil}
174
175%define build_kernel_pkg()\
176TOPDIR=$(pwd)\
177%build_kernel_modules -C drivers/gpib -m gpib -- EARLYCPPFLAGS="-I$TOPDIR -I$TOPDIR/drivers/gpib/include -I$TOPDIR/include"\
178cd drivers/gpib\
179%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\
180%{nil}
181
182%define install_kernel_pkg()\
183%{nil}
184
185%{?with_kernel:%{expand:%create_kernel_packages}}
d7b3679a 186
d4054fe9 187%prep
d7b3679a 188%setup -q
8eefbf3b 189%patch0 -p1
2ee896be
JB
190%patch1 -p1
191%patch2 -p1
192%patch3 -p1
193
194# disable modules build by default, just install userspace header
195echo 'SUBDIRS = gpib/include' > drivers/Makefile.am
196
197# need to inject -I options before $(LINUXINCLUDE), the simplest way is to override CC
198for f in drivers/gpib/*/Makefile ; do
199echo 'override CC += $(EARLYCPPFLAGS)' >> $f
200done
d7b3679a 201
d4054fe9 202%build
d7b3679a 203%{__libtoolize}
2ee896be 204%{__aclocal} -I m4
d7b3679a 205%{__autoconf}
2ee896be 206%{__autoheader}
d7b3679a 207%{__automake}
d7b3679a 208%configure \
2ee896be
JB
209%ifarch %{ix86}
210 --enable-isa \
211 --enable-pcmcia \
212%endif
213 %{!?with_docs:--disable-documentation} \
214 %{!?with_guile:--disable-guile-binding} \
215 %{!?with_perl:--disable-perl-binding} \
216 %{!?with_php:--disable-php-binding} \
217 %{!?with_python:--disable-python-binding} \
218 %{?with_static_libs:--enable-static} \
219 %{!?with_tcl:--disable-tcl-binding} \
220 --with-linux-srcdir=%{_kernelsrcdir}
d7b3679a 221
2ee896be 222%if %{with userspace}
9e3b7024 223%{__make}
2ee896be 224%endif
d7b3679a 225
2ee896be
JB
226%if %{with kernel}
227%{expand:%build_kernel_packages}
228%endif
d4054fe9 229
230%install
231rm -rf $RPM_BUILD_ROOT
2ee896be 232install -d $RPM_BUILD_ROOT%{_examplesdir}
d4054fe9 233
8eefbf3b 234%if %{with kernel}
2ee896be
JB
235%{expand:%install_kernel_packages}
236cp -a drivers/gpib/installed/* $RPM_BUILD_ROOT
8eefbf3b
MWP
237%endif
238
d4054fe9 239%if %{with userspace}
9e3b7024 240%{__make} install \
2ee896be
JB
241 DESTDIR=$RPM_BUILD_ROOT
242
243# obsoleted by pkg-config
244%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib.la
245
246%if %{with perl}
247%{__make} -C language/perl pure_install \
248 DESTDIR=$RPM_BUILD_ROOT
249cp -pr language/perl/examples $RPM_BUILD_ROOT%{_examplesdir}/perl-gpib-%{version}
250%{__rm} -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/LinuxGpib/.packlist
251%endif
252
253%if %{with python}
254%py_postclean
255%endif
256
257%if %{with tcl}
258cp -pr language/tcl/examples $RPM_BUILD_ROOT%{_examplesdir}/tcl-gpib-%{version}
259%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.la
260%if %{with static_libs}
261%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib_tcl.a
262%endif
263%endif
264
265%if %{with docs}
266# packaged as %doc
267%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/linux-gpib/html
268%endif
d4054fe9 269%endif
270
d4054fe9 271%clean
272rm -rf $RPM_BUILD_ROOT
273
2ee896be
JB
274%post libs -p /sbin/ldconfig
275%postun libs -p /sbin/ldconfig
d4054fe9 276
2ee896be
JB
277%if %{with userspace}
278%files
279%defattr(644,root,root,755)
280%attr(755,root,root) %{_bindir}/ibterm
281%attr(755,root,root) %{_bindir}/ibtest
282%attr(755,root,root) %{_sbindir}/gpib_config
283# TODO: move to /lib/udev/rules.d
284/etc/udev/rules.d/99-agilent_82357a.rules
285/etc/udev/rules.d/99-gpib-generic.rules
286/etc/udev/rules.d/99-ni_usb_gpib.rules
287# TODO: paths to fix (scripts used also in udev .rules)
288%attr(755,root,root) /etc/hotplug/usb/agilent_82357a
289%attr(755,root,root) /etc/hotplug/usb/ni_usb_gpib
290/etc/hotplug/usb/agilent_82357a.usermap
291/etc/hotplug/usb/ni_usb_gpib.usermap
292# /lib/firmware/...; and where are the files?
293%dir %{_datadir}/usb/agilent_82357a
294%dir %{_datadir}/usb/ni_usb_gpib
d4054fe9 295
2ee896be 296%files libs
0e4898e2 297%defattr(644,root,root,755)
2ee896be
JB
298%doc AUTHORS ChangeLog README README.HAMEG README.hp82335 TODO
299%attr(755,root,root) %{_libdir}/libgpib.so.*.*.*
300%attr(755,root,root) %ghost %{_libdir}/libgpib.so.0
301
302%files devel
303%defattr(644,root,root,755)
304%attr(755,root,root) %{_libdir}/libgpib.so
305%{_includedir}/gpib
306%{_pkgconfigdir}/libgpib.pc
307
308%if %{with static_libs}
309%files static
310%defattr(644,root,root,755)
311%{_libdir}/libgpib.a
312%endif
313
314%if %{with perl}
315%files -n perl-gpib
316%defattr(644,root,root,755)
317%doc language/perl/{Changes,README}
318%{perl_vendorarch}/LinuxGpib.pm
319%dir %{perl_vendorarch}/auto/LinuxGpib
320%attr(755,root,root) %{perl_vendorarch}/auto/LinuxGpib/LinuxGpib.so
321%{perl_vendorarch}/auto/LinuxGpib/autosplit.ix
322%{_mandir}/man3/LinuxGpib.3pm*
323%{_examplesdir}/perl-gpib-%{version}
324%endif
325
326%if %{with python}
327%files -n python-gpib
328%defattr(644,root,root,755)
329%doc language/python/README
330%attr(755,root,root) %{py_sitedir}/gpib.so
331%{py_sitedir}/Gpib.py[co]
332%{py_sitedir}/gpib-1.0-py*.egg-info
333%endif
334
335%if %{with tcl}
336%files -n tcl-gpib
337%defattr(644,root,root,755)
338%doc language/tcl/README
339%attr(755,root,root) %{_libdir}/libgpib_tcl-%{version}.so
340%attr(755,root,root) %{_libdir}/libgpib_tcl.so
341%{_examplesdir}/tcl-gpib-%{version}
342%endif
343
344%if %{with docs}
345%files doc
346%defattr(644,root,root,755)
347%doc doc/doc_html/*
348%endif
1fc85825 349%endif
This page took 0.130196 seconds and 4 git commands to generate.