]>
Commit | Line | Data |
---|---|---|
50fc6553 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with npapi # NPAPI plugin (nothing really yet) | |
4 | %bcond_with tests # perform "make test" for perl module (needs X display) | |
5 | # | |
6 | %include /usr/lib/rpm/macros.perl | |
7 | Summary: ZBar Bar Code Reader | |
8 | Summary(pl.UTF-8): ZBar - czytnik kodów paskowych | |
9 | Name: zbar | |
10 | Version: 0.10 | |
94f641c2 | 11 | Release: 17 |
50fc6553 JB |
12 | License: LGPL v2.1+ |
13 | Group: Libraries | |
14 | Source0: http://downloads.sourceforge.net/zbar/%{name}-%{version}.tar.bz2 | |
15 | # Source0-md5: 0fd61eb590ac1bab62a77913c8b086a5 | |
9c696e8e AM |
16 | Patch0: zbar_update_to_hg.patch |
17 | Patch1: %{name}-link.patch | |
18 | Patch2: %{name}-npapi.patch | |
19 | Patch3: zbar_use_libv4l.patch | |
20 | Patch4: %{name}-ac.patch | |
50fc6553 JB |
21 | URL: http://zbar.sourceforge.net/ |
22 | BuildRequires: ImageMagick-devel >= 1:6.2.6 | |
23 | BuildRequires: QtCore-devel >= 4 | |
24 | BuildRequires: QtGui-devel >= 4 | |
25 | BuildRequires: autoconf >= 2.61 | |
26 | BuildRequires: automake >= 1:1.10 | |
b00c1316 | 27 | BuildRequires: gettext-tools |
50fc6553 JB |
28 | BuildRequires: gtk+2-devel >= 2.0 |
29 | BuildRequires: libjpeg-devel | |
30 | BuildRequires: libtool >= 2:2.2 | |
9c696e8e | 31 | BuildRequires: libv4l-devel |
50fc6553 JB |
32 | BuildRequires: perl-devel >= 1:5.8.0 |
33 | BuildRequires: pkgconfig | |
34 | BuildRequires: python-devel >= 2.3.5 | |
35 | BuildRequires: python-pygtk-devel >= 2:2.0 | |
815bb45b | 36 | BuildRequires: qt4-build >= 4 |
50fc6553 | 37 | BuildRequires: rpm-perlprov >= 4.1-13 |
815bb45b | 38 | BuildRequires: rpm-pythonprov |
50fc6553 | 39 | BuildRequires: rpmbuild(macros) >= 1.357 |
50fc6553 JB |
40 | BuildRequires: xorg-lib-libXext-devel |
41 | BuildRequires: xorg-lib-libXv-devel | |
42 | Requires: ImageMagick-libs >= 1:6.2.6 | |
43 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
44 | ||
45 | %description | |
46 | ZBar Bar Code Reader is an open source software suite for reading bar | |
47 | codes from various sources, such as video streams, image files and raw | |
48 | intensity sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128, | |
49 | Code 39, Interleaved 2 of 5 and QR Code. Included with the library are | |
50 | basic applications for decoding captured bar code images and using a | |
51 | video device (eg, webcam) as a bar code scanner. For application | |
52 | developers, language bindings are available for C, C++, Python and | |
53 | Perl as well as GUI widgets for Qt, GTK+ and PyGTK. | |
54 | ||
55 | %description -l pl.UTF-8 | |
56 | ZBar Bar Code Reader to zestaw oprogramowania do odczytu kodów | |
815bb45b | 57 | paskowych z różnych źródeł, takich jak strumienie wideo, pliki obrazów |
58 | oraz czujniki jasności. Obsługuje kody EAN-13/UPC-A, UPC-E, EAN-8, | |
59 | Code 128, Code 39, Interleaved 2 of 5 oraz QR Code. Do biblioteki | |
60 | dołączone są podstawowe aplikacje do dekodowania wyłapanych obrazów | |
61 | kodów paskowych oraz używania urządzeń wejściowych obrazu (np. kamer | |
62 | internetowych) jako skanera kodów paskowych. Dla programistów są | |
50fc6553 JB |
63 | dostępne też wiązania dla C, C++, Pythona, Perla oraz widgety GUI dla |
64 | Qt, GTK+ oraz PyGTK. | |
65 | ||
66 | %package devel | |
67 | Summary: C and C++ header files for ZBar library | |
68 | Summary(pl.UTF-8): Pliki nagłówkowe C i C++ dla biblioteki ZBar | |
69 | Group: Development/Libraries | |
70 | Requires: %{name} = %{version}-%{release} | |
71 | Requires: libjpeg-devel | |
72 | Requires: xorg-lib-libXext-devel | |
73 | Requires: xorg-lib-libXv-devel | |
74 | ||
75 | %description devel | |
76 | C and C++ header files for ZBar library. | |
77 | ||
78 | %description devel -l pl.UTF-8 | |
79 | Pliki nagłówkowe C i C++ dla biblioteki ZBar. | |
80 | ||
81 | %package static | |
82 | Summary: Static ZBar library | |
83 | Summary(pl.UTF-8): Statyczna biblioteka ZBar | |
84 | Group: Development/Libraries | |
85 | Requires: %{name}-devel = %{version}-%{release} | |
86 | ||
87 | %description static | |
88 | Static ZBar library. | |
89 | ||
90 | %description static -l pl.UTF-8 | |
91 | Statyczna biblioteka ZBar. | |
92 | ||
93 | %package gtk | |
94 | Summary: Bar code scanning and decoding GTK+ widget | |
95 | Summary(pl.UTF-8): Widget GTK+ do skanowania i dekodowania kodów paskowych | |
96 | Group: X11/Libraries | |
97 | Requires: %{name} = %{version}-%{release} | |
98 | ||
99 | %description gtk | |
100 | Bar code scanning and decoding GTK+ widget. | |
101 | ||
102 | %description gtk -l pl.UTF-8 | |
103 | Widget GTK+ do skanowania i dekodowania kodów paskowych. | |
104 | ||
105 | %package gtk-devel | |
106 | Summary: Header file for bar code scanning and decoding GTK+ widget | |
107 | Summary(pl.UTF-8): Plik nagłówkowy widgetu GTK+ do skanowania i dekodowania kodów paskowych | |
108 | Group: X11/Development/Libraries | |
109 | Requires: %{name}-devel = %{version}-%{release} | |
110 | Requires: %{name}-gtk = %{version}-%{release} | |
111 | Requires: gtk+2-devel >= 2.0 | |
112 | ||
113 | %description gtk-devel | |
114 | Header file for bar code scanning and decoding GTK+ widget. | |
115 | ||
116 | %description gtk-devel -l pl.UTF-8 | |
117 | Plik nagłówkowy widgetu GTK+ do skanowania i dekodowania kodów | |
118 | paskowych. | |
119 | ||
120 | %package gtk-static | |
121 | Summary: Bar code scanning and decoding GTK+ widget - static library | |
122 | Summary(pl.UTF-8): Widget GTK+ do skanowania i dekodowania kodów paskowych - biblioteka statyczna | |
123 | Group: X11/Development/Libraries | |
124 | Requires: %{name}-gtk-devel = %{version}-%{release} | |
125 | ||
126 | %description gtk-static | |
127 | Bar code scanning and decoding GTK+ widget - static library. | |
128 | ||
129 | %description gtk-static -l pl.UTF-8 | |
130 | Widget GTK+ do skanowania i dekodowania kodów paskowych - biblioteka | |
131 | statyczna. | |
132 | ||
133 | %package qt | |
134 | Summary: Bar code scanning and decoding Qt4 widget | |
135 | Summary(pl.UTF-8): Widget Qt4 do skanowania i dekodowania kodów paskowych | |
136 | Group: X11/Libraries | |
137 | Requires: %{name} = %{version}-%{release} | |
138 | ||
139 | %description qt | |
140 | Bar code scanning and decoding Qt4 widget. | |
141 | ||
142 | %description qt -l pl.UTF-8 | |
143 | Widget Qt4 do skanowania i dekodowania kodów paskowych. | |
144 | ||
145 | %package qt-devel | |
146 | Summary: Header file for bar code scanning and decoding Qt4 widget | |
147 | Summary(pl.UTF-8): Plik nagłówkowy widgetu Qt4 do skanowania i dekodowania kodów paskowych | |
148 | Group: X11/Development/Libraries | |
149 | Requires: %{name}-devel = %{version}-%{release} | |
150 | Requires: %{name}-qt = %{version}-%{release} | |
151 | Requires: QtCore-devel >= 4 | |
152 | Requires: QtGui-devel >= 4 | |
153 | ||
154 | %description qt-devel | |
155 | Header file for bar code scanning and decoding Qt4 widget. | |
156 | ||
157 | %description qt-devel -l pl.UTF-8 | |
158 | Plik nagłówkowy widgetu Qt4 do skanowania i dekodowania kodów | |
159 | paskowych. | |
160 | ||
161 | %package qt-static | |
162 | Summary: Bar code scanning and decoding Qt4 widget - static library | |
163 | Summary(pl.UTF-8): Widget Qt4 do skanowania i dekodowania kodów paskowych - biblioteka statyczna | |
164 | Group: X11/Development/Libraries | |
165 | Requires: %{name}-qt-devel = %{version}-%{release} | |
166 | ||
167 | %description qt-static | |
168 | Bar code scanning and decoding Qt4 widget - static library. | |
169 | ||
170 | %description qt-static -l pl.UTF-8 | |
171 | Widget Qt4 do skanowania i dekodowania kodów paskowych - biblioteka | |
172 | statyczna. | |
173 | ||
174 | %package -n perl-Barcode-ZBar | |
175 | Summary: Perl interface to ZBar bar code reader | |
176 | Summary(pl.UTF-8): Interfejs Perla do czytnika kodów paskowych ZBar | |
177 | Group: Development/Languages/Perl | |
178 | Requires: %{name} = %{version}-%{release} | |
179 | ||
180 | %description -n perl-Barcode-ZBar | |
181 | Perl interface to ZBar bar code reader. | |
182 | ||
183 | %description -n perl-Barcode-ZBar -l pl.UTF-8 | |
184 | Interfejs Perla do czytnika kodów paskowych ZBar. | |
185 | ||
186 | %package -n python-zbar | |
187 | Summary: Python interface to ZBar bar code reader | |
188 | Summary(pl.UTF-8): Interfejs Pythona do czytnika kodów paskowych ZBar | |
189 | Group: Libraries/Python | |
190 | Requires: %{name} = %{version}-%{release} | |
191 | %pyrequires_eq python-libs | |
192 | ||
193 | %description -n python-zbar | |
194 | Python interface to ZBar bar code reader. | |
195 | ||
196 | %description -n python-zbar -l pl.UTF-8 | |
197 | Interfejs Pythona do czytnika kodów paskowych ZBar. | |
198 | ||
199 | %package -n python-zbar-pygtk | |
200 | Summary: Bar code scanning and decoding PyGTK widget | |
201 | Summary(pl.UTF-8): Widget PyGTK do skanowania i dekodowania kodów paskowych | |
202 | Group: Libraries/Python | |
203 | Requires: %{name}-gtk = %{version}-%{release} | |
204 | Requires: python-pygtk-gtk >= 2:2.0 | |
205 | %pyrequires_eq python-libs | |
206 | ||
207 | %description -n python-zbar-pygtk | |
208 | Bar code scanning and decoding PyGTK widget. | |
209 | ||
210 | %description -n python-zbar-pygtk -l pl.UTF-8 | |
211 | Widget PyGTK do skanowania i dekodowania kodów paskowych. | |
212 | ||
213 | %package -n browser-plugin-zbar | |
214 | Summary: ZBar plugin for Web browsers | |
215 | Summary(pl.UTF-8): Wtyczka ZBar dla przeglądarek WWW | |
216 | Group: X11/Applications/Graphics | |
217 | Requires: %{name} = %{version}-%{release} | |
218 | Requires: browser-plugins >= 2.0 | |
219 | ||
220 | %description -n browser-plugin-zbar | |
221 | ZBar plugin for Web browsers. | |
222 | ||
223 | %description -n browser-plugin-zbar -l pl.UTF-8 | |
224 | Wtyczka ZBar dla przeglądarek WWW. | |
225 | ||
226 | %prep | |
227 | %setup -q | |
228 | %patch0 -p1 | |
229 | %patch1 -p1 | |
e78cc5bb | 230 | %patch2 -p1 |
9c696e8e AM |
231 | %patch3 -p1 |
232 | %patch4 -p1 | |
50fc6553 JB |
233 | |
234 | %build | |
235 | %{__libtoolize} | |
236 | %{__aclocal} | |
237 | %{__autoconf} | |
238 | %{__autoheader} | |
239 | %{__automake} | |
240 | %configure \ | |
c67e0817 | 241 | --without-java \ |
50fc6553 JB |
242 | %{?with_npapi:--with-npapi} |
243 | %{__make} | |
244 | ||
245 | TOPDIR=$(pwd) | |
246 | cd perl | |
247 | %{__perl} Makefile.PL \ | |
248 | INSTALLDIRS=vendor \ | |
249 | INC="-I${TOPDIR}/include" \ | |
250 | LIBS="-L${TOPDIR}/zbar/.libs -lzbar" | |
251 | ||
252 | %{__make} \ | |
253 | CC="%{__cc}" \ | |
254 | OPTIMIZE="%{rpmcflags}" | |
255 | ||
256 | %{?with_tests:%{__make} test} | |
257 | ||
258 | %install | |
259 | rm -rf $RPM_BUILD_ROOT | |
1e25c3bc | 260 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name} |
50fc6553 JB |
261 | |
262 | %{__make} install \ | |
263 | DESTDIR=$RPM_BUILD_ROOT | |
264 | ||
265 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/*.la | |
266 | ||
267 | %{__make} -C perl install \ | |
268 | DESTDIR=$RPM_BUILD_ROOT | |
269 | ||
270 | %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/Barcode/ZBar/*.pod | |
271 | # not rm -r to ensure it's empty after .pod removal | |
272 | rmdir $RPM_BUILD_ROOT%{perl_vendorarch}/Barcode/ZBar | |
273 | %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Barcode/ZBar/.packlist | |
274 | %{__rm} $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod | |
275 | ||
276 | %if %{with npapi} | |
277 | install -d $RPM_BUILD_ROOT%{_browserpluginsdir} | |
278 | mv $RPM_BUILD_ROOT%{_libdir}/libzbarplugin.so* $RPM_BUILD_ROOT%{_browserpluginsdir} | |
279 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libzbarplugin.{la,a} | |
280 | %endif | |
281 | ||
282 | %clean | |
283 | rm -rf $RPM_BUILD_ROOT | |
284 | ||
285 | %post -p /sbin/ldconfig | |
286 | %postun -p /sbin/ldconfig | |
287 | ||
288 | %post gtk -p /sbin/ldconfig | |
289 | %postun gtk -p /sbin/ldconfig | |
290 | ||
291 | %post qt -p /sbin/ldconfig | |
292 | %postun qt -p /sbin/ldconfig | |
293 | ||
294 | %post -n browser-plugin-zbar | |
295 | %update_browser_plugins | |
296 | ||
297 | %postun -n browser-plugin-zbar | |
298 | if [ "$1" = 0 ]; then | |
299 | %update_browser_plugins | |
300 | fi | |
301 | ||
302 | %files | |
303 | %defattr(644,root,root,755) | |
304 | # COPYING contains license summary, not LGPL text | |
305 | %doc COPYING ChangeLog NEWS README TODO | |
306 | %attr(755,root,root) %{_bindir}/zbarcam | |
307 | %attr(755,root,root) %{_bindir}/zbarimg | |
308 | %attr(755,root,root) %{_libdir}/libzbar.so.*.*.* | |
309 | %attr(755,root,root) %ghost %{_libdir}/libzbar.so.0 | |
310 | %dir %{_datadir}/%{name} | |
311 | %{_mandir}/man1/zbarcam.1* | |
312 | %{_mandir}/man1/zbarimg.1* | |
313 | ||
314 | %files devel | |
315 | %defattr(644,root,root,755) | |
316 | %attr(755,root,root) %{_libdir}/libzbar.so | |
317 | %{_libdir}/libzbar.la | |
318 | # C | |
319 | %{_includedir}/zbar.h | |
320 | %dir %{_includedir}/zbar | |
321 | # C++ | |
322 | %{_includedir}/zbar/Decoder.h | |
323 | %{_includedir}/zbar/Exception.h | |
324 | %{_includedir}/zbar/Image.h | |
325 | %{_includedir}/zbar/ImageScanner.h | |
326 | %{_includedir}/zbar/Processor.h | |
327 | %{_includedir}/zbar/Scanner.h | |
328 | %{_includedir}/zbar/Symbol.h | |
329 | %{_includedir}/zbar/Video.h | |
330 | %{_includedir}/zbar/Window.h | |
331 | %{_pkgconfigdir}/zbar.pc | |
332 | ||
333 | %files static | |
334 | %defattr(644,root,root,755) | |
335 | %{_libdir}/libzbar.a | |
336 | ||
337 | %files gtk | |
338 | %defattr(644,root,root,755) | |
339 | %attr(755,root,root) %{_libdir}/libzbargtk.so.*.*.* | |
340 | %attr(755,root,root) %ghost %{_libdir}/libzbargtk.so.0 | |
341 | ||
342 | %files gtk-devel | |
343 | %defattr(644,root,root,755) | |
344 | %attr(755,root,root) %{_libdir}/libzbargtk.so | |
345 | %{_libdir}/libzbargtk.la | |
346 | %{_includedir}/zbar/zbargtk.h | |
347 | %{_pkgconfigdir}/zbar-gtk.pc | |
348 | ||
349 | %files gtk-static | |
350 | %defattr(644,root,root,755) | |
351 | %{_libdir}/libzbargtk.a | |
352 | ||
353 | %files qt | |
354 | %defattr(644,root,root,755) | |
355 | %attr(755,root,root) %{_libdir}/libzbarqt.so.*.*.* | |
356 | %attr(755,root,root) %ghost %{_libdir}/libzbarqt.so.0 | |
357 | ||
358 | %files qt-devel | |
359 | %defattr(644,root,root,755) | |
360 | %attr(755,root,root) %{_libdir}/libzbarqt.so | |
361 | %{_libdir}/libzbarqt.la | |
362 | %{_includedir}/zbar/QZBar.h | |
363 | %{_includedir}/zbar/QZBarImage.h | |
364 | %{_pkgconfigdir}/zbar-qt.pc | |
365 | ||
366 | %files qt-static | |
367 | %defattr(644,root,root,755) | |
368 | %{_libdir}/libzbarqt.a | |
369 | ||
370 | %files -n perl-Barcode-ZBar | |
371 | %defattr(644,root,root,755) | |
372 | %dir %{perl_vendorarch}/Barcode | |
373 | %{perl_vendorarch}/Barcode/ZBar.pm | |
374 | %dir %{perl_vendorarch}/auto/Barcode | |
375 | %dir %{perl_vendorarch}/auto/Barcode/ZBar | |
50fc6553 JB |
376 | %attr(755,root,root) %{perl_vendorarch}/auto/Barcode/ZBar/ZBar.so |
377 | %{_mandir}/man3/Barcode::ZBar*.3pm* | |
378 | ||
379 | %files -n python-zbar | |
380 | %defattr(644,root,root,755) | |
381 | %attr(755,root,root) %{py_sitedir}/zbar.so | |
382 | ||
383 | %files -n python-zbar-pygtk | |
384 | %defattr(644,root,root,755) | |
385 | %attr(755,root,root) %{py_sitedir}/zbarpygtk.so | |
386 | ||
387 | %if %{with npapi} | |
388 | %files -n browser-plugin-zbar | |
389 | %defattr(644,root,root,755) | |
390 | %attr(755,root,root) %{_browserpluginsdir}/libzbarplugin.so* | |
391 | %endif |