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