diff --git a/py311.patch b/py311.patch new file mode 100644 index 0000000..6977d95 --- /dev/null +++ b/py311.patch @@ -0,0 +1,35 @@ +--- python/enum.c~ 2022-01-12 10:07:02.151116991 -0600 ++++ python/enum.c 2022-01-12 10:14:04.093001534 -0600 +@@ -23,6 +23,12 @@ + + #include "zbarmodule.h" + ++#if PY_VERSION_HEX < 0x030900A4 && !defined(Py_SET_SIZE) ++static inline void _Py_SET_SIZE(PyVarObject *ob, Py_ssize_t size) ++{ ob->ob_size = size; } ++#define Py_SET_SIZE(ob, size) _Py_SET_SIZE((PyVarObject*)(ob), size) ++#endif ++ + static char enumitem_doc[] = PyDoc_STR( + "simple enumeration item.\n" + "\n" +--- python/enum.c~ 2022-01-12 10:16:29.670271662 -0600 ++++ python/enum.c 2022-01-12 10:52:11.671258442 -0600 +@@ -58,7 +58,7 @@ + + /* we assume the "fast path" for a single-digit ints (see longobject.c) */ + /* this also holds if we get a small_int preallocated long */ +- Py_SIZE(&self->val) = Py_SIZE(longval); ++ Py_SET_SIZE(&self->val, longval); + self->val.ob_digit[0] = longval->ob_digit[0]; + Py_DECREF(longval); + #else +@@ -148,7 +148,7 @@ + + /* we assume the "fast path" for a single-digit ints (see longobject.c) */ + /* this also holds if we get a small_int preallocated long */ +- Py_SIZE(&self->val) = Py_SIZE(longval); ++ Py_SET_SIZE(&self->val, longval); + self->val.ob_digit[0] = longval->ob_digit[0]; + Py_DECREF(longval); + diff --git a/use_python3_on_python_script.patch b/use_python3_on_python_script.patch new file mode 100644 index 0000000..7161f1d --- /dev/null +++ b/use_python3_on_python_script.patch @@ -0,0 +1,10 @@ +diff --git a/test/test_python.py b/test/test_python.py +index 252c51a97256..8388d9a5aa36 100755 +--- a/test/test_python.py ++++ b/test/test_python.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + #------------------------------------------------------------------------ + # Copyright 2019 (c) Mauro Carvalho Chehab + # diff --git a/zbar-0.22.tar.bz2 b/zbar-0.22.tar.bz2 deleted file mode 100644 index ac362e1..0000000 Binary files a/zbar-0.22.tar.bz2 and /dev/null differ diff --git a/zbar-0.23.90.tar.bz2 b/zbar-0.23.90.tar.bz2 new file mode 100644 index 0000000..3ba712a Binary files /dev/null and b/zbar-0.23.90.tar.bz2 differ diff --git a/zbar.spec b/zbar.spec index 39cad3e..b8c5a82 100644 --- a/zbar.spec +++ b/zbar.spec @@ -1,93 +1,171 @@ +%ifarch %{java_arches} +%global JAVA 1 +%else +%global JAVA 0 +%endif + Name: zbar -Version: 0.22 -Release: 2 +Version: 0.23.90 +Release: 1 Summary: Bar code reader License: LGPLv2+ -URL: http://zbar.sourceforge.net/ -Source0: https://linuxtv.org/downloads/zbar/zbar-%{version}.tar.bz2 +URL: https://zbar.sourceforge.net/ +Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2 +Patch0: use_python3_on_python_script.patch +Patch1: py311.patch -BuildRequires: autoconf automake libtool gettext-devel -BuildRequires: qt5-qtbase-devel qt5-qtx11extras-devel gtk2-devel GraphicsMagick-c++-devel -BuildRequires: libv4l-devel libXv-devel xmlto dbus-devel +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: dbus-devel +BuildRequires: gettext-devel +BuildRequires: GraphicsMagick-devel +BuildRequires: gtk3-devel +BuildRequires: libSM-devel +BuildRequires: libtool +BuildRequires: libv4l-devel +BuildRequires: libXv-devel +BuildRequires: make +BuildRequires: pygobject3-devel +BuildRequires: qt5-qtbase-devel +BuildRequires: qt5-qtx11extras-devel +BuildRequires: xmlto +%if %{JAVA} +BuildRequires: java-11-openjdk-devel +%endif +BuildRequires: python3-devel %description -A layered bar code scanning and decoding library. Supports EAN, UPC, Code 128, -Code 39 and Interleaved 2 of 5. -Includes applications for decoding captured bar code images and using a video -device (e. g., webcam) as a bar code scanner. +ZBar Bar Code Reader is an open source software suite for reading bar +codes from various sources, such as video streams, image files and raw +intensity sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128, +Code 93, Code 39, Codabar, Interleaved 2 of 5, QR Code and SQ Code. %package devel -Summary: Bar code library extra development files -Requires: pkgconfig, zbar = %{version}-%{release} +Summary: Bar code reader library extra development files +Requires: %{name}-libs%{_isa} = %{version}-%{release} %description devel This package contains header files and additional libraries used for developing applications that read bar codes with this library. +%package libs +Summary: Bar code reader library + +%description libs +This package contains the ZBar Bar Code Reader library. + %package gtk -Summary: Bar code reader GTK widget -Requires: zbar = %{version}-%{release} +Summary: Bar code reader GTK widget +Requires: %{name}-libs%{_isa} = %{version}-%{release} +# Obsoleted in F37 +Obsoletes: %{name}-gi < %{version}-%{release} %description gtk This package contains a bar code scanning widget for use with GUI -applications based on GTK+-2.0. +applications based on GTK 3. %package gtk-devel -Summary: Bar code reader GTK widget extra development files -Requires: pkgconfig, zbar-gtk = %{version}-%{release}, zbar-devel = %{version}-%{release} +Summary: Bar code reader GTK widget extra development files +Requires: %{name}-devel%{_isa} = %{version}-%{release} +Requires: %{name}-gtk%{_isa} = %{version}-%{release} %description gtk-devel This package contains header files and additional libraries used for -developing GUI applications based on GTK+-2.0 that include a bar code +developing GUI applications based on GTK 3 that include a bar code scanning widget. %package qt -Summary: Bar code reader Qt widget -Requires: zbar = %{version}-%{release} +Summary: Bar code reader Qt widget +Requires: %{name}-libs%{_isa} = %{version}-%{release} %description qt This package contains a bar code scanning widget for use with GUI applications based on Qt4. %package qt-devel -Summary: Bar code reader Qt widget extra development files -Requires: pkgconfig, zbar-qt = %{version}-%{release}, zbar-devel = %{version}-%{release} +Summary: Bar code reader Qt widget extra development files +Requires: %{name}-devel%{_isa} = %{version}-%{release} +Requires: %{name}-qt%{_isa} = %{version}-%{release} %description qt-devel This package contains header files and additional libraries used for -developing GUI applications based on Qt4 that include a bar code +developing GUI applications based on Qt5 that include a bar code scanning widget. +%package -n python3-zbar +Summary: Bar code reader PyGTK widget +Requires: %{name}-libs%{_isa} = %{version}-%{release} +Requires: python3-pillow +# Renamed in F37 +Obsoletes: %{name}-python3 < %{version}-%{release} + +%description -n python3-zbar +This package contains a bar code scanning widget for use on +python applications that work with images. + +%if %{JAVA} +%package java +Summary: Bar code reader Java library +Requires: %{name}-devel%{_isa} = %{version}-%{release} +Requires: %{name}-gtk%{_isa} = %{version}-%{release} + +%description java +This package contains header files and additional libraries used for +on Java Native Interface (JNI) applications using ZBar. +%endif + %prep %setup -q +%patch0 -p1 +%patch1 -p0 %build -%configure --without-java --with-graphicsmagick --without-python2 --docdir=%{_docdir}/zbar-%{version} +%configure --with-python=python3 --with-gtk=auto --docdir=%{_docdir}/%{name}-%{version} --with-graphicsmagick --without-xshm --without-xv --enable-codes=ean,databar,code128,code93,code39,codabar,i25,qrcode,sqcode,pdf417 + +# rpath sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool -make %{?_smp_mflags} + +%make_build %install -rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" +%make_install +%if %{JAVA} +install -d %{buildroot}%{_jnidir} +mv %{buildroot}%{_datadir}/zbar/lib/zbar.jar %{buildroot}%{_jnidir} +mv %{buildroot}%{_datadir}/zbar/lib/libzbarjni.so* %{buildroot}%{_libdir} +%endif +cp test/test_python.py %{buildroot}%{_docdir} + +#Remove .la and .a files find ${RPM_BUILD_ROOT} -name '*.la' -or -name '*.a' | xargs rm -f + +# Remove installed doc rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-%{version}/ + %ldconfig_scriptlets + %ldconfig_scriptlets devel + %ldconfig_scriptlets gtk + %ldconfig_scriptlets qt +%find_lang zbar + %files -%doc NEWS README.md INSTALL.md -%license COPYING LICENSE +%doc NEWS.md README.md INSTALL.md %{_bindir}/zbarimg %{_bindir}/zbarcam -%{_libdir}/libzbar.so.* %{_mandir}/man1/* %{_sysconfdir}/dbus-1/system.d/org.linuxtv.Zbar.conf +%files libs -f zbar.lang +%license COPYING LICENSE.md +%{_libdir}/libzbar.so.0* + %files devel -%doc HACKING TODO +%doc HACKING.md TODO.md %{_libdir}/libzbar.so %{_libdir}/pkgconfig/zbar.pc %dir %{_includedir}/zbar @@ -105,11 +183,15 @@ rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-%{version}/ %files gtk %{_libdir}/libzbargtk.so.* %{_bindir}/zbarcam-gtk +%dir %{_libdir}/girepository-1.0 +%{_libdir}/girepository-1.0/ZBar-1.0.typelib %files gtk-devel %{_libdir}/libzbargtk.so %{_libdir}/pkgconfig/zbar-gtk.pc %{_includedir}/zbar/zbargtk.h +%dir %{_datadir}/gir-1.0 +%{_datadir}/gir-1.0/ZBar-1.0.gir %files qt %{_libdir}/libzbarqt.so.* @@ -120,11 +202,24 @@ rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-%{version}/ %{_libdir}/pkgconfig/zbar-qt.pc %{_includedir}/zbar/QZBar*.h +%if %{JAVA} +%files java +%{_jnidir}/zbar.jar +%{_libdir}/libzbarjni.so* +%endif + +%files -n python3-zbar +%{python3_sitearch}/zbar.so +%{_docdir}/test_python.py + %changelog -* Sat Jan 15 2022 Chen Chen - 0.22-2 +* Wed Nov 9 2022 hkgy - 0.23.90-1 +- Upgrade to v0.23.90 + +* Sat Jan 15 2022 Chen Chen - 0.22.0-2 - remove autoreconf for fix build error -* Thu Oct 22 2020 caodongxia - 0.22-1 +* Thu Oct 22 2020 caodongxia - 0.22.0-1 - update package from 0.20.1 to 0.22 * Tue Dec 3 2019 lingsheng - 0.20.1-4