]> git.pld-linux.org Git - packages/zbar.git/blob - zbar.spec
perl 5.38.0 rebuild
[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 3.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.92
17 Release:        3
18 License:        LGPL v2.1+
19 Group:          Libraries
20 #Source0Download: https://github.com/mchehab/zbar/releases
21 Source0:        https://github.com/mchehab/zbar/archive/%{version}/%{name}-%{version}.tar.gz
22 # Source0-md5:  dabc49973afbc7daa6dc8b09dc34f123
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 >= 0.18
32 BuildRequires:  glib2-devel >= 2.0
33 BuildRequires:  gobject-introspection-devel >= 0.6.7
34 %{?with_gtk2:BuildRequires:     gtk+2-devel >= 2.0}
35 %{!?with_gtk2: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 %{?with_perl:BuildRequires:     perl-devel >= 1:5.8.0}
42 BuildRequires:  pkgconfig
43 %{?with_npapi:BuildRequires:    pkgconfig(mozilla-plugin)}
44 %if %{with python2}
45 BuildRequires:  python-devel >= 1:2.7.0
46 BuildRequires:  python-pygtk-devel >= 2:2.0
47 %endif
48 %if %{with python3}
49 BuildRequires:  python3-devel >= 1:3.2
50 %endif
51 BuildRequires:  rpm-perlprov >= 4.1-13
52 BuildRequires:  rpm-pythonprov
53 BuildRequires:  rpmbuild(macros) >= 1.357
54 BuildRequires:  sed >= 4.0
55 BuildRequires:  xmlto
56 BuildRequires:  xorg-lib-libX11-devel
57 BuildRequires:  xorg-lib-libXext-devel
58 BuildRequires:  xorg-lib-libXv-devel
59 %if %{with qt}
60 %if %{with qt4}
61 BuildRequires:  QtCore-devel >= 4
62 BuildRequires:  QtGui-devel >= 4
63 BuildRequires:  qt4-build >= 4
64 %else
65 BuildRequires:  Qt5Core-devel >= 5
66 BuildRequires:  Qt5Gui-devel >= 5
67 BuildRequires:  Qt5Widgets-devel >= 5
68 BuildRequires:  Qt5X11Extras-devel >= 5
69 BuildRequires:  qt5-build >= 5
70 %endif
71 %endif
72 Requires:       ImageMagick-libs >= 1:6.2.6
73 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
74
75 %description
76 ZBar Bar Code Reader is an open source software suite for reading bar
77 codes from various sources, such as video streams, image files and raw
78 intensity sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128,
79 Code 39, Interleaved 2 of 5 and QR Code. Included with the library are
80 basic applications for decoding captured bar code images and using a
81 video device (eg, webcam) as a bar code scanner. For application
82 developers, language bindings are available for C, C++, Python and
83 Perl as well as GUI widgets for Qt, GTK+ and PyGTK.
84
85 %description -l pl.UTF-8
86 ZBar Bar Code Reader to zestaw oprogramowania do odczytu kodów
87 paskowych z różnych źródeł, takich jak strumienie wideo, pliki obrazów
88 oraz czujniki jasności. Obsługuje kody EAN-13/UPC-A, UPC-E, EAN-8,
89 Code 128, Code 39, Interleaved 2 of 5 oraz QR Code. Do biblioteki
90 dołączone są podstawowe aplikacje do dekodowania wyłapanych obrazów
91 kodów paskowych oraz używania urządzeń wejściowych obrazu (np. kamer
92 internetowych) jako skanera kodów paskowych. Dla programistów są
93 dostępne też wiązania dla C, C++, Pythona, Perla oraz widgety GUI dla
94 Qt, GTK+ oraz PyGTK.
95
96 %package devel
97 Summary:        C and C++ header files for ZBar library
98 Summary(pl.UTF-8):      Pliki nagłówkowe C i C++ dla biblioteki ZBar
99 Group:          Development/Libraries
100 Requires:       %{name} = %{version}-%{release}
101 Requires:       libjpeg-devel
102 Requires:       xorg-lib-libXext-devel
103 Requires:       xorg-lib-libXv-devel
104
105 %description devel
106 C and C++ header files for ZBar library.
107
108 %description devel -l pl.UTF-8
109 Pliki nagłówkowe C i C++ dla biblioteki ZBar.
110
111 %package static
112 Summary:        Static ZBar library
113 Summary(pl.UTF-8):      Statyczna biblioteka ZBar
114 Group:          Development/Libraries
115 Requires:       %{name}-devel = %{version}-%{release}
116
117 %description static
118 Static ZBar library.
119
120 %description static -l pl.UTF-8
121 Statyczna biblioteka ZBar.
122
123 %package gtk
124 Summary:        Bar code scanning and decoding GTK+ widget
125 Summary(pl.UTF-8):      Widget GTK+ do skanowania i dekodowania kodów paskowych
126 Group:          X11/Libraries
127 Requires:       %{name} = %{version}-%{release}
128
129 %description gtk
130 Bar code scanning and decoding GTK+ widget.
131
132 %description gtk -l pl.UTF-8
133 Widget GTK+ do skanowania i dekodowania kodów paskowych.
134
135 %package gtk-devel
136 Summary:        Header file for bar code scanning and decoding GTK+ widget
137 Summary(pl.UTF-8):      Plik nagłówkowy widgetu GTK+ do skanowania i dekodowania kodów paskowych
138 Group:          X11/Development/Libraries
139 Requires:       %{name}-devel = %{version}-%{release}
140 Requires:       %{name}-gtk = %{version}-%{release}
141 %{?with_gtk2:Requires:  gtk+2-devel >= 2.0}
142 %{!?with_gtk2:Requires: gtk+3-devel >= 3.0}
143
144 %description gtk-devel
145 Header file for bar code scanning and decoding GTK+ widget.
146
147 %description gtk-devel -l pl.UTF-8
148 Plik nagłówkowy widgetu GTK+ do skanowania i dekodowania kodów
149 paskowych.
150
151 %package gtk-static
152 Summary:        Bar code scanning and decoding GTK+ widget - static library
153 Summary(pl.UTF-8):      Widget GTK+ do skanowania i dekodowania kodów paskowych - biblioteka statyczna
154 Group:          X11/Development/Libraries
155 Requires:       %{name}-gtk-devel = %{version}-%{release}
156
157 %description gtk-static
158 Bar code scanning and decoding GTK+ widget - static library.
159
160 %description gtk-static -l pl.UTF-8
161 Widget GTK+ do skanowania i dekodowania kodów paskowych - biblioteka
162 statyczna.
163
164 %package qt
165 Summary:        Bar code scanning and decoding Qt4 widget
166 Summary(pl.UTF-8):      Widget Qt4 do skanowania i dekodowania kodów paskowych
167 Group:          X11/Libraries
168 Requires:       %{name} = %{version}-%{release}
169
170 %description qt
171 Bar code scanning and decoding Qt4 widget.
172
173 %description qt -l pl.UTF-8
174 Widget Qt4 do skanowania i dekodowania kodów paskowych.
175
176 %package qt-devel
177 Summary:        Header file for bar code scanning and decoding Qt4 widget
178 Summary(pl.UTF-8):      Plik nagłówkowy widgetu Qt4 do skanowania i dekodowania kodów paskowych
179 Group:          X11/Development/Libraries
180 Requires:       %{name}-devel = %{version}-%{release}
181 Requires:       %{name}-qt = %{version}-%{release}
182 %if %{with qt4}
183 Requires:       QtCore-devel >= 4
184 Requires:       QtGui-devel >= 4
185 %else
186 Requires:       Qt5Core >= 5
187 Requires:       Qt5Gui >= 5
188 Requires:       Qt5Widgets >= 5
189 Requires:       Qt5X11Extras >= 5
190 %endif
191
192 %description qt-devel
193 Header file for bar code scanning and decoding Qt4 widget.
194
195 %description qt-devel -l pl.UTF-8
196 Plik nagłówkowy widgetu Qt4 do skanowania i dekodowania kodów
197 paskowych.
198
199 %package qt-static
200 Summary:        Bar code scanning and decoding Qt4 widget - static library
201 Summary(pl.UTF-8):      Widget Qt4 do skanowania i dekodowania kodów paskowych - biblioteka statyczna
202 Group:          X11/Development/Libraries
203 Requires:       %{name}-qt-devel = %{version}-%{release}
204
205 %description qt-static
206 Bar code scanning and decoding Qt4 widget - static library.
207
208 %description qt-static -l pl.UTF-8
209 Widget Qt4 do skanowania i dekodowania kodów paskowych - biblioteka
210 statyczna.
211
212 %package -n perl-Barcode-ZBar
213 Summary:        Perl interface to ZBar bar code reader
214 Summary(pl.UTF-8):      Interfejs Perla do czytnika kodów paskowych ZBar
215 Group:          Development/Languages/Perl
216 Requires:       %{name} = %{version}-%{release}
217
218 %description -n perl-Barcode-ZBar
219 Perl interface to ZBar bar code reader.
220
221 %description -n perl-Barcode-ZBar -l pl.UTF-8
222 Interfejs Perla do czytnika kodów paskowych ZBar.
223
224 %package -n python-zbar
225 Summary:        Python 2 interface to ZBar bar code reader
226 Summary(pl.UTF-8):      Interfejs Pythona 2 do czytnika kodów paskowych ZBar
227 Group:          Libraries/Python
228 Requires:       %{name} = %{version}-%{release}
229 Requires:       python-libs >= 1:2.7.0
230
231 %description -n python-zbar
232 Python 2 interface to ZBar bar code reader.
233
234 %description -n python-zbar -l pl.UTF-8
235 Interfejs Pythona 2 do czytnika kodów paskowych ZBar.
236
237 %package -n python-zbar-pygtk
238 Summary:        Bar code scanning and decoding PyGTK widget
239 Summary(pl.UTF-8):      Widget PyGTK do skanowania i dekodowania kodów paskowych
240 Group:          Libraries/Python
241 Requires:       %{name}-gtk = %{version}-%{release}
242 Requires:       python-libs >= 1:2.7.0
243 Requires:       python-pygtk-gtk >= 2:2.0
244
245 %description -n python-zbar-pygtk
246 Bar code scanning and decoding PyGTK widget.
247
248 %description -n python-zbar-pygtk -l pl.UTF-8
249 Widget PyGTK do skanowania i dekodowania kodów paskowych.
250
251 %package -n python3-zbar
252 Summary:        Python 3 interface to ZBar bar code reader
253 Summary(pl.UTF-8):      Interfejs Pythona 3 do czytnika kodów paskowych ZBar
254 Group:          Libraries/Python
255 Requires:       %{name} = %{version}-%{release}
256
257 %description -n python3-zbar
258 Python 3 interface to ZBar bar code reader.
259
260 %description -n python3-zbar -l pl.UTF-8
261 Interfejs Pythona 3 do czytnika kodów paskowych ZBar.
262
263 %package -n browser-plugin-zbar
264 Summary:        ZBar plugin for Web browsers
265 Summary(pl.UTF-8):      Wtyczka ZBar dla przeglądarek WWW
266 Group:          X11/Applications/Graphics
267 Requires:       %{name} = %{version}-%{release}
268 Requires:       browser-plugins >= 2.0
269
270 %description -n browser-plugin-zbar
271 ZBar plugin for Web browsers.
272
273 %description -n browser-plugin-zbar -l pl.UTF-8
274 Wtyczka ZBar dla przeglądarek WWW.
275
276 %prep
277 %setup -q
278 %patch0 -p1
279 %patch1 -p1
280 %patch2 -p1
281
282 %{__sed} -i -e '/^po\/Makefile\.in/d' configure.ac
283
284 %build
285 %{__gettextize}
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 1.871804 seconds and 3 git commands to generate.