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