Accepting request 1238011 from Printing
- hplip.spec: re-introduce macros for SLE12 compatibility, so that we can backport security fixes to older releases (bsc#1234745, CVE-2020-6923) OBS-URL: https://build.opensuse.org/request/show/1238011 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/hplip?expand=0&rev=157
This commit is contained in:
commit
b59d505c60
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jan 14 11:34:35 UTC 2025 - Martin Wilck <mwilck@suse.com>
|
||||||
|
|
||||||
|
- hplip.spec: re-introduce macros for SLE12 compatibility, so that
|
||||||
|
we can backport security fixes to older releases
|
||||||
|
(bsc#1234745, CVE-2020-6923)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jul 15 15:19:58 UTC 2024 - Martin Jambor <mjambor@suse.com>
|
Mon Jul 15 15:19:58 UTC 2024 - Martin Jambor <mjambor@suse.com>
|
||||||
|
|
||||||
|
63
hplip.spec
63
hplip.spec
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package hplip
|
# spec file for package hplip
|
||||||
#
|
#
|
||||||
# Copyright (c) 2024 SUSE LLC
|
# Copyright (c) 2025 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -17,12 +17,35 @@
|
|||||||
|
|
||||||
|
|
||||||
# python-rpm-macros doesn't work for hplip!
|
# python-rpm-macros doesn't work for hplip!
|
||||||
# We just build for py3 since SLE15
|
%if 0%{?suse_version} >= 1500
|
||||||
%define pyversion 3
|
%define pyversion 3
|
||||||
%define pymod() python3-%{**}
|
%define pymod() python3-%{**}
|
||||||
%define pyver %{py3_ver}
|
%define pyver %{py3_ver}
|
||||||
%define pyexe %{_bindir}/python3
|
%define pyexe %{_bindir}/python3
|
||||||
|
%define py_compile(O) %{py3_compile %{-O} %*}
|
||||||
%global use_qt5 1
|
%global use_qt5 1
|
||||||
|
%define gobject gobject
|
||||||
|
%else
|
||||||
|
%define pyversion 2
|
||||||
|
%define pymod() python-%{**}
|
||||||
|
%define pyver %{py_ver}
|
||||||
|
%define pyexe %{_bindir}/python
|
||||||
|
%define gobject gobject2
|
||||||
|
%global use_qt5 0
|
||||||
|
%global make_build make V=1
|
||||||
|
%global make_install make DESTDIR=%{buildroot} V=1 install
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if 0%{use_qt5}
|
||||||
|
%global config_qt_opts --disable-qt4 --enable-qt5
|
||||||
|
%global requires_qt %{pymod qt5}
|
||||||
|
%global ui_dir ui5
|
||||||
|
%else
|
||||||
|
%global config_qt_opts --enable-qt4 --disable-qt5
|
||||||
|
%global requires_qt %{pymod qt4}
|
||||||
|
%global ui_dir ui4
|
||||||
|
%endif
|
||||||
|
|
||||||
Name: hplip
|
Name: hplip
|
||||||
Version: 3.24.4
|
Version: 3.24.4
|
||||||
Release: 0
|
Release: 0
|
||||||
@ -93,8 +116,13 @@ Patch603: hplip-scan-orblite-c99.patch
|
|||||||
Patch604: hplip-sclpml-strcasestr.patch
|
Patch604: hplip-sclpml-strcasestr.patch
|
||||||
Patch605: hplip-hpaio-gcc14.patch
|
Patch605: hplip-hpaio-gcc14.patch
|
||||||
|
|
||||||
BuildRequires: %{pymod devel}
|
%if %use_qt5
|
||||||
BuildRequires: %{pymod qt5-devel}
|
BuildRequires: %{pymod qt5-devel}
|
||||||
|
%else
|
||||||
|
BuildRequires: %{pymod qt4}
|
||||||
|
BuildRequires: libqt4-devel
|
||||||
|
%endif
|
||||||
|
BuildRequires: %{pymod devel}
|
||||||
BuildRequires: %{pymod xml}
|
BuildRequires: %{pymod xml}
|
||||||
BuildRequires: cups > 1.5
|
BuildRequires: cups > 1.5
|
||||||
BuildRequires: cups-devel > 1.5
|
BuildRequires: cups-devel > 1.5
|
||||||
@ -133,7 +161,7 @@ Requires: %{name}-hpijs = %{version}-%{release}
|
|||||||
Requires: %{name}-sane = %{version}-%{release}
|
Requires: %{name}-sane = %{version}-%{release}
|
||||||
Requires: %{pymod dbus-python} >= 0.80
|
Requires: %{pymod dbus-python} >= 0.80
|
||||||
Requires: %{pymod gobject}
|
Requires: %{pymod gobject}
|
||||||
Requires: %{pymod qt5}
|
Requires: %{requires_qt}
|
||||||
Requires: cups > 1.5
|
Requires: cups > 1.5
|
||||||
# foomatic-filters and cups-filters-foomatic-rip
|
# foomatic-filters and cups-filters-foomatic-rip
|
||||||
# do not require Ghostscript because depending on the PPD
|
# do not require Ghostscript because depending on the PPD
|
||||||
@ -162,7 +190,9 @@ Requires(post): %{_bindir}/find
|
|||||||
Requires(post): /bin/grep
|
Requires(post): /bin/grep
|
||||||
Requires(post): /bin/sed
|
Requires(post): /bin/sed
|
||||||
Requires(post): coreutils
|
Requires(post): coreutils
|
||||||
|
%if 0%{?suse_version} >= 1500
|
||||||
Recommends: python3-reportlab
|
Recommends: python3-reportlab
|
||||||
|
%endif
|
||||||
# Obsolete earlier package names
|
# Obsolete earlier package names
|
||||||
Obsoletes: hplip17
|
Obsoletes: hplip17
|
||||||
Provides: hplip3 = 3.9.5
|
Provides: hplip3 = 3.9.5
|
||||||
@ -260,8 +290,10 @@ Requires: %{name}-udev-rules = %{version}-%{release}
|
|||||||
Suggests: %{name} = %{version}
|
Suggests: %{name} = %{version}
|
||||||
Enhances: sane-backends
|
Enhances: sane-backends
|
||||||
# Automatically install this package if hpijs sub-package and sane-backends are
|
# Automatically install this package if hpijs sub-package and sane-backends are
|
||||||
# both installed:
|
# both installed (syntax only
|
||||||
|
%if 0%{?suse_version} >= 1500
|
||||||
Supplements: (%{name}-hpijs and sane-backends)
|
Supplements: (%{name}-hpijs and sane-backends)
|
||||||
|
%endif
|
||||||
|
|
||||||
%description sane
|
%description sane
|
||||||
This package includes the backend driver for scanning with HP scanners
|
This package includes the backend driver for scanning with HP scanners
|
||||||
@ -336,7 +368,10 @@ This sub-package is only required by developers.
|
|||||||
%patch -P 401 -p1
|
%patch -P 401 -p1
|
||||||
%patch -P 402 -p1
|
%patch -P 402 -p1
|
||||||
%patch -P 403 -p1
|
%patch -P 403 -p1
|
||||||
|
%if 0%{?suse_version} >= 1500
|
||||||
|
# This patch replaces python-config by python3-config, don't apply on SLE12
|
||||||
%patch -P 404 -p1
|
%patch -P 404 -p1
|
||||||
|
%endif
|
||||||
%patch -P 500 -p1
|
%patch -P 500 -p1
|
||||||
%patch -P 601 -p1
|
%patch -P 601 -p1
|
||||||
%patch -P 602 -p1
|
%patch -P 602 -p1
|
||||||
@ -361,7 +396,7 @@ cp -p %{SOURCE103} %{SOURCE104} ppd/hpcups
|
|||||||
# in each directory where a Makefile.am exists:
|
# in each directory where a Makefile.am exists:
|
||||||
AUTOMAKE='automake --foreign' autoreconf -fvi
|
AUTOMAKE='automake --foreign' autoreconf -fvi
|
||||||
# Fix improper method of Python.h lookup in configure, no longer working with Python 3.8
|
# Fix improper method of Python.h lookup in configure, no longer working with Python 3.8
|
||||||
PYTHON_INCLUDEDIR="$(python3-config --includes)"
|
PYTHON_INCLUDEDIR="$(%{pymod config} --includes)"
|
||||||
# Set our preferred architecture-specific flags for the compiler and linker:
|
# Set our preferred architecture-specific flags for the compiler and linker:
|
||||||
export CFLAGS="%{optflags} ${PYTHON_INCLUDEDIR} -Wno-error=return-type"
|
export CFLAGS="%{optflags} ${PYTHON_INCLUDEDIR} -Wno-error=return-type"
|
||||||
export CXXFLAGS="%{optflags} ${PYTHON_INCLUDEDIR} -fno-strict-aliasing -Wno-error=return-type"
|
export CXXFLAGS="%{optflags} ${PYTHON_INCLUDEDIR} -fno-strict-aliasing -Wno-error=return-type"
|
||||||
@ -391,8 +426,7 @@ export CXXFLAGS="%{optflags} ${PYTHON_INCLUDEDIR} -fno-strict-aliasing -Wno-erro
|
|||||||
# so that --with-htmldir must be explicitly set.
|
# so that --with-htmldir must be explicitly set.
|
||||||
%configure \
|
%configure \
|
||||||
--disable-qt3 \
|
--disable-qt3 \
|
||||||
--disable-qt4 \
|
%{config_qt_opts} \
|
||||||
--enable-qt5 \
|
|
||||||
--disable-policykit \
|
--disable-policykit \
|
||||||
--enable-doc-build \
|
--enable-doc-build \
|
||||||
--enable-network-build \
|
--enable-network-build \
|
||||||
@ -424,8 +458,7 @@ sed -i 's|ppd/hpcups/\*.ppd.gz ||g' Makefile
|
|||||||
%make_install
|
%make_install
|
||||||
|
|
||||||
# Make and install Python compiled bytecode files
|
# Make and install Python compiled bytecode files
|
||||||
%py3_compile %{buildroot}%{_datadir}/hplip
|
%py_compile -O %{buildroot}%{_datadir}/hplip
|
||||||
%py3_compile -O %{buildroot}%{_datadir}/hplip
|
|
||||||
|
|
||||||
# Hardlink .pyc and .pyo when they have same content.
|
# Hardlink .pyc and .pyo when they have same content.
|
||||||
# Do not run "fdupes buildroot/_datadir/hplip" because
|
# Do not run "fdupes buildroot/_datadir/hplip" because
|
||||||
@ -673,14 +706,14 @@ exit 0
|
|||||||
%{_datadir}/hplip/
|
%{_datadir}/hplip/
|
||||||
%exclude %{_datadir}/hplip/data/models/models.dat
|
%exclude %{_datadir}/hplip/data/models/models.dat
|
||||||
%exclude %{_datadir}/hplip/base/imageprocessing.py*
|
%exclude %{_datadir}/hplip/base/imageprocessing.py*
|
||||||
%exclude %{_datadir}/hplip/ui5/scandialog.py*
|
%exclude %{_datadir}/hplip/%{ui_dir}/scandialog.py*
|
||||||
%exclude %{_datadir}/hplip/scan
|
%exclude %{_datadir}/hplip/scan
|
||||||
%exclude %{_datadir}/hplip/scan.py*
|
%exclude %{_datadir}/hplip/scan.py*
|
||||||
%exclude %{_datadir}/hplip/uiscan.py*
|
%exclude %{_datadir}/hplip/uiscan.py*
|
||||||
%exclude %{_datadir}/hplip/__pycache__/uiscan.*
|
%exclude %{_datadir}/hplip/__pycache__/uiscan.*
|
||||||
%exclude %{_datadir}/hplip/__pycache__/scan.*
|
%exclude %{_datadir}/hplip/__pycache__/scan.*
|
||||||
%exclude %{_datadir}/hplip/base/__pycache__/imageprocessing.*
|
%exclude %{_datadir}/hplip/base/__pycache__/imageprocessing.*
|
||||||
%exclude %{_datadir}/hplip/ui5/__pycache__/scandialog.*
|
%exclude %{_datadir}/hplip/%{ui_dir}/__pycache__/scandialog.*
|
||||||
|
|
||||||
# The scanning utils depend on PIL and python3-scikit-image,
|
# The scanning utils depend on PIL and python3-scikit-image,
|
||||||
# which are not available in SLE
|
# which are not available in SLE
|
||||||
@ -693,11 +726,13 @@ exit 0
|
|||||||
%{_datadir}/hplip/scan.py*
|
%{_datadir}/hplip/scan.py*
|
||||||
%{_datadir}/hplip/uiscan.py*
|
%{_datadir}/hplip/uiscan.py*
|
||||||
%{_datadir}/hplip/base/imageprocessing.py*
|
%{_datadir}/hplip/base/imageprocessing.py*
|
||||||
%{_datadir}/hplip/ui5/scandialog.py*
|
%if %{pyversion} != 2
|
||||||
|
%{_datadir}/hplip/%{ui_dir}/scandialog.py*
|
||||||
%{_datadir}/hplip/__pycache__/uiscan.*
|
%{_datadir}/hplip/__pycache__/uiscan.*
|
||||||
%{_datadir}/hplip/__pycache__/scan.*
|
%{_datadir}/hplip/__pycache__/scan.*
|
||||||
%{_datadir}/hplip/base/__pycache__/imageprocessing.*
|
%{_datadir}/hplip/base/__pycache__/imageprocessing.*
|
||||||
%{_datadir}/hplip/ui5/__pycache__/scandialog.*
|
%{_datadir}/hplip/%{ui_dir}/__pycache__/scandialog.*
|
||||||
|
%endif
|
||||||
|
|
||||||
%files hpijs
|
%files hpijs
|
||||||
%config %{_sysconfdir}/hp/
|
%config %{_sysconfdir}/hp/
|
||||||
|
Loading…
Reference in New Issue
Block a user