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