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