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