]>
Commit | Line | Data |
---|---|---|
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 |
19 | Summary: GPIB (IEEE 488) Linux support |
20 | Summary(pl.UTF-8): Obsługa GPIB (IEEE 488) dla Linuksa | |
d4054fe9 | 21 | Name: linux-gpib |
2ee896be JB |
22 | Version: 4.0.3 |
23 | %define rel 0.1 | |
24 | Release: %{rel} | |
25 | License: GPL v2+ | |
cc64c2aa | 26 | Group: Applications/System |
2ee896be JB |
27 | Source0: http://downloads.sourceforge.net/linux-gpib/%{name}-%{version}.tar.gz |
28 | # Source0-md5: 2d97191e538a57ba7350fcc011ee2596 | |
8eefbf3b | 29 | Patch0: %{name}-include_file.patch |
2ee896be JB |
30 | Patch1: %{name}-destdir.patch |
31 | Patch2: %{name}-python.patch | |
32 | Patch3: %{name}-perl.patch | |
d4054fe9 | 33 | URL: http://linux-gpib.sourceforge.net/ |
2ee896be JB |
34 | BuildRequires: autoconf >= 2.50 |
35 | BuildRequires: automake | |
36 | BuildRequires: libtool | |
37 | BuildRequires: rpmbuild(macros) >= 1.614 | |
d4054fe9 | 38 | %if %{with kernel} |
2ee896be | 39 | BuildRequires: kernel-module-build >= 3:2.6.8 |
d4054fe9 | 40 | %endif |
2ee896be JB |
41 | %if %{with userspace} |
42 | BuildRequires: bison | |
43 | %{?with_docs:BuildRequires: docbook-utils} | |
44 | BuildRequires: 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} | |
49 | BuildRequires: readline-devel | |
df990a65 | 50 | %{?with_tcl:BuildRequires: tcl-devel} |
2ee896be JB |
51 | %endif |
52 | Requires: %{name}-libs = %{version}-%{release} | |
d4054fe9 | 53 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
54 | ||
55 | %description | |
cc64c2aa | 56 | The Linux GPIB package provides support for GPIB (IEEE 488) hardware. |
d4054fe9 | 57 | |
bc9733fa JR |
58 | %description -l pl.UTF-8 |
59 | Pakiet Linux GPIB służy do obsługi sprzętu GPIB (IEEE 488). | |
d4054fe9 | 60 | |
2ee896be JB |
61 | %package libs |
62 | Summary: Shared GPIB library | |
63 | Summary(pl.UTF-8): Biblioteka współdzielona GPIB | |
64 | Group: Libraries | |
d7b3679a | 65 | |
2ee896be JB |
66 | %description libs |
67 | Shared GPIB library. | |
68 | ||
69 | %description libs -l pl.UTF-8 | |
70 | Biblioteka współdzielona GPIB. | |
71 | ||
72 | %package devel | |
73 | Summary: Header file for GPIB library | |
74 | Summary(pl.UTF-8): Plik nagłówkowy biblioteki GPIB | |
75 | Group: Development/Libraries | |
76 | Requires: %{name}-libs = %{version}-%{release} | |
77 | ||
78 | %description devel | |
79 | Header file for GPIB library. | |
80 | ||
81 | %description devel -l pl.UTF-8 | |
82 | Plik nagłówkowy biblioteki GPIB. | |
83 | ||
84 | %package static | |
85 | Summary: Static GPIB library | |
86 | Summary(pl.UTF-8): Biblioteka statyczna GPIB | |
87 | Group: Development/Libraries | |
88 | Requires: %{name}-devel = %{version}-%{release} | |
89 | ||
90 | %description static | |
91 | Static GPIB library. | |
92 | ||
93 | %description static -l pl.UTF-8 | |
94 | Biblioteka statyczna GPIB. | |
95 | ||
96 | %package -n perl-gpib | |
97 | Summary: Perl bindings for GPIB library | |
98 | Summary(pl.UTF-8): Wiązania Perla do biblioteki GPIB | |
99 | Group: Development/Languages/Perl | |
100 | Requires: %{name}-libs = %{version}-%{release} | |
d7b3679a | 101 | |
2ee896be JB |
102 | %description -n perl-gpib |
103 | Perl bindings for GPIB library. | |
d7b3679a | 104 | |
2ee896be JB |
105 | %description -n perl-gpib -l pl.UTF-8 |
106 | Wiązania Perla do biblioteki GPIB. | |
d7b3679a | 107 | |
2ee896be JB |
108 | %package -n python-gpib |
109 | Summary: Python bindings for GPIB library | |
110 | Summary(pl.UTF-8): Wiązania Pythona do biblioteki GPIB | |
111 | Group: Libraries/Python | |
112 | Requires: %{name}-libs = %{version}-%{release} | |
113 | Requires: python-libs | |
d7b3679a | 114 | |
2ee896be JB |
115 | %description -n python-gpib |
116 | Python bindings for GPIB library. | |
117 | ||
118 | %description -n python-gpib -l pl.UTF-8 | |
119 | Wiązania Pythona do biblioteki GPIB. | |
120 | ||
121 | %package -n tcl-gpib | |
122 | Summary: Tcl bindings for GPIB library | |
123 | Summary(pl.UTF-8): Wiązania Tcl-a do biblioteki GPIB | |
124 | Group: Libraries | |
125 | Requires: %{name}-libs = %{version}-%{release} | |
126 | Requires: tcl | |
127 | ||
128 | %description -n tcl-gpib | |
129 | Tcl bindings for GPIB library. | |
130 | ||
131 | %description -n tcl-gpib -l pl.UTF-8 | |
132 | Wiązania Tcl-a do biblioteki GPIB. | |
133 | ||
134 | %package doc | |
135 | Summary: Linux-GPIB tools and library documentation | |
136 | Summary(pl.UTF-8): Dokumentacja narzędzi i biblioteki Linux-GPIB | |
137 | License: GFDL v1.2+ or GPL v2+ | |
138 | Group: Documentation | |
139 | ||
140 | %description doc | |
141 | Linux-GPIB tools and library documentation. | |
142 | ||
143 | %description doc -l pl.UTF-8 | |
144 | Dokumentacja narzędzi i biblioteki Linux-GPIB. | |
145 | ||
146 | %define kernel_pkg()\ | |
147 | %package -n kernel%{_alt_kernel}-gpib\ | |
148 | Summary: Linux GPIB drivers\ | |
149 | Summary(pl.UTF-8): Sterowniki GPIB dla Linuksa\ | |
150 | Release: %{rel}@%{_kernel_ver_str}\ | |
151 | Group: Base/Kernel\ | |
152 | Requires(post,postun): /sbin/depmod\ | |
153 | %requires_releq_kernel\ | |
154 | Requires(postun): %releq_kernel\ | |
155 | \ | |
156 | %description -n kernel%{_alt_kernel}-gpib\ | |
157 | This package contains Linux drivers for GPIB (IEEE 488) hardware.\ | |
158 | \ | |
159 | %description -n kernel%{_alt_kernel}-gpib -l pl.UTF-8\ | |
160 | Ten 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()\ | |
176 | TOPDIR=$(pwd)\ | |
177 | %build_kernel_modules -C drivers/gpib -m gpib -- EARLYCPPFLAGS="-I$TOPDIR -I$TOPDIR/drivers/gpib/include -I$TOPDIR/include"\ | |
178 | cd 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 | |
195 | echo 'SUBDIRS = gpib/include' > drivers/Makefile.am | |
196 | ||
197 | # need to inject -I options before $(LINUXINCLUDE), the simplest way is to override CC | |
198 | for f in drivers/gpib/*/Makefile ; do | |
199 | echo 'override CC += $(EARLYCPPFLAGS)' >> $f | |
200 | done | |
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 | |
231 | rm -rf $RPM_BUILD_ROOT | |
2ee896be | 232 | install -d $RPM_BUILD_ROOT%{_examplesdir} |
d4054fe9 | 233 | |
8eefbf3b | 234 | %if %{with kernel} |
2ee896be JB |
235 | %{expand:%install_kernel_packages} |
236 | cp -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 | |
249 | cp -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} | |
258 | cp -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 |
272 | rm -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 |