From aee86a76722e6d10c411bcc1d5db908b115a7704 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sun, 13 Sep 2020 07:53:19 +0200 Subject: [PATCH] - updated to 0.23.1 - added missing-files,no-gettext.h patches (from git) - adjusted bconds following upstream: now default is gtk3 and python3 --- zbar-missing-files.patch | 53 ++++++++++++++++++++++++++++++++++++++++ zbar-no-gettext.h.patch | 44 +++++++++++++++++++++++++++++++++ zbar.spec | 49 ++++++++++++++++++++++--------------- 3 files changed, 126 insertions(+), 20 deletions(-) create mode 100644 zbar-missing-files.patch create mode 100644 zbar-no-gettext.h.patch diff --git a/zbar-missing-files.patch b/zbar-missing-files.patch new file mode 100644 index 0000000..4e9b9c5 --- /dev/null +++ b/zbar-missing-files.patch @@ -0,0 +1,53 @@ +--- 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 ++#include ++#include ++%% ++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 ++%% diff --git a/zbar-no-gettext.h.patch b/zbar-no-gettext.h.patch new file mode 100644 index 0000000..3009488 --- /dev/null +++ b/zbar-no-gettext.h.patch @@ -0,0 +1,44 @@ +From a133aea7880bbb56d75535e534716d0e16a3b61a Mon Sep 17 00:00:00 2001 +From: Mauro Carvalho Chehab +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 +--- + 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 + + #ifdef ENABLE_NLS +-#include "../zbar/gettext.h" + # include + # 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 + + #ifdef ENABLE_NLS +-#include "../zbar/gettext.h" + # include + # define _(string) gettext(string) + #else +-- +cgit v1.2.1 + diff --git a/zbar.spec b/zbar.spec index 7b231fa..e9684c1 100644 --- a/zbar.spec +++ b/zbar.spec @@ -1,38 +1,45 @@ +# 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 @@ -41,11 +48,12 @@ BuildRequires: libv4l-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 @@ -136,8 +144,8 @@ Summary(pl.UTF-8): Plik nagłówkowy widgetu GTK+ do skanowania i dekodowania ko 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. @@ -276,6 +284,8 @@ Wtyczka ZBar dla przeglądarek WWW. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 %build %{__libtoolize} @@ -287,9 +297,9 @@ Wtyczka ZBar dla przeglądarek WWW. 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} @@ -320,10 +330,11 @@ install -d $RPM_BUILD_ROOT%{_datadir}/%{name} # 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 \ @@ -443,17 +454,15 @@ fi %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 -- 2.44.0