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_with python2 # Python 2.x module
8 %bcond_without python3 # Python 3.x module
9 %bcond_without qt # Qt widget (Qt5 or Qt4)
10 %bcond_with qt4 # Qt4 instead of Qt5
11 %bcond_with tests # "make test" for Perl module [needs X display]
14 %undefine with_python3
16 Summary: ZBar Bar Code Reader
17 Summary(pl.UTF-8): ZBar - czytnik kodów paskowych
23 # no releases since 2009
24 #Source0: http://downloads.sourceforge.net/zbar/%{name}-%{version}.tar.bz2
25 # non-maintainer release
26 Source0: https://linuxtv.org/downloads/zbar/%{name}-%{version}.tar.bz2
27 # Source0-md5: 5f8fc224e5ee924b6dd1032b944d0b3a
28 Patch0: %{name}-sh.patch
29 Patch1: %{name}-link.patch
30 Patch2: %{name}-npapi.patch
31 Patch3: %{name}-missing-files.patch
32 Patch4: %{name}-no-gettext.h.patch
33 URL: http://zbar.sourceforge.net/
34 BuildRequires: ImageMagick-devel >= 1:6.2.6
35 BuildRequires: autoconf >= 2.68
36 BuildRequires: automake >= 1:1.13
37 BuildRequires: dbus-devel >= 1.0
38 BuildRequires: gettext-tools >= 0.18
39 BuildRequires: glib2-devel >= 2.0
40 BuildRequires: gobject-introspection-devel >= 0.6.7
41 %{?with_gtk2:BuildRequires: gtk+2-devel >= 2.0}
42 %{!?with_gtk2:BuildRequires: gtk+3-devel >= 3.0}
43 %{?with_java:BuildRequires: jdk}
44 BuildRequires: libjpeg-devel
45 BuildRequires: libstdc++-devel
46 BuildRequires: libtool >= 2:2.2
47 BuildRequires: libv4l-devel
48 BuildRequires: perl-devel >= 1:5.8.0
49 BuildRequires: pkgconfig
50 %{?with_npapi:BuildRequires: pkgconfig(mozilla-plugin)}
52 BuildRequires: python-devel >= 1:2.7.0
53 BuildRequires: python-pygtk-devel >= 2:2.0
56 BuildRequires: python3-devel >= 1:3.2
58 BuildRequires: rpm-perlprov >= 4.1-13
59 BuildRequires: rpm-pythonprov
60 BuildRequires: rpmbuild(macros) >= 1.357
62 BuildRequires: xorg-lib-libX11-devel
63 BuildRequires: xorg-lib-libXext-devel
64 BuildRequires: xorg-lib-libXv-devel
67 BuildRequires: QtCore-devel >= 4
68 BuildRequires: QtGui-devel >= 4
69 BuildRequires: qt4-build >= 4
71 BuildRequires: Qt5Core-devel >= 5
72 BuildRequires: Qt5Gui-devel >= 5
73 BuildRequires: Qt5Widgets-devel >= 5
74 BuildRequires: Qt5X11Extras-devel >= 5
75 BuildRequires: qt5-build >= 5
78 Requires: ImageMagick-libs >= 1:6.2.6
79 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
82 ZBar Bar Code Reader is an open source software suite for reading bar
83 codes from various sources, such as video streams, image files and raw
84 intensity sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128,
85 Code 39, Interleaved 2 of 5 and QR Code. Included with the library are
86 basic applications for decoding captured bar code images and using a
87 video device (eg, webcam) as a bar code scanner. For application
88 developers, language bindings are available for C, C++, Python and
89 Perl as well as GUI widgets for Qt, GTK+ and PyGTK.
91 %description -l pl.UTF-8
92 ZBar Bar Code Reader to zestaw oprogramowania do odczytu kodów
93 paskowych z różnych źródeł, takich jak strumienie wideo, pliki obrazów
94 oraz czujniki jasności. Obsługuje kody EAN-13/UPC-A, UPC-E, EAN-8,
95 Code 128, Code 39, Interleaved 2 of 5 oraz QR Code. Do biblioteki
96 dołączone są podstawowe aplikacje do dekodowania wyłapanych obrazów
97 kodów paskowych oraz używania urządzeń wejściowych obrazu (np. kamer
98 internetowych) jako skanera kodów paskowych. Dla programistów są
99 dostępne też wiązania dla C, C++, Pythona, Perla oraz widgety GUI dla
103 Summary: C and C++ header files for ZBar library
104 Summary(pl.UTF-8): Pliki nagłówkowe C i C++ dla biblioteki ZBar
105 Group: Development/Libraries
106 Requires: %{name} = %{version}-%{release}
107 Requires: libjpeg-devel
108 Requires: xorg-lib-libXext-devel
109 Requires: xorg-lib-libXv-devel
112 C and C++ header files for ZBar library.
114 %description devel -l pl.UTF-8
115 Pliki nagłówkowe C i C++ dla biblioteki ZBar.
118 Summary: Static ZBar library
119 Summary(pl.UTF-8): Statyczna biblioteka ZBar
120 Group: Development/Libraries
121 Requires: %{name}-devel = %{version}-%{release}
126 %description static -l pl.UTF-8
127 Statyczna biblioteka ZBar.
130 Summary: Bar code scanning and decoding GTK+ widget
131 Summary(pl.UTF-8): Widget GTK+ do skanowania i dekodowania kodów paskowych
133 Requires: %{name} = %{version}-%{release}
136 Bar code scanning and decoding GTK+ widget.
138 %description gtk -l pl.UTF-8
139 Widget GTK+ do skanowania i dekodowania kodów paskowych.
142 Summary: Header file for bar code scanning and decoding GTK+ widget
143 Summary(pl.UTF-8): Plik nagłówkowy widgetu GTK+ do skanowania i dekodowania kodów paskowych
144 Group: X11/Development/Libraries
145 Requires: %{name}-devel = %{version}-%{release}
146 Requires: %{name}-gtk = %{version}-%{release}
147 %{?with_gtk2:Requires: gtk+2-devel >= 2.0}
148 %{!?with_gtk2:Requires: gtk+3-devel >= 3.0}
150 %description gtk-devel
151 Header file for bar code scanning and decoding GTK+ widget.
153 %description gtk-devel -l pl.UTF-8
154 Plik nagłówkowy widgetu GTK+ do skanowania i dekodowania kodów
158 Summary: Bar code scanning and decoding GTK+ widget - static library
159 Summary(pl.UTF-8): Widget GTK+ do skanowania i dekodowania kodów paskowych - biblioteka statyczna
160 Group: X11/Development/Libraries
161 Requires: %{name}-gtk-devel = %{version}-%{release}
163 %description gtk-static
164 Bar code scanning and decoding GTK+ widget - static library.
166 %description gtk-static -l pl.UTF-8
167 Widget GTK+ do skanowania i dekodowania kodów paskowych - biblioteka
171 Summary: Bar code scanning and decoding Qt4 widget
172 Summary(pl.UTF-8): Widget Qt4 do skanowania i dekodowania kodów paskowych
174 Requires: %{name} = %{version}-%{release}
177 Bar code scanning and decoding Qt4 widget.
179 %description qt -l pl.UTF-8
180 Widget Qt4 do skanowania i dekodowania kodów paskowych.
183 Summary: Header file for bar code scanning and decoding Qt4 widget
184 Summary(pl.UTF-8): Plik nagłówkowy widgetu Qt4 do skanowania i dekodowania kodów paskowych
185 Group: X11/Development/Libraries
186 Requires: %{name}-devel = %{version}-%{release}
187 Requires: %{name}-qt = %{version}-%{release}
189 Requires: QtCore-devel >= 4
190 Requires: QtGui-devel >= 4
192 Requires: Qt5Core >= 5
193 Requires: Qt5Gui >= 5
194 Requires: Qt5Widgets >= 5
195 Requires: Qt5X11Extras >= 5
198 %description qt-devel
199 Header file for bar code scanning and decoding Qt4 widget.
201 %description qt-devel -l pl.UTF-8
202 Plik nagłówkowy widgetu Qt4 do skanowania i dekodowania kodów
206 Summary: Bar code scanning and decoding Qt4 widget - static library
207 Summary(pl.UTF-8): Widget Qt4 do skanowania i dekodowania kodów paskowych - biblioteka statyczna
208 Group: X11/Development/Libraries
209 Requires: %{name}-qt-devel = %{version}-%{release}
211 %description qt-static
212 Bar code scanning and decoding Qt4 widget - static library.
214 %description qt-static -l pl.UTF-8
215 Widget Qt4 do skanowania i dekodowania kodów paskowych - biblioteka
218 %package -n perl-Barcode-ZBar
219 Summary: Perl interface to ZBar bar code reader
220 Summary(pl.UTF-8): Interfejs Perla do czytnika kodów paskowych ZBar
221 Group: Development/Languages/Perl
222 Requires: %{name} = %{version}-%{release}
224 %description -n perl-Barcode-ZBar
225 Perl interface to ZBar bar code reader.
227 %description -n perl-Barcode-ZBar -l pl.UTF-8
228 Interfejs Perla do czytnika kodów paskowych ZBar.
230 %package -n python-zbar
231 Summary: Python 2 interface to ZBar bar code reader
232 Summary(pl.UTF-8): Interfejs Pythona 2 do czytnika kodów paskowych ZBar
233 Group: Libraries/Python
234 Requires: %{name} = %{version}-%{release}
235 Requires: python-libs >= 1:2.7.0
237 %description -n python-zbar
238 Python 2 interface to ZBar bar code reader.
240 %description -n python-zbar -l pl.UTF-8
241 Interfejs Pythona 2 do czytnika kodów paskowych ZBar.
243 %package -n python-zbar-pygtk
244 Summary: Bar code scanning and decoding PyGTK widget
245 Summary(pl.UTF-8): Widget PyGTK do skanowania i dekodowania kodów paskowych
246 Group: Libraries/Python
247 Requires: %{name}-gtk = %{version}-%{release}
248 Requires: python-libs >= 1:2.7.0
249 Requires: python-pygtk-gtk >= 2:2.0
251 %description -n python-zbar-pygtk
252 Bar code scanning and decoding PyGTK widget.
254 %description -n python-zbar-pygtk -l pl.UTF-8
255 Widget PyGTK do skanowania i dekodowania kodów paskowych.
257 %package -n python3-zbar
258 Summary: Python 3 interface to ZBar bar code reader
259 Summary(pl.UTF-8): Interfejs Pythona 3 do czytnika kodów paskowych ZBar
260 Group: Libraries/Python
261 Requires: %{name} = %{version}-%{release}
263 %description -n python3-zbar
264 Python 3 interface to ZBar bar code reader.
266 %description -n python3-zbar -l pl.UTF-8
267 Interfejs Pythona 3 do czytnika kodów paskowych ZBar.
269 %package -n browser-plugin-zbar
270 Summary: ZBar plugin for Web browsers
271 Summary(pl.UTF-8): Wtyczka ZBar dla przeglądarek WWW
272 Group: X11/Applications/Graphics
273 Requires: %{name} = %{version}-%{release}
274 Requires: browser-plugins >= 2.0
276 %description -n browser-plugin-zbar
277 ZBar plugin for Web browsers.
279 %description -n browser-plugin-zbar -l pl.UTF-8
280 Wtyczka ZBar dla przeglądarek WWW.
296 # for ">>" in nested template usage
297 CXXFLAGS="%{rpmcxxflags} -std=c++11"
299 --disable-silent-rules \
300 %{?with_gtk2:--with-gtk=gtk2} \
301 %{!?with_java:--without-java} \
302 --with-python=%{?with_python2:python2}%{?with_python3:python3}%{!?with_python2:%{!?with_python3:no}} \
303 %{!?with_qt:--without-qt} \
304 %{?with_qt4:--without-qt5} \
305 %{?with_npapi:--with-npapi}
310 %{__perl} Makefile.PL \
312 INC="-I${TOPDIR}/include" \
313 LIBS="-L${TOPDIR}/zbar/.libs -lzbar"
317 OPTIMIZE="%{rpmcflags}"
319 %{?with_tests:%{__make} test}
322 rm -rf $RPM_BUILD_ROOT
323 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
326 DESTDIR=$RPM_BUILD_ROOT
328 # obsoleted by pkg-config
329 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libzbar*.la
331 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/zbar
334 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/*.la
337 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/*.la
340 %{__make} -C perl install \
341 DESTDIR=$RPM_BUILD_ROOT
343 %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/Barcode/ZBar/*.pod
344 # not rm -r to ensure it's empty after .pod removal
345 rmdir $RPM_BUILD_ROOT%{perl_vendorarch}/Barcode/ZBar
346 %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Barcode/ZBar/.packlist
347 %{__rm} $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
350 install -d $RPM_BUILD_ROOT%{_browserpluginsdir}
351 %{__mv} $RPM_BUILD_ROOT%{_libdir}/libzbarplugin.so* $RPM_BUILD_ROOT%{_browserpluginsdir}
352 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libzbarplugin.{la,a}
356 rm -rf $RPM_BUILD_ROOT
358 %post -p /sbin/ldconfig
359 %postun -p /sbin/ldconfig
361 %post gtk -p /sbin/ldconfig
362 %postun gtk -p /sbin/ldconfig
364 %post qt -p /sbin/ldconfig
365 %postun qt -p /sbin/ldconfig
367 %post -n browser-plugin-zbar
368 %update_browser_plugins
370 %postun -n browser-plugin-zbar
371 if [ "$1" = 0 ]; then
372 %update_browser_plugins
376 %defattr(644,root,root,755)
377 # COPYING contains license summary, not LGPL text
378 %doc COPYING ChangeLog NEWS.md README.md TODO.md
379 %attr(755,root,root) %{_bindir}/zbarcam
380 %attr(755,root,root) %{_bindir}/zbarimg
381 %attr(755,root,root) %{_libdir}/libzbar.so.*.*.*
382 %attr(755,root,root) %ghost %{_libdir}/libzbar.so.0
383 %{_libdir}/girepository-1.0/ZBar-1.0.typelib
385 /etc/dbus-1/system.d/org.linuxtv.Zbar.conf
386 %dir %{_datadir}/%{name}
387 %{_mandir}/man1/zbarcam.1*
388 %{_mandir}/man1/zbarimg.1*
391 %defattr(644,root,root,755)
392 %attr(755,root,root) %{_libdir}/libzbar.so
393 %{_datadir}/gir-1.0/ZBar-1.0.gir
395 %{_includedir}/zbar.h
396 %dir %{_includedir}/zbar
398 %{_includedir}/zbar/Decoder.h
399 %{_includedir}/zbar/Exception.h
400 %{_includedir}/zbar/Image.h
401 %{_includedir}/zbar/ImageScanner.h
402 %{_includedir}/zbar/Processor.h
403 %{_includedir}/zbar/Scanner.h
404 %{_includedir}/zbar/Symbol.h
405 %{_includedir}/zbar/Video.h
406 %{_includedir}/zbar/Window.h
407 %{_pkgconfigdir}/zbar.pc
410 %defattr(644,root,root,755)
414 %defattr(644,root,root,755)
415 %attr(755,root,root) %{_bindir}/zbarcam-gtk
416 %attr(755,root,root) %{_libdir}/libzbargtk.so.*.*.*
417 %attr(755,root,root) %ghost %{_libdir}/libzbargtk.so.0
420 %defattr(644,root,root,755)
421 %attr(755,root,root) %{_libdir}/libzbargtk.so
422 %{_includedir}/zbar/zbargtk.h
423 %{_pkgconfigdir}/zbar-gtk.pc
426 %defattr(644,root,root,755)
427 %{_libdir}/libzbargtk.a
431 %defattr(644,root,root,755)
432 %attr(755,root,root) %{_bindir}/zbarcam-qt
433 %attr(755,root,root) %{_libdir}/libzbarqt.so.*.*.*
434 %attr(755,root,root) %ghost %{_libdir}/libzbarqt.so.0
437 %defattr(644,root,root,755)
438 %attr(755,root,root) %{_libdir}/libzbarqt.so
439 %{_includedir}/zbar/QZBar.h
440 %{_includedir}/zbar/QZBarImage.h
441 %{_pkgconfigdir}/zbar-qt.pc
444 %defattr(644,root,root,755)
445 %{_libdir}/libzbarqt.a
448 %files -n perl-Barcode-ZBar
449 %defattr(644,root,root,755)
450 %dir %{perl_vendorarch}/Barcode
451 %{perl_vendorarch}/Barcode/ZBar.pm
452 %dir %{perl_vendorarch}/auto/Barcode
453 %dir %{perl_vendorarch}/auto/Barcode/ZBar
454 %attr(755,root,root) %{perl_vendorarch}/auto/Barcode/ZBar/ZBar.so
455 %{_mandir}/man3/Barcode::ZBar*.3pm*
458 %files -n python-zbar
459 %defattr(644,root,root,755)
460 %attr(755,root,root) %{py_sitedir}/zbar.so
462 %files -n python-zbar-pygtk
463 %defattr(644,root,root,755)
464 %attr(755,root,root) %{py_sitedir}/zbarpygtk.so
468 %files -n python3-zbar
469 %defattr(644,root,root,755)
470 %attr(755,root,root) %{py3_sitedir}/zbar.so
474 %files -n browser-plugin-zbar
475 %defattr(644,root,root,755)
476 %attr(755,root,root) %{_browserpluginsdir}/libzbarplugin.so*