--- /dev/null
+--- zbar-0.23.1/zbar-qt.pc.in.orig 1970-01-01 01:00:00.000000000 +0100
++++ zbar-0.23.1/zbar-qt.pc.in 2020-09-12 21:48:26.551403984 +0200
+@@ -0,0 +1,12 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: zbar-qt
++Description: bar code scanning and decoding Qt4 widget
++URL: http://zbar.sourceforge.net
++Version: @VERSION@
++Requires: zbar, QtCore >= 4, QtGui >= 4
++Libs: -L${libdir} -lzbarqt
++Cflags: -I${includedir}
+--- zbar-0.23.1/zbar-qt5.pc.in.orig 1970-01-01 01:00:00.000000000 +0100
++++ zbar-0.23.1/zbar-qt5.pc.in 2020-09-12 21:48:26.551403984 +0200
+@@ -0,0 +1,12 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: zbar-qt
++Description: bar code scanning and decoding Qt5 widget
++URL: http://zbar.sourceforge.net
++Version: @VERSION@
++Requires: zbar, Qt5Core >= 5, Qt5Gui >= 5
++Libs: -L${libdir} -lzbarqt
++Cflags: -I${includedir}
+--- zbar-0.23.1/pygtk/zbarpygtk.override.orig 1970-01-01 01:00:00.000000000 +0100
++++ zbar-0.23.1/pygtk/zbarpygtk.override 2020-09-12 22:11:40.240520389 +0200
+@@ -0,0 +1,20 @@
++%%
++headers
++#include <Python.h>
++#include <pygobject.h>
++#include <zbar/zbargtk.h>
++%%
++modulename zbarpygtk
++%%
++import gtk.Widget as PyGtkWidget_Type
++import gtk.gdk.Pixbuf as PyGdkPixbuf_Type
++%%
++ignore-type
++ ZBarGtkError
++%%
++ignore-glob
++ *_get_type
++%%
++ignore
++ zbar_gtk_image_from_pixbuf # until base library wrappers are in place
++%%
--- /dev/null
+From a133aea7880bbb56d75535e534716d0e16a3b61a Mon Sep 17 00:00:00 2001
+From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+Date: Tue, 28 Jul 2020 09:47:03 +0200
+Subject: zbarcam, zbarimg: get rid of gettext.h
+
+This doesn't seem to be needed at all for translations to
+work. Also, gettext.h uses a different license. So, let's get
+rid of it.
+
+Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+---
+ zbar/gettext.h | 294 ------------------------------------------------------
+ zbarcam/zbarcam.c | 1 -
+ zbarimg/zbarimg.c | 1 -
+ 3 files changed, 296 deletions(-)
+ delete mode 100644 zbar/gettext.h
+
+diff --git a/zbarcam/zbarcam.c b/zbarcam/zbarcam.c
+index f7ea281..ad30101 100644
+--- a/zbarcam/zbarcam.c
++++ b/zbarcam/zbarcam.c
+@@ -35,7 +35,6 @@
+ #include <zbar.h>
+
+ #ifdef ENABLE_NLS
+-#include "../zbar/gettext.h"
+ # include <libintl.h>
+ # define _(string) gettext(string)
+ #else
+diff --git a/zbarimg/zbarimg.c b/zbarimg/zbarimg.c
+index 0796fd8..d05d832 100644
+--- a/zbarimg/zbarimg.c
++++ b/zbarimg/zbarimg.c
+@@ -40,7 +40,6 @@
+ #include <zbar.h>
+
+ #ifdef ENABLE_NLS
+-#include "../zbar/gettext.h"
+ # include <libintl.h>
+ # define _(string) gettext(string)
+ #else
+--
+cgit v1.2.1
+
+# TODO: both python2 and python3 in same build?
#
# Conditional build:
%bcond_with java # Java interface [some file missing]
%bcond_with npapi # NPAPI plugin for Firefox/OpenOffice [nothing really yet]
-%bcond_with gtk3 # GTK+ 3.x instead of 2.x
-%bcond_with python3 # Python 3.x instead of 2.x
+%bcond_with gtk2 # GTK+ 2.x instead of 2.x
+%bcond_with python2 # Python 2.x module
+%bcond_without python3 # Python 3.x module
%bcond_without qt # Qt widget (Qt5 or Qt4)
%bcond_with qt4 # Qt4 instead of Qt5
%bcond_with tests # "make test" for Perl module [needs X display]
#
+%if %{with python2}
+%undefine with_python3
+%endif
Summary: ZBar Bar Code Reader
Summary(pl.UTF-8): ZBar - czytnik kodów paskowych
Name: zbar
-Version: 0.23
-Release: 3
+Version: 0.23.1
+Release: 1
License: LGPL v2.1+
Group: Libraries
# no releases since 2009
#Source0: http://downloads.sourceforge.net/zbar/%{name}-%{version}.tar.bz2
# non-maintainer release
Source0: https://linuxtv.org/downloads/zbar/%{name}-%{version}.tar.bz2
-# Source0-md5: 99d16dd6ce4d3a180aeb88b8a0880653
+# Source0-md5: 5f8fc224e5ee924b6dd1032b944d0b3a
Patch0: %{name}-sh.patch
Patch1: %{name}-link.patch
Patch2: %{name}-npapi.patch
+Patch3: %{name}-missing-files.patch
+Patch4: %{name}-no-gettext.h.patch
URL: http://zbar.sourceforge.net/
BuildRequires: ImageMagick-devel >= 1:6.2.6
BuildRequires: autoconf >= 2.68
BuildRequires: automake >= 1:1.13
BuildRequires: dbus-devel >= 1.0
-BuildRequires: gettext-tools
+BuildRequires: gettext-tools >= 0.18
BuildRequires: glib2-devel >= 2.0
BuildRequires: gobject-introspection-devel >= 0.6.7
-%{!?with_gtk3:BuildRequires: gtk+2-devel >= 2.0}
-%{?with_gtk3:BuildRequires: gtk+3-devel >= 3.0}
+%{?with_gtk2:BuildRequires: gtk+2-devel >= 2.0}
+%{!?with_gtk2:BuildRequires: gtk+3-devel >= 3.0}
%{?with_java:BuildRequires: jdk}
BuildRequires: libjpeg-devel
BuildRequires: libstdc++-devel
BuildRequires: perl-devel >= 1:5.8.0
BuildRequires: pkgconfig
%{?with_npapi:BuildRequires: pkgconfig(mozilla-plugin)}
+%if %{with python2}
+BuildRequires: python-devel >= 1:2.7.0
+BuildRequires: python-pygtk-devel >= 2:2.0
+%endif
%if %{with python3}
BuildRequires: python3-devel >= 1:3.2
-%else
-BuildRequires: python-devel >= 1:2.7.0
-%{!?with_gtk3:BuildRequires: python-pygtk-devel >= 2:2.0}
%endif
BuildRequires: rpm-perlprov >= 4.1-13
BuildRequires: rpm-pythonprov
Group: X11/Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
Requires: %{name}-gtk = %{version}-%{release}
-%{!?with_gtk3:Requires: gtk+2-devel >= 2.0}
-%{?with_gtk3:Requires: gtk+3-devel >= 3.0}
+%{?with_gtk2:Requires: gtk+2-devel >= 2.0}
+%{!?with_gtk2:Requires: gtk+3-devel >= 3.0}
%description gtk-devel
Header file for bar code scanning and decoding GTK+ widget.
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
+%patch4 -p1
%build
%{__libtoolize}
CXXFLAGS="%{rpmcxxflags} -std=c++11"
%configure \
--disable-silent-rules \
- %{?with_gtk3:--with-gtk=gtk3} \
+ %{?with_gtk2:--with-gtk=gtk2} \
%{!?with_java:--without-java} \
- %{?with_python3:--with-python=python3} \
+ --with-python=%{?with_python2:python2}%{?with_python3:python3}%{!?with_python2:%{!?with_python3:no}} \
%{!?with_qt:--without-qt} \
%{?with_qt4:--without-qt5} \
%{?with_npapi:--with-npapi}
# packaged as %doc
%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/zbar
+%if %{with python2}
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/*.la
+%endif
%if %{with python3}
%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/*.la
-%else
-%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/*.la
%endif
%{__make} -C perl install \
%attr(755,root,root) %{perl_vendorarch}/auto/Barcode/ZBar/ZBar.so
%{_mandir}/man3/Barcode::ZBar*.3pm*
-%if %{without python3}
+%if %{with python2}
%files -n python-zbar
%defattr(644,root,root,755)
%attr(755,root,root) %{py_sitedir}/zbar.so
-%if %{without gtk3}
%files -n python-zbar-pygtk
%defattr(644,root,root,755)
%attr(755,root,root) %{py_sitedir}/zbarpygtk.so
%endif
-%endif
%if %{with python3}
%files -n python3-zbar