1 # TODO: both python2 and python3 in same build?
4 %bcond_with java # Java interface [some file missing]
5 %bcond_with npapi # NPAPI plugin for Firefox/OpenOffice [nothing really yet]
6 %bcond_with gtk2 # GTK+ 2.x instead of 2.x
7 %bcond_without perl # Perl module
8 %bcond_with python2 # Python 2.x module
9 %bcond_without python3 # Python 3.x module
10 %bcond_without qt # Qt widget (Qt5 or Qt4)
11 %bcond_with qt4 # Qt4 instead of Qt5
12 %bcond_with tests # "make test" for Perl module [needs X display]
15 %undefine with_python3
17 Summary: ZBar Bar Code Reader
18 Summary(pl.UTF-8): ZBar - czytnik kodów paskowych
24 # no releases since 2009
25 #Source0: http://downloads.sourceforge.net/zbar/%{name}-%{version}.tar.bz2
26 # non-maintainer release
27 Source0: https://linuxtv.org/downloads/zbar/%{name}-%{version}.tar.bz2
28 # Source0-md5: 5f8fc224e5ee924b6dd1032b944d0b3a
29 Patch0: %{name}-sh.patch
30 Patch1: %{name}-link.patch
31 Patch2: %{name}-npapi.patch
32 Patch3: %{name}-missing-files.patch
33 Patch4: %{name}-no-gettext.h.patch
34 URL: http://zbar.sourceforge.net/
35 BuildRequires: ImageMagick-devel >= 1:6.2.6
36 BuildRequires: autoconf >= 2.68
37 BuildRequires: automake >= 1:1.13
38 BuildRequires: dbus-devel >= 1.0
39 BuildRequires: gettext-tools >= 0.18
40 BuildRequires: glib2-devel >= 2.0
41 BuildRequires: gobject-introspection-devel >= 0.6.7
42 %{?with_gtk2:BuildRequires: gtk+2-devel >= 2.0}
43 %{!?with_gtk2:BuildRequires: gtk+3-devel >= 3.0}
44 %{?with_java:BuildRequires: jdk}
45 BuildRequires: libjpeg-devel
46 BuildRequires: libstdc++-devel
47 BuildRequires: libtool >= 2:2.2
48 BuildRequires: libv4l-devel
49 %{?with_perl:BuildRequires: perl-devel >= 1:5.8.0}
50 BuildRequires: pkgconfig
51 %{?with_npapi:BuildRequires: pkgconfig(mozilla-plugin)}
53 BuildRequires: python-devel >= 1:2.7.0
54 BuildRequires: python-pygtk-devel >= 2:2.0
57 BuildRequires: python3-devel >= 1:3.2
59 BuildRequires: rpm-perlprov >= 4.1-13
60 BuildRequires: rpm-pythonprov
61 BuildRequires: rpmbuild(macros) >= 1.357
63 BuildRequires: xorg-lib-libX11-devel
64 BuildRequires: xorg-lib-libXext-devel
65 BuildRequires: xorg-lib-libXv-devel
68 BuildRequires: QtCore-devel >= 4
69 BuildRequires: QtGui-devel >= 4
70 BuildRequires: qt4-build >= 4
72 BuildRequires: Qt5Core-devel >= 5
73 BuildRequires: Qt5Gui-devel >= 5
74 BuildRequires: Qt5Widgets-devel >= 5
75 BuildRequires: Qt5X11Extras-devel >= 5
76 BuildRequires: qt5-build >= 5
79 Requires: ImageMagick-libs >= 1:6.2.6
80 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
83 ZBar Bar Code Reader is an open source software suite for reading bar
84 codes from various sources, such as video streams, image files and raw
85 intensity sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128,
86 Code 39, Interleaved 2 of 5 and QR Code. Included with the library are
87 basic applications for decoding captured bar code images and using a
88 video device (eg, webcam) as a bar code scanner. For application
89 developers, language bindings are available for C, C++, Python and
90 Perl as well as GUI widgets for Qt, GTK+ and PyGTK.
92 %description -l pl.UTF-8
93 ZBar Bar Code Reader to zestaw oprogramowania do odczytu kodów
94 paskowych z różnych źródeł, takich jak strumienie wideo, pliki obrazów
95 oraz czujniki jasności. Obsługuje kody EAN-13/UPC-A, UPC-E, EAN-8,
96 Code 128, Code 39, Interleaved 2 of 5 oraz QR Code. Do biblioteki
97 dołączone są podstawowe aplikacje do dekodowania wyłapanych obrazów
98 kodów paskowych oraz używania urządzeń wejściowych obrazu (np. kamer
99 internetowych) jako skanera kodów paskowych. Dla programistów są
100 dostępne też wiązania dla C, C++, Pythona, Perla oraz widgety GUI dla
104 Summary: C and C++ header files for ZBar library
105 Summary(pl.UTF-8): Pliki nagłówkowe C i C++ dla biblioteki ZBar
106 Group: Development/Libraries
107 Requires: %{name} = %{version}-%{release}
108 Requires: libjpeg-devel
109 Requires: xorg-lib-libXext-devel
110 Requires: xorg-lib-libXv-devel
113 C and C++ header files for ZBar library.
115 %description devel -l pl.UTF-8
116 Pliki nagłówkowe C i C++ dla biblioteki ZBar.
119 Summary: Static ZBar library
120 Summary(pl.UTF-8): Statyczna biblioteka ZBar
121 Group: Development/Libraries
122 Requires: %{name}-devel = %{version}-%{release}
127 %description static -l pl.UTF-8
128 Statyczna biblioteka ZBar.
131 Summary: Bar code scanning and decoding GTK+ widget
132 Summary(pl.UTF-8): Widget GTK+ do skanowania i dekodowania kodów paskowych
134 Requires: %{name} = %{version}-%{release}
137 Bar code scanning and decoding GTK+ widget.
139 %description gtk -l pl.UTF-8
140 Widget GTK+ do skanowania i dekodowania kodów paskowych.
143 Summary: Header file for bar code scanning and decoding GTK+ widget
144 Summary(pl.UTF-8): Plik nagłówkowy widgetu GTK+ do skanowania i dekodowania kodów paskowych
145 Group: X11/Development/Libraries
146 Requires: %{name}-devel = %{version}-%{release}
147 Requires: %{name}-gtk = %{version}-%{release}
148 %{?with_gtk2:Requires: gtk+2-devel >= 2.0}
149 %{!?with_gtk2:Requires: gtk+3-devel >= 3.0}
151 %description gtk-devel
152 Header file for bar code scanning and decoding GTK+ widget.
154 %description gtk-devel -l pl.UTF-8
155 Plik nagłówkowy widgetu GTK+ do skanowania i dekodowania kodów
159 Summary: Bar code scanning and decoding GTK+ widget - static library
160 Summary(pl.UTF-8): Widget GTK+ do skanowania i dekodowania kodów paskowych - biblioteka statyczna
161 Group: X11/Development/Libraries
162 Requires: %{name}-gtk-devel = %{version}-%{release}
164 %description gtk-static
165 Bar code scanning and decoding GTK+ widget - static library.
167 %description gtk-static -l pl.UTF-8
168 Widget GTK+ do skanowania i dekodowania kodów paskowych - biblioteka
172 Summary: Bar code scanning and decoding Qt4 widget
173 Summary(pl.UTF-8): Widget Qt4 do skanowania i dekodowania kodów paskowych
175 Requires: %{name} = %{version}-%{release}
178 Bar code scanning and decoding Qt4 widget.
180 %description qt -l pl.UTF-8
181 Widget Qt4 do skanowania i dekodowania kodów paskowych.
184 Summary: Header file for bar code scanning and decoding Qt4 widget
185 Summary(pl.UTF-8): Plik nagłówkowy widgetu Qt4 do skanowania i dekodowania kodów paskowych
186 Group: X11/Development/Libraries
187 Requires: %{name}-devel = %{version}-%{release}
188 Requires: %{name}-qt = %{version}-%{release}
190 Requires: QtCore-devel >= 4
191 Requires: QtGui-devel >= 4
193 Requires: Qt5Core >= 5
194 Requires: Qt5Gui >= 5
195 Requires: Qt5Widgets >= 5
196 Requires: Qt5X11Extras >= 5
199 %description qt-devel
200 Header file for bar code scanning and decoding Qt4 widget.
202 %description qt-devel -l pl.UTF-8
203 Plik nagłówkowy widgetu Qt4 do skanowania i dekodowania kodów
207 Summary: Bar code scanning and decoding Qt4 widget - static library
208 Summary(pl.UTF-8): Widget Qt4 do skanowania i dekodowania kodów paskowych - biblioteka statyczna
209 Group: X11/Development/Libraries
210 Requires: %{name}-qt-devel = %{version}-%{release}
212 %description qt-static
213 Bar code scanning and decoding Qt4 widget - static library.
215 %description qt-static -l pl.UTF-8
216 Widget Qt4 do skanowania i dekodowania kodów paskowych - biblioteka
219 %package -n perl-Barcode-ZBar
220 Summary: Perl interface to ZBar bar code reader
221 Summary(pl.UTF-8): Interfejs Perla do czytnika kodów paskowych ZBar
222 Group: Development/Languages/Perl
223 Requires: %{name} = %{version}-%{release}
225 %description -n perl-Barcode-ZBar
226 Perl interface to ZBar bar code reader.
228 %description -n perl-Barcode-ZBar -l pl.UTF-8
229 Interfejs Perla do czytnika kodów paskowych ZBar.
231 %package -n python-zbar
232 Summary: Python 2 interface to ZBar bar code reader
233 Summary(pl.UTF-8): Interfejs Pythona 2 do czytnika kodów paskowych ZBar
234 Group: Libraries/Python
235 Requires: %{name} = %{version}-%{release}
236 Requires: python-libs >= 1:2.7.0
238 %description -n python-zbar
239 Python 2 interface to ZBar bar code reader.
241 %description -n python-zbar -l pl.UTF-8
242 Interfejs Pythona 2 do czytnika kodów paskowych ZBar.
244 %package -n python-zbar-pygtk
245 Summary: Bar code scanning and decoding PyGTK widget
246 Summary(pl.UTF-8): Widget PyGTK do skanowania i dekodowania kodów paskowych
247 Group: Libraries/Python
248 Requires: %{name}-gtk = %{version}-%{release}
249 Requires: python-libs >= 1:2.7.0
250 Requires: python-pygtk-gtk >= 2:2.0
252 %description -n python-zbar-pygtk
253 Bar code scanning and decoding PyGTK widget.
255 %description -n python-zbar-pygtk -l pl.UTF-8
256 Widget PyGTK do skanowania i dekodowania kodów paskowych.
258 %package -n python3-zbar
259 Summary: Python 3 interface to ZBar bar code reader
260 Summary(pl.UTF-8): Interfejs Pythona 3 do czytnika kodów paskowych ZBar
261 Group: Libraries/Python
262 Requires: %{name} = %{version}-%{release}
264 %description -n python3-zbar
265 Python 3 interface to ZBar bar code reader.
267 %description -n python3-zbar -l pl.UTF-8
268 Interfejs Pythona 3 do czytnika kodów paskowych ZBar.
270 %package -n browser-plugin-zbar
271 Summary: ZBar plugin for Web browsers
272 Summary(pl.UTF-8): Wtyczka ZBar dla przeglądarek WWW
273 Group: X11/Applications/Graphics
274 Requires: %{name} = %{version}-%{release}
275 Requires: browser-plugins >= 2.0
277 %description -n browser-plugin-zbar
278 ZBar plugin for Web browsers.
280 %description -n browser-plugin-zbar -l pl.UTF-8
281 Wtyczka ZBar dla przeglądarek WWW.
297 # for ">>" in nested template usage
298 CXXFLAGS="%{rpmcxxflags} -std=c++11"
300 --disable-silent-rules \
301 %{?with_gtk2:--with-gtk=gtk2} \
302 %{!?with_java:--without-java} \
303 --with-python=%{?with_python2:python2}%{?with_python3:python3}%{!?with_python2:%{!?with_python3:no}} \
304 %{!?with_qt:--without-qt} \
305 %{?with_qt4:--without-qt5} \
306 %{?with_npapi:--with-npapi}
312 %{__perl} Makefile.PL \
314 INC="-I${TOPDIR}/include" \
315 LIBS="-L${TOPDIR}/zbar/.libs -lzbar"
319 OPTIMIZE="%{rpmcflags}"
321 %{?with_tests:%{__make} test}
325 rm -rf $RPM_BUILD_ROOT
326 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
329 DESTDIR=$RPM_BUILD_ROOT
331 # obsoleted by pkg-config
332 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libzbar*.la
334 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/zbar
337 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/*.la
340 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/*.la
344 %{__make} -C perl install \
345 DESTDIR=$RPM_BUILD_ROOT
347 %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/Barcode/ZBar/*.pod
348 # not rm -r to ensure it's empty after .pod removal
349 rmdir $RPM_BUILD_ROOT%{perl_vendorarch}/Barcode/ZBar
350 %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Barcode/ZBar/.packlist
351 %{__rm} $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
355 install -d $RPM_BUILD_ROOT%{_browserpluginsdir}
356 %{__mv} $RPM_BUILD_ROOT%{_libdir}/libzbarplugin.so* $RPM_BUILD_ROOT%{_browserpluginsdir}
357 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libzbarplugin.{la,a}
361 rm -rf $RPM_BUILD_ROOT
363 %post -p /sbin/ldconfig
364 %postun -p /sbin/ldconfig
366 %post gtk -p /sbin/ldconfig
367 %postun gtk -p /sbin/ldconfig
369 %post qt -p /sbin/ldconfig
370 %postun qt -p /sbin/ldconfig
372 %post -n browser-plugin-zbar
373 %update_browser_plugins
375 %postun -n browser-plugin-zbar
376 if [ "$1" = 0 ]; then
377 %update_browser_plugins
381 %defattr(644,root,root,755)
382 # COPYING contains license summary, not LGPL text
383 %doc COPYING ChangeLog NEWS.md README.md TODO.md
384 %attr(755,root,root) %{_bindir}/zbarcam
385 %attr(755,root,root) %{_bindir}/zbarimg
386 %attr(755,root,root) %{_libdir}/libzbar.so.*.*.*
387 %attr(755,root,root) %ghost %{_libdir}/libzbar.so.0
388 %{_libdir}/girepository-1.0/ZBar-1.0.typelib
390 /etc/dbus-1/system.d/org.linuxtv.Zbar.conf
391 %dir %{_datadir}/%{name}
392 %{_mandir}/man1/zbarcam.1*
393 %{_mandir}/man1/zbarimg.1*
396 %defattr(644,root,root,755)
397 %attr(755,root,root) %{_libdir}/libzbar.so
398 %{_datadir}/gir-1.0/ZBar-1.0.gir
400 %{_includedir}/zbar.h
401 %dir %{_includedir}/zbar
403 %{_includedir}/zbar/Decoder.h
404 %{_includedir}/zbar/Exception.h
405 %{_includedir}/zbar/Image.h
406 %{_includedir}/zbar/ImageScanner.h
407 %{_includedir}/zbar/Processor.h
408 %{_includedir}/zbar/Scanner.h
409 %{_includedir}/zbar/Symbol.h
410 %{_includedir}/zbar/Video.h
411 %{_includedir}/zbar/Window.h
412 %{_pkgconfigdir}/zbar.pc
415 %defattr(644,root,root,755)
419 %defattr(644,root,root,755)
420 %attr(755,root,root) %{_bindir}/zbarcam-gtk
421 %attr(755,root,root) %{_libdir}/libzbargtk.so.*.*.*
422 %attr(755,root,root) %ghost %{_libdir}/libzbargtk.so.0
425 %defattr(644,root,root,755)
426 %attr(755,root,root) %{_libdir}/libzbargtk.so
427 %{_includedir}/zbar/zbargtk.h
428 %{_pkgconfigdir}/zbar-gtk.pc
431 %defattr(644,root,root,755)
432 %{_libdir}/libzbargtk.a
436 %defattr(644,root,root,755)
437 %attr(755,root,root) %{_bindir}/zbarcam-qt
438 %attr(755,root,root) %{_libdir}/libzbarqt.so.*.*.*
439 %attr(755,root,root) %ghost %{_libdir}/libzbarqt.so.0
442 %defattr(644,root,root,755)
443 %attr(755,root,root) %{_libdir}/libzbarqt.so
444 %{_includedir}/zbar/QZBar.h
445 %{_includedir}/zbar/QZBarImage.h
446 %{_pkgconfigdir}/zbar-qt.pc
449 %defattr(644,root,root,755)
450 %{_libdir}/libzbarqt.a
454 %files -n perl-Barcode-ZBar
455 %defattr(644,root,root,755)
456 %dir %{perl_vendorarch}/Barcode
457 %{perl_vendorarch}/Barcode/ZBar.pm
458 %dir %{perl_vendorarch}/auto/Barcode
459 %dir %{perl_vendorarch}/auto/Barcode/ZBar
460 %attr(755,root,root) %{perl_vendorarch}/auto/Barcode/ZBar/ZBar.so
461 %{_mandir}/man3/Barcode::ZBar*.3pm*
465 %files -n python-zbar
466 %defattr(644,root,root,755)
467 %attr(755,root,root) %{py_sitedir}/zbar.so
469 %files -n python-zbar-pygtk
470 %defattr(644,root,root,755)
471 %attr(755,root,root) %{py_sitedir}/zbarpygtk.so
475 %files -n python3-zbar
476 %defattr(644,root,root,755)
477 %attr(755,root,root) %{py3_sitedir}/zbar.so
481 %files -n browser-plugin-zbar
482 %defattr(644,root,root,755)
483 %attr(755,root,root) %{_browserpluginsdir}/libzbarplugin.so*