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]
9 %include /usr/lib/rpm/macros.perl
10 Summary: ZBar Bar Code Reader
11 Summary(pl.UTF-8): ZBar - czytnik kodów paskowych
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
24 Patch1: %{name}-link.patch
25 Patch2: %{name}-npapi.patch
26 #Patch3: zbar_use_libv4l.patch
27 #Patch3: %{name}-ac.patch
28 Patch3: imagemagick7.patch
29 URL: http://zbar.sourceforge.net/
30 BuildRequires: ImageMagick-devel >= 1:6.2.6
31 BuildRequires: autoconf >= 2.68
32 BuildRequires: automake >= 1:1.13
33 BuildRequires: gettext-tools
34 BuildRequires: gtk+2-devel >= 2.0
35 %{?with_java:BuildRequires: jdk}
36 BuildRequires: libjpeg-devel
37 BuildRequires: libstdc++-devel
38 BuildRequires: libtool >= 2:2.2
39 BuildRequires: libv4l-devel
40 BuildRequires: perl-devel >= 1:5.8.0
41 BuildRequires: pkgconfig
42 %{?with_npapi:BuildRequires: pkgconfig(mozilla-plugin)}
43 BuildRequires: python-devel >= 2.3.5
44 BuildRequires: python-pygtk-devel >= 2:2.0
45 BuildRequires: rpm-perlprov >= 4.1-13
46 BuildRequires: rpm-pythonprov
47 BuildRequires: rpmbuild(macros) >= 1.357
49 BuildRequires: xorg-lib-libX11-devel
50 BuildRequires: xorg-lib-libXext-devel
51 BuildRequires: xorg-lib-libXv-devel
54 BuildRequires: QtCore-devel >= 4
55 BuildRequires: QtGui-devel >= 4
56 BuildRequires: qt4-build >= 4
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
65 Requires: ImageMagick-libs >= 1:6.2.6
66 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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.
78 %description -l pl.UTF-8
79 ZBar Bar Code Reader to zestaw oprogramowania do odczytu kodów
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ą
86 dostępne też wiązania dla C, C++, Pythona, Perla oraz widgety GUI dla
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
99 C and C++ header files for ZBar library.
101 %description devel -l pl.UTF-8
102 Pliki nagłówkowe C i C++ dla biblioteki ZBar.
105 Summary: Static ZBar library
106 Summary(pl.UTF-8): Statyczna biblioteka ZBar
107 Group: Development/Libraries
108 Requires: %{name}-devel = %{version}-%{release}
113 %description static -l pl.UTF-8
114 Statyczna biblioteka ZBar.
117 Summary: Bar code scanning and decoding GTK+ widget
118 Summary(pl.UTF-8): Widget GTK+ do skanowania i dekodowania kodów paskowych
120 Requires: %{name} = %{version}-%{release}
123 Bar code scanning and decoding GTK+ widget.
125 %description gtk -l pl.UTF-8
126 Widget GTK+ do skanowania i dekodowania kodów paskowych.
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
136 %description gtk-devel
137 Header file for bar code scanning and decoding GTK+ widget.
139 %description gtk-devel -l pl.UTF-8
140 Plik nagłówkowy widgetu GTK+ do skanowania i dekodowania kodów
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}
149 %description gtk-static
150 Bar code scanning and decoding GTK+ widget - static library.
152 %description gtk-static -l pl.UTF-8
153 Widget GTK+ do skanowania i dekodowania kodów paskowych - biblioteka
157 Summary: Bar code scanning and decoding Qt4 widget
158 Summary(pl.UTF-8): Widget Qt4 do skanowania i dekodowania kodów paskowych
160 Requires: %{name} = %{version}-%{release}
163 Bar code scanning and decoding Qt4 widget.
165 %description qt -l pl.UTF-8
166 Widget Qt4 do skanowania i dekodowania kodów paskowych.
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}
175 Requires: QtCore-devel >= 4
176 Requires: QtGui-devel >= 4
178 Requires: Qt5Core >= 5
179 Requires: Qt5Gui >= 5
180 Requires: Qt5Widgets >= 5
181 Requires: Qt5X11Extras >= 5
184 %description qt-devel
185 Header file for bar code scanning and decoding Qt4 widget.
187 %description qt-devel -l pl.UTF-8
188 Plik nagłówkowy widgetu Qt4 do skanowania i dekodowania kodów
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}
197 %description qt-static
198 Bar code scanning and decoding Qt4 widget - static library.
200 %description qt-static -l pl.UTF-8
201 Widget Qt4 do skanowania i dekodowania kodów paskowych - biblioteka
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}
210 %description -n perl-Barcode-ZBar
211 Perl interface to ZBar bar code reader.
213 %description -n perl-Barcode-ZBar -l pl.UTF-8
214 Interfejs Perla do czytnika kodów paskowych ZBar.
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
223 %description -n python-zbar
224 Python interface to ZBar bar code reader.
226 %description -n python-zbar -l pl.UTF-8
227 Interfejs Pythona do czytnika kodów paskowych ZBar.
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
237 %description -n python-zbar-pygtk
238 Bar code scanning and decoding PyGTK widget.
240 %description -n python-zbar-pygtk -l pl.UTF-8
241 Widget PyGTK do skanowania i dekodowania kodów paskowych.
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
250 %description -n browser-plugin-zbar
251 ZBar plugin for Web browsers.
253 %description -n browser-plugin-zbar -l pl.UTF-8
254 Wtyczka ZBar dla przeglądarek WWW.
262 %if "%(rpm -q ImageMagick-devel --qf '%{VERSION}')" >= "7"
272 # for ">>" in nested template usage
273 CXXFLAGS="%{rpmcxxflags} -std=c++11"
275 %{!?with_java:--without-java} \
276 %{!?with_qt:--without-qt} \
277 %{?with_qt4:--without-qt5} \
278 %{?with_npapi:--with-npapi}
283 %{__perl} Makefile.PL \
285 INC="-I${TOPDIR}/include" \
286 LIBS="-L${TOPDIR}/zbar/.libs -lzbar"
290 OPTIMIZE="%{rpmcflags}"
292 %{?with_tests:%{__make} test}
295 rm -rf $RPM_BUILD_ROOT
296 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
299 DESTDIR=$RPM_BUILD_ROOT
301 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/*.la
303 %{__make} -C perl install \
304 DESTDIR=$RPM_BUILD_ROOT
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
313 install -d $RPM_BUILD_ROOT%{_browserpluginsdir}
314 %{__mv} $RPM_BUILD_ROOT%{_libdir}/libzbarplugin.so* $RPM_BUILD_ROOT%{_browserpluginsdir}
315 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libzbarplugin.{la,a}
319 rm -rf $RPM_BUILD_ROOT
321 %post -p /sbin/ldconfig
322 %postun -p /sbin/ldconfig
324 %post gtk -p /sbin/ldconfig
325 %postun gtk -p /sbin/ldconfig
327 %post qt -p /sbin/ldconfig
328 %postun qt -p /sbin/ldconfig
330 %post -n browser-plugin-zbar
331 %update_browser_plugins
333 %postun -n browser-plugin-zbar
334 if [ "$1" = 0 ]; then
335 %update_browser_plugins
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*
351 %defattr(644,root,root,755)
352 %attr(755,root,root) %{_libdir}/libzbar.so
353 %{_libdir}/libzbar.la
355 %{_includedir}/zbar.h
356 %dir %{_includedir}/zbar
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
370 %defattr(644,root,root,755)
374 %defattr(644,root,root,755)
375 %attr(755,root,root) %{_bindir}/zbarcam-gtk
376 %attr(755,root,root) %{_libdir}/libzbargtk.so.*.*.*
377 %attr(755,root,root) %ghost %{_libdir}/libzbargtk.so.0
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
387 %defattr(644,root,root,755)
388 %{_libdir}/libzbargtk.a
392 %defattr(644,root,root,755)
393 %attr(755,root,root) %{_bindir}/zbarcam-qt
394 %attr(755,root,root) %{_libdir}/libzbarqt.so.*.*.*
395 %attr(755,root,root) %ghost %{_libdir}/libzbarqt.so.0
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
406 %defattr(644,root,root,755)
407 %{_libdir}/libzbarqt.a
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
416 %attr(755,root,root) %{perl_vendorarch}/auto/Barcode/ZBar/ZBar.so
417 %{_mandir}/man3/Barcode::ZBar*.3pm*
419 %files -n python-zbar
420 %defattr(644,root,root,755)
421 %attr(755,root,root) %{py_sitedir}/zbar.so
423 %files -n python-zbar-pygtk
424 %defattr(644,root,root,755)
425 %attr(755,root,root) %{py_sitedir}/zbarpygtk.so
428 %files -n browser-plugin-zbar
429 %defattr(644,root,root,755)
430 %attr(755,root,root) %{_browserpluginsdir}/libzbarplugin.so*