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