- Add hplip-pserror-c99.patch hplip-scan-hpaio-include.patch

hplip-scan-orblite-c99.patch hplip-sclpml-strcasestr.patch
  hplip-hpaio-gcc14.patch to avoid C99 violations which prevent
  building with GCC 14. [boo#1225777]

The patches were taken from
bbb19dff5e
and
d726b77698

If the request is OK, please forward it to Factory soon-ish too so
that we can switch the default compiler.  Thanks!

OBS-URL: https://build.opensuse.org/package/show/Printing/hplip?expand=0&rev=252
This commit is contained in:
Martin Wilck 2024-07-15 19:10:46 +00:00 committed by Git OBS Bridge
commit 95e3708c4c
35 changed files with 6102 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,60 @@
From af8ddd502a88f8dc0910c2c9a91471be8434af61 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Mon, 13 Jan 2020 18:20:22 +0100
Subject: [PATCH] Revert changes from 3.18.5 that break hp-setup for fax
devices
See bsc#1107711, lp#1773320
https://launchpadlibrarian.net/371794274/hplip-use-binary-str.patch
Credits: Eric Schirra <ecsos@schirra.net>
---
base/utils.py | 5 +----
fax/pmlfax.py | 8 ++++----
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/base/utils.py b/base/utils.py
index f268cf8..cc77820 100644
--- a/base/utils.py
+++ b/base/utils.py
@@ -954,10 +954,7 @@ else:
def printable(s):
- if s:
- return s.translate(identity, unprintable)
- else:
- return ""
+ return s.translate(identity, unprintable)
def any(S,f=lambda x:x):
diff --git a/fax/pmlfax.py b/fax/pmlfax.py
index adcc1cb..b68ff6a 100644
--- a/fax/pmlfax.py
+++ b/fax/pmlfax.py
@@ -143,8 +143,8 @@ class PMLFaxDevice(FaxDevice):
def getPhoneNum(self):
if PY3:
- data = utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1])
- return data
+ data = utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1].encode('utf-8'))
+ return data.decode('utf-8')
else:
return utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1])
phone_num = property(getPhoneNum, setPhoneNum, doc="OID_FAX_LOCAL_PHONE_NUM")
@@ -155,8 +155,8 @@ class PMLFaxDevice(FaxDevice):
def getStationName(self):
if PY3:
- data = utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1])
- return data
+ data = utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1].encode('utf-8'))
+ return data.decode('utf-8')
else:
return utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1])
--
2.24.1

View File

@ -0,0 +1,41 @@
From ba542439639453148ea804fc4e396534cd99abb9 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Mon, 2 Jan 2023 15:33:07 +0100
Subject: [PATCH] Use lsb_release fallback code if "import distro" fails
With python 3.8, the standard python "platform" module doesn't
provide the "dist()" function any more. The "distro" module is
used instead. However, not all distributions ship the "distro"
module by default. Catch the resulting exception, and use the
already existing fallback code to determine the distribution
using lsb_release.
---
base/utils.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/base/utils.py b/base/utils.py
index 94d5c8c..458ddd8 100644
--- a/base/utils.py
+++ b/base/utils.py
@@ -2519,10 +2519,14 @@ def get_distro_name(passwordObj = None):
name = platform.dist()[0].lower()
ver = platform.dist()[1]
except AttributeError:
- import distro
- name = distro.linux_distribution()[0].lower()
- ver = distro.linux_distribution()[1]
- distro_release_name = distro.distro_release_attr('name')
+ try:
+ import distro
+ name = distro.linux_distribution()[0].lower()
+ ver = distro.linux_distribution()[1]
+ distro_release_name = distro.distro_release_attr('name')
+ except (ImportError, AttributeError):
+ # Use fallback code below
+ pass
if not name:
found = False
log.debug("Not able to detect distro")
--
2.39.0

4
_service Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0"?><!-- -*- xml -*- -->
<services>
<service name="download_files" mode="manual"/>
</services>

View File

@ -0,0 +1,95 @@
From d52301159a5add137b46e7183970ea1f1cbfe8ac Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Fri, 15 Sep 2023 18:27:13 +0200
Subject: [PATCH 04/19] add missing includes and define GNU_SOURCE
---
common/utils.c | 5 +++++
io/hpmud/jd.c | 1 +
protocol/hp_ipp.c | 4 ++++
scan/sane/bb_ledm.c | 1 +
scan/sane/sclpml.c | 5 +++++
5 files changed, 16 insertions(+)
diff --git a/common/utils.c b/common/utils.c
index d8ecee9..6f5cef9 100644
--- a/common/utils.c
+++ b/common/utils.c
@@ -1,9 +1,14 @@
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
#include "utils.h"
#include "string.h"
#include <dlfcn.h>
#include <sys/stat.h>
#include <errno.h>
#include <stdlib.h>
+#include <string.h>
extern int errno;
diff --git a/io/hpmud/jd.c b/io/hpmud/jd.c
index be3c823..c15ed9c 100644
--- a/io/hpmud/jd.c
+++ b/io/hpmud/jd.c
@@ -31,6 +31,7 @@
#endif
#include <signal.h>
+#include <stdlib.h>
#include "hpmud.h"
#include "hpmudi.h"
diff --git a/protocol/hp_ipp.c b/protocol/hp_ipp.c
index 8b72c65..9b05f5e 100644
--- a/protocol/hp_ipp.c
+++ b/protocol/hp_ipp.c
@@ -18,6 +18,10 @@ Boston, MA 02110-1301, USA.
\******************************************************************************/
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
#include <cups/cups.h>
#include <cups/language.h>
#include <cups/ppd.h>
diff --git a/scan/sane/bb_ledm.c b/scan/sane/bb_ledm.c
index 4b18af8..eaf1299 100644
--- a/scan/sane/bb_ledm.c
+++ b/scan/sane/bb_ledm.c
@@ -27,6 +27,7 @@
# include "xml.h"
# include <stdlib.h>
+# include <unistd.h>
# include <stdint.h>
# define _STRINGIZE(x) #x
diff --git a/scan/sane/sclpml.c b/scan/sane/sclpml.c
index 9a5975f..3250541 100644
--- a/scan/sane/sclpml.c
+++ b/scan/sane/sclpml.c
@@ -25,11 +25,16 @@
\************************************************************************************/
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
+#include <sys/time.h>
#include "sane.h"
#include "saneopts.h"
#include "common.h"
--
2.42.0

53
change-udev-rules.diff Normal file
View File

@ -0,0 +1,53 @@
Index: b/data/rules/56-hpmud.rules
===================================================================
--- a/data/rules/56-hpmud.rules
+++ b/data/rules/56-hpmud.rules
@@ -1,8 +1,33 @@
# HPLIP udev rules file. Notify console user if plugin support is required for this device.
+#
+# SUSE changed:
+#
+# Exchanged the rule to GOTO hpmud_usb_rules if SUBSYSTEM is "usb"
+# with the rule if SUBSYSTEM is "ppdev" to avoid that the "ppdev" rule
+# is needlessly processed when SUBSYSTEM is "usb".
+#
+# Added GOTO hpmud_rules_end rule to skip the hpmud_usb_rules
+# if SUBSYSTEM is not "usb" or if ENV{DEVTYPE} is not "usb_device" or if SUBSYSTEM is not "ppdev"
+# to avoid that the hpmud_usb_rules are needlessly processed.
+#
+# The rule to automatically "check ... plugin status" is disabled
+# because automated installation of non-free proprietary third-party software
+# (here the plugin from HP) should not happen and it can cause whatever kind
+# of strange behaviour see for example https://bugs.launchpad.net/bugs/1197416
+# and https://bugs.launchpad.net/bugs/1221348
+# while in contrast manual printer setup via hp-setup usually "just works"
+# and it is clear for the user what goes on and in case of failure what went wrong.
+#
+# Because the rule to automatically "check ... plugin status"
+# is also used to upload firmware into printers that need it
+# see https://bugs.launchpad.net/bugs/1220628
+# a rule that only uploads firmware into printers that need it is added.
+#
+# If possible activate hpaio backend support in /etc/sane.d/dll.conf.
ACTION!="add", GOTO="hpmud_rules_end"
-SUBSYSTEM=="ppdev", OWNER="root", GROUP="lp", MODE="0664"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GOTO="hpmud_usb_rules"
+SUBSYSTEM=="ppdev", OWNER="root", GROUP="lp", MODE="0664"
GOTO="hpmud_rules_end"
LABEL="hpmud_usb_rules"
@@ -13,6 +38,12 @@ ENV{ID_USB_INTERFACES}=="", IMPORT{built
ATTR{idVendor}=="03f0", ENV{ID_USB_INTERFACES}=="*:0701??:*|*:ffcc00:", OWNER="root", GROUP="lp", MODE="0664", ENV{libsane_matched}="yes", ENV{hp_test}="yes", ENV{ID_HPLIP}="1"
# This rule will check the smart install feature, plugin status and firmware download for the required printers.
-ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'logger -p user.info loading HP Device $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c '/usr/bin/nohup /usr/bin/hp-config_usb_printer $env{BUSNUM}:$env{DEVNUM}'"
+#ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'logger -p user.info loading HP Device $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c '/usr/bin/nohup /usr/bin/hp-config_usb_printer $env{BUSNUM}:$env{DEVNUM}'"
+# This rule uploads firmware to HP USB printer devices if needed:
+ENV{hp_test}=="yes", PROGRAM="/bin/logger -p user.info udev hpmud.rules runs hp-firmware to test if HP device with USB vendor ID $attr{idVendor} and USB product ID $attr{idProduct} at USB bus ID $env{BUSNUM} and USB device ID $env{DEVNUM} needs firmware and if yes to upload it", RUN+="/usr/bin/hp-firmware -s $env{BUSNUM}:$env{DEVNUM}"
+
+# If possible activate hpaio backend support in /etc/sane.d/dll.conf:
+ENV{libsane_matched}=="yes", RUN+="/bin/sh -c 'if test -w /etc/sane.d/dll.conf ; then sed -i -e /hpaio/d /etc/sane.d/dll.conf ; echo hpaio >>/etc/sane.d/dll.conf ; fi'"
LABEL="hpmud_rules_end"
+

View File

@ -0,0 +1,64 @@
From 9a7ed59efcf645256f8a07f4fb71bf0f838e3838 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Sat, 9 Jan 2021 01:21:08 +0100
Subject: [PATCH] dcheck.py: fix crash in Qt4 version check
On openSUSE, the "PyQt4" module may be available with no submodules.
I.e. "import PyQt4" succeeds, wheras "from PyQt4 import QtCore" fails.
We don't want to make hplip depend on python3-qt4, as all tools use Qt5.
This leads to the following python backtrace in hp-doctor:
Traceback (most recent call last):
File "/usr/bin/hp-doctor", line 297, in <module>
num_errors, num_warns = dep.validate(DEPENDENCY_RUN_AND_COMPILE_TIME, False)
File "/usr/share/hplip/check.py", line 368, in validate
self.core.dependencies[dep])
File "/usr/share/hplip/check.py", line 210, in __update_deps_info
installed_ver = self.core.version_func[deps_info[6]]()
File "/usr/share/hplip/installer/dcheck.py", line 304, in get_pyQt4_version
from PyQt4 import QtCore
ImportError: cannot import name 'QtCore'
Fix it.
---
installer/dcheck.py | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/installer/dcheck.py b/installer/dcheck.py
index d684c10..6215b4b 100644
--- a/installer/dcheck.py
+++ b/installer/dcheck.py
@@ -300,8 +300,12 @@ def get_pyQt4_version():
except ImportError:
ver='-'
else:
- from PyQt4 import QtCore
- ver = QtCore.PYQT_VERSION_STR
+ try:
+ from PyQt4 import QtCore
+ except ImportError:
+ pass
+ else:
+ ver = QtCore.PYQT_VERSION_STR
return ver
@@ -314,8 +318,12 @@ def get_pyQt5_version():
except ImportError:
ver='-'
else:
- from PyQt5 import QtCore
- ver = QtCore.PYQT_VERSION_STR
+ try:
+ from PyQt5 import QtCore
+ except ImportError:
+ pass
+ else:
+ ver = QtCore.PYQT_VERSION_STR
return ver
def get_reportlab_version():
--
2.29.2

16
disable_hp-upgrade.patch Normal file
View File

@ -0,0 +1,16 @@
Index: b/upgrade.py
===================================================================
--- a/upgrade.py
+++ b/upgrade.py
@@ -207,6 +207,11 @@ if os.geteuid() == 0:
if os.getenv("HPLIP_DEBUG"):
log.set_level('debug')
+
+log.info("HPLIP upgrade is disabled by openSUSE for security reasons, see https://bugzilla.suse.com/show_bug.cgi?id=853405 - if you like to upgrade HPLIP, use an openSUSE software package manager like YaST or zypper.")
+clean_exit(1)
+
+
for o, a in opts:
if o in ('-h', '--help'):
usage()

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:95adb9432739ec7bc22f7df991881a74774bbb63abce554fe8737d8e97f9fc95
size 3147

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1027ad7fda5a3a488e81aef15cce0763048e619680bbe90c74720ad00f0881a7
size 2507

View File

@ -0,0 +1,39 @@
From 8b1bbbb9a3659475367a6f58986ac8248576663b Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Fri, 10 Jan 2020 14:44:51 +0100
Subject: [PATCH] hp-sendfax: avoid crash if python-reportlab is missing
Avoids this crash:
warning: Reportlab not installed. Fax coverpages disabled.
warning: Please install version 2.0+ of Reportlab for coverpage support.
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 669, resource id: 13465094, major code: 40 (TranslateCoords), minor code: 0
Traceback (most recent call last):
File "/usr/share/hplip/ui5/sendfaxdialog.py", line 375, in FilesTable_fileListChanged
self.toggleCoverPage(self.FilesTable.isMIMETypeInList(MIME_TYPE_COVERPAGE))
File "/usr/share/hplip/ui5/sendfaxdialog.py", line 328, in toggleCoverPage
---
ui5/sendfaxdialog.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ui5/sendfaxdialog.py b/ui5/sendfaxdialog.py
index 4248907..3c3e880 100644
--- a/ui5/sendfaxdialog.py
+++ b/ui5/sendfaxdialog.py
@@ -325,9 +325,11 @@ class SendFaxDialog(QDialog, Ui_Dialog):
def toggleCoverPage(self, b):
# XXX: qt5port: disconnect method requires attention
- self.CoverPageGroupBox.toggled[bool].disconnect(self.CoverPageGroupBox_toggled)
+ if coverpages_enabled:
+ self.CoverPageGroupBox.toggled[bool].disconnect(self.CoverPageGroupBox_toggled)
self.CoverPageGroupBox.setChecked(b)
- self.CoverPageGroupBox.toggled[bool].connect(self.CoverPageGroupBox_toggled)
+ if coverpages_enabled:
+ self.CoverPageGroupBox.toggled[bool].connect(self.CoverPageGroupBox_toggled)
#
--
2.24.1

View File

@ -0,0 +1,36 @@
From 10fe460cca9536dbb52c30fa8bec5c6a01e94ea0 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Fri, 15 Sep 2023 18:28:47 +0200
Subject: [PATCH 09/19] hp_ipp.h: add missing prototypes
---
protocol/hp_ipp.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/protocol/hp_ipp.h b/protocol/hp_ipp.h
index 032be9a..518d0ae 100644
--- a/protocol/hp_ipp.h
+++ b/protocol/hp_ipp.h
@@ -149,6 +149,7 @@ int auth_cancel_req = 0; // 0--> authentication cancel is not requested,
http_t* acquireCupsInstance();
+void _releaseCupsInstance();
const char *getCupsErrorString(int status);
void freePrinterList(printer_t *list);
@@ -163,6 +164,11 @@ ipp_t *usbDoFileRequest(ipp_t *request, int iFileHandle,char *device_uri, const
ipp_t * networkDoRequest(ipp_t *request, char* device_uri,const char *resource);
ipp_t * getDeviceStatusAttributes(char* device_uri,char* printer_name, int *count);
int getCupsPrinters(printer_t **printer_list);
+int addCupsPrinter(char *name, char *device_uri, char *location, char *ppd_file,
+ char *model, char *info);
+int delCupsPrinter(char *pr_name);
+int setDefaultCupsPrinter(char *pr_name);
+int controlCupsPrinter(char *pr_name, int op);
HPIPP_RESULT parseResponseHeader(char* header, int *content_length, int *chunked, int* header_size);
HPIPP_RESULT prepend_http_header(raw_ipp *raw_request,const char *resource);
--
2.42.0

View File

@ -0,0 +1,73 @@
From ca4af49f2979610ff2c6818ebd0072432417ba95 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Fri, 1 Jun 2018 17:09:31 +0200
Subject: [PATCH] hpijs: avoid segfault in DJGenericVIP::DJGenericVIP()
DJGenericVIP::DJGenericVIP() doesn't treat an error from VerifyPenInfo() as
fatal, but the superclass constructor DJ9xxVIP::DJ9xxVIP() does. This
may lead to a sefgault in DJGenericVIP::DJGenericVIP() because ModeCount and
pMode aren't initialized by the superclass constructor.
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
prnt/hpijs/dj9xxvip.cpp | 8 ++++++--
prnt/hpijs/dj9xxvip.h | 3 ++-
prnt/hpijs/djgenericvip.cpp | 2 +-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/prnt/hpijs/dj9xxvip.cpp b/prnt/hpijs/dj9xxvip.cpp
index 519036c..0a5c959 100644
--- a/prnt/hpijs/dj9xxvip.cpp
+++ b/prnt/hpijs/dj9xxvip.cpp
@@ -55,7 +55,8 @@ extern MediaType MediaTypeToPcl (MEDIATYPE eMediaType);
DJ9xxVIP::DJ9xxVIP
(
SystemServices* pSS,
- BOOL proto
+ BOOL proto,
+ BOOL ignore_pen_error
) :
Printer(pSS, NUM_DJ6XX_FONTS, proto),
PCL3acceptsDriverware(TRUE)
@@ -67,7 +68,10 @@ DJ9xxVIP::DJ9xxVIP
{
bCheckForCancelButton = TRUE;
constructor_error = VerifyPenInfo();
- CERRCHECK;
+ if (!ignore_pen_error) {
+ CERRCHECK;
+ } else
+ ePen = BOTH_PENS;
}
else ePen = BOTH_PENS; // matches default mode
diff --git a/prnt/hpijs/dj9xxvip.h b/prnt/hpijs/dj9xxvip.h
index 85eb3ac..af1be8f 100644
--- a/prnt/hpijs/dj9xxvip.h
+++ b/prnt/hpijs/dj9xxvip.h
@@ -42,7 +42,8 @@ APDK_BEGIN_NAMESPACE
class DJ9xxVIP : public Printer
{
public:
- DJ9xxVIP(SystemServices* pSS, BOOL proto=FALSE);
+ DJ9xxVIP(SystemServices* pSS, BOOL proto=FALSE,
+ BOOL ignore_pen_error=FALSE);
Header* SelectHeader(PrintContext* pc);
DRIVER_ERROR VerifyPenInfo();
diff --git a/prnt/hpijs/djgenericvip.cpp b/prnt/hpijs/djgenericvip.cpp
index b7e79dc..7228fcf 100644
--- a/prnt/hpijs/djgenericvip.cpp
+++ b/prnt/hpijs/djgenericvip.cpp
@@ -47,7 +47,7 @@ extern uint32_t ulMapDJ600_CCM_K[ 9 * 9 * 9 ];
*/
DJGenericVIP::DJGenericVIP (SystemServices* pSS, BOOL proto)
- : DJ9xxVIP (pSS, proto)
+ : DJ9xxVIP (pSS, proto, true)
{
if (!proto && IOMode.bDevID)
--
2.17.0

3
hpijs.1.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fb60642e55839c311ee8037bfc739ffc7c77555c176beef5bdbc4f965e322b61
size 682

View File

@ -0,0 +1,56 @@
Index: b/configure.in
===================================================================
--- a/configure.in
+++ b/configure.in
@@ -628,20 +628,31 @@ if test "$class_driver" = "no" && test "
fi
fi
-SAVE_CPPFLAGS="$CPPFLAGS"
-CFLAGS=`python-config --includes`
-if [ $? -eq 0 ]
-then
- echo $FLAGS
-else
-CFLAGS=`python3-config --includes`
- if [ $? -eq 0 ]
- then
- echo $FLAGS
- fi
+AC_PATH_PROG(python3_config_path, python3-config, [AC_MSG_ERROR([python3-config not installed], 6)])
+
+PYTHON_INCLUDES=`$python3_config_path --includes`
+if test "X$PYTHON_INCLUDES" = "X" ; then
+ AC_MSG_ERROR([Cannot get Python includes via python3-config], 6)
+fi
+
+PYTHON_LIBS=`$python3_config_path --libs`
+if test "X$PYTHON_LIBS" = "X" ; then
+ AC_MSG_ERROR([Cannot get Python libs via python3-config], 6)
+fi
+
+SAVE_CFLAGS=$CFLAGS
+SAVE_LIBS=$LIBS
+
+CFLAGS="$CFLAGS $PYTHON_INCLUDES"
+LIBS="$LIBS $PYTHON_LIBS"
+
+AC_TRY_LINK(,[ ], AC_MSG_RESULT(yes); python_includes="ok", AC_MSG_ERROR([no: PYTHON DISABLED], 6))
+
+if test "X$python_includes" != "Xok" ; then
+ CFLAGS="$SAVE_CFLAGS"
+ LIBS="$SAVE_LIBS"
fi
-#CFLAGS=`(python-config --includes)`
if test "$class_driver" = "no" && test "$hpijs_only_build" = "no" && test "$lite_build" = "no" && test "$hpcups_only_build" = "no"; then
AC_ARG_VAR([PYTHON], [Python interpreter/compiler command])
AC_CHECK_PROGS(PYTHON,[python python3 python2])
@@ -655,7 +666,6 @@ if test "$class_driver" = "no" && test "
AS_IF([test "x$FOUND_HEADER" != "xyes"],
[AC_MSG_ERROR([cannot find python-devel support], 6)])
fi
-CFLAGS="$save_CFLAGS"
if test "$hpijs_only_build" = "no" && test "$scan_build" = "yes" && test "$hpcups_only_build" = "no"; then
AC_CHECK_LIB([sane], [sane_open], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find sane-backends-devel support (or --disable-scan-build)], 12)])

3
hplip-3.24.4.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5d7643831893a5e2addf9d42d581a5dbfe5aaf023626886b8762c5645da0f1fb
size 30217933

6
hplip-3.24.4.tar.gz.asc Normal file
View File

@ -0,0 +1,6 @@
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQRKui9m29WpWJSRDgZz13DNpZBHuQUCZk13yQAKCRBz13DNpZBH
uc7TAKDAX4308SYP7pgb85UTMbPbhfivmgCghMp2sBrpiCvOZTeozYO4WVzW1mg=
=CKxG
-----END PGP SIGNATURE-----

View File

@ -0,0 +1,13 @@
Index: hplip-3.19.6/base/validation.py
===================================================================
--- hplip-3.19.6.orig/base/validation.py 2019-06-26 15:07:10.000000000 +0200
+++ hplip-3.19.6/base/validation.py 2019-10-16 09:53:51.966435988 +0200
@@ -42,7 +42,7 @@ class DigiSign_Verification(object):
class GPG_Verification(DigiSign_Verification):
- def __init__(self, pgp_site = 'pgp.mit.edu', key = 0x4ABA2F66DBD5A95894910E0673D770CDA59047B9):
+ def __init__(self, pgp_site = 'pgp.surf.nl', key = 0x4ABA2F66DBD5A95894910E0673D770CDA59047B9):
self.__pgp_site = pgp_site
self.__key = key
self.__gpg = utils.which('gpg',True)

114
hplip-hpaio-gcc14.patch Normal file
View File

@ -0,0 +1,114 @@
diff --git a/scan/sane/hpaio.c b/scan/sane/hpaio.c
index 57d1dde..3475929 100644
--- a/scan/sane/hpaio.c
+++ b/scan/sane/hpaio.c
@@ -379,7 +379,7 @@ extern SANE_Status sane_hpaio_get_devices(const SANE_Device ***deviceList, SANE_
ResetDeviceList(&DeviceList);
DevDiscovery(localOnly);
*deviceList = (const SANE_Device **)DeviceList;
- SANE_Device*** devList;
+ const SANE_Device*** devList;
orblite_get_devices(devList, localOnly);
return SANE_STATUS_GOOD;
diff --git a/scan/sane/orblite.c b/scan/sane/orblite.c
index 2eb7aba..4eaa468 100644
--- a/scan/sane/orblite.c
+++ b/scan/sane/orblite.c
@@ -64,28 +64,28 @@ SANE_Option_Descriptor DefaultOrbOptions[] = {
SANE_NAME_SCAN_TL_X, SANE_TITLE_SCAN_TL_X, SANE_DESC_SCAN_TL_X, // name, title, desc
SANE_TYPE_FIXED, SANE_UNIT_MM, sizeof(SANE_Fixed),// type, unit, size
SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability)
- SANE_CONSTRAINT_RANGE, (SANE_Char**)&SANE_rangeLeft // constraint_type, constraint
+ SANE_CONSTRAINT_RANGE, (const SANE_Char**)&SANE_rangeLeft // constraint_type, constraint
},
{
SANE_NAME_SCAN_TL_Y, SANE_TITLE_SCAN_TL_Y, SANE_DESC_SCAN_TL_Y, // name, title, desc
SANE_TYPE_FIXED, SANE_UNIT_MM, sizeof(SANE_Fixed),// type, unit, size
SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability)
- SANE_CONSTRAINT_RANGE, (SANE_Char**)&SANE_rangeTop // constraint_type, constraint
+ SANE_CONSTRAINT_RANGE, (const SANE_Char**)&SANE_rangeTop // constraint_type, constraint
},
{
SANE_NAME_SCAN_BR_X, SANE_TITLE_SCAN_BR_X, SANE_DESC_SCAN_BR_X, // name, title, desc
SANE_TYPE_FIXED, SANE_UNIT_MM, sizeof(SANE_Fixed),// type, unit, size
SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability)
- SANE_CONSTRAINT_RANGE, (SANE_Char**)&SANE_rangeRight // constraint_type, constraint
+ SANE_CONSTRAINT_RANGE, (const SANE_Char**)&SANE_rangeRight // constraint_type, constraint
},
{
SANE_NAME_SCAN_BR_Y, SANE_TITLE_SCAN_BR_Y, SANE_DESC_SCAN_BR_Y, // name, title, desc
SANE_TYPE_FIXED, SANE_UNIT_MM, sizeof(SANE_Fixed),// type, unit, size
SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability)
- SANE_CONSTRAINT_RANGE, (SANE_Char**)&SANE_rangeBottom // constraint_type, constraint
+ SANE_CONSTRAINT_RANGE, (const SANE_Char**)&SANE_rangeBottom // constraint_type, constraint
},
// optResolution, // resolution group
@@ -93,7 +93,7 @@ SANE_Option_Descriptor DefaultOrbOptions[] = {
SANE_NAME_SCAN_RESOLUTION, SANE_TITLE_SCAN_RESOLUTION, SANE_DESC_SCAN_RESOLUTION, // name, title, desc
SANE_TYPE_INT, SANE_UNIT_DPI, sizeof(SANE_Word), // type, unit, size,
SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability)
- SANE_CONSTRAINT_WORD_LIST, (SANE_Char**)SANE_resolutions // constraint type, constraint
+ SANE_CONSTRAINT_WORD_LIST, (const SANE_Char**)SANE_resolutions // constraint type, constraint
},
// optMode, // color/depth group
@@ -101,7 +101,7 @@ SANE_Option_Descriptor DefaultOrbOptions[] = {
SANE_NAME_SCAN_MODE, SANE_TITLE_SCAN_MODE, SANE_DESC_SCAN_MODE, // name, title, desc
SANE_TYPE_STRING, SANE_UNIT_NONE, 256, // type, unit, size,
SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability)
- SANE_CONSTRAINT_STRING_LIST, (SANE_Char**)SANE_modes // constraint type, constraint
+ SANE_CONSTRAINT_STRING_LIST, (const SANE_Char**)SANE_modes // constraint type, constraint
},
// optSource,
@@ -109,7 +109,7 @@ SANE_Option_Descriptor DefaultOrbOptions[] = {
SANE_NAME_SCAN_SOURCE, SANE_TITLE_SCAN_SOURCE, SANE_DESC_SCAN_SOURCE, // name, title, desc
SANE_TYPE_STRING, SANE_UNIT_NONE, 256, // type, unit, size,
SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability)
- SANE_CONSTRAINT_STRING_LIST, (SANE_Char**)SANE_sources // constraint type, constraint
+ SANE_CONSTRAINT_STRING_LIST, (const SANE_Char**)SANE_sources // constraint type, constraint
},
// optPaperSize,
@@ -117,7 +117,7 @@ SANE_Option_Descriptor DefaultOrbOptions[] = {
SANE_NAME_PAPER_SIZE, SANE_TITLE_PAPER_SIZE, SANE_DESC_PAPER_SIZE, // name, title, desc
SANE_TYPE_STRING, SANE_UNIT_NONE, 256, // type, unit, size,
SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability)
- SANE_CONSTRAINT_STRING_LIST, (SANE_Char**)SANE_paper_sizes // constraint type, constraint
+ SANE_CONSTRAINT_STRING_LIST, (const SANE_Char**)SANE_paper_sizes // constraint type, constraint
},
// optPaperSize,
@@ -125,7 +125,7 @@ SANE_Option_Descriptor DefaultOrbOptions[] = {
SANE_NAME_PAPER_SIZE, SANE_TITLE_PAPER_SIZE, SANE_DESC_PAPER_SIZE, // name, title, desc
SANE_TYPE_INT, SANE_UNIT_DPI, sizeof(SANE_Word), // type, unit, size,
SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability)
- SANE_CONSTRAINT_WORD_LIST, (SANE_Char**)SANE_resolutions // constraint type, constraint
+ SANE_CONSTRAINT_WORD_LIST, (const SANE_Char**)SANE_resolutions // constraint type, constraint
},
#ifdef NOTDEF
// default template
@@ -274,6 +274,7 @@ orblite_open (SANE_String_Const devicename, SANE_Handle * handle)
SANE_Auth_Callback authorize;
const SANE_Device *** device_list;
SANE_Bool local_only;
+ void * temp_handle;
// Allocate handle, set all handle values to zero
@@ -305,7 +306,9 @@ orblite_open (SANE_String_Const devicename, SANE_Handle * handle)
if (stat != SANE_STATUS_GOOD)
return stat;
- stat = g_handle->bb_orblite_open(devicename, &g_handle);
+ temp_handle = g_handle;
+ stat = g_handle->bb_orblite_open(devicename, &temp_handle);
+ g_handle = temp_handle;
if (stat == SANE_STATUS_GOOD)
*handle = g_handle;

View File

@ -0,0 +1,12 @@
Index: hplip-3.20.9/scan/sane/http.c
===================================================================
--- hplip-3.20.9.orig/scan/sane/http.c
+++ hplip-3.20.9/scan/sane/http.c
@@ -33,6 +33,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include <string.h>
#include <syslog.h>
#include <ctype.h>

584
hplip-missing-drivers.patch Normal file
View File

@ -0,0 +1,584 @@
From eab655e0f8ab7c7520e0c60970d74e51b25c2061 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Fri, 15 Sep 2023 18:31:38 +0200
Subject: [PATCH 18/18] hplip: missing drivers
---
cups_drv.inc | 2 +
data/models/models.dat | 477 ++++++++++++++++++++++++++++++++++++++++-
prnt/drv/hpcups.drv.in | 16 ++
3 files changed, 486 insertions(+), 9 deletions(-)
diff --git a/cups_drv.inc b/cups_drv.inc
index 8a33bfe..dc38978 100644
--- a/cups_drv.inc
+++ b/cups_drv.inc
@@ -414,6 +414,7 @@ cups_ppd_printers = \
ppd/hpcups/hp-laserjet_cm1418fnw-pcl3.ppd.gz \
ppd/hpcups/hp-laserjet_cp1025.ppd.gz \
ppd/hpcups/hp-laserjet_cp1025nw.ppd.gz \
+ ppd/hpcups/hp-laserjet_cp_1025nw.ppd.gz \
ppd/hpcups/hp-laserjet_m1005.ppd.gz \
ppd/hpcups/hp-laserjet_m101-m106.ppd.gz \
ppd/hpcups/hp-laserjet_m109-m112.ppd.gz \
@@ -531,6 +532,7 @@ cups_ppd_printers = \
ppd/hpcups/hp-laserjet_professional_p1607dn.ppd.gz \
ppd/hpcups/hp-laserjet_professional_p1608dn.ppd.gz \
ppd/hpcups/hp-laserjet_professional_p1609dn.ppd.gz \
+ ppd/hpcups/hp-laserjet_professional_p1102w.ppd.gz \
ppd/hpcups/hp-laserjet_professional_p_1102w.ppd.gz \
ppd/hpcups/hp-laserjet_tank_1020.ppd.gz \
ppd/hpcups/hp-laserjet_tank_150x.ppd.gz \
diff --git a/data/models/models.dat b/data/models/models.dat
index a567fdd..ed89569 100644
--- a/data/models/models.dat
+++ b/data/models/models.dat
@@ -2104,7 +2104,7 @@ usb-pid=411
usb-vid=3f0
wifi-config=0
-[hp_laserjet_100_colormfp_m175]
+[hp_laserjet_100_colormfp_m175nw]
align-type=0
clean-type=0
color-cal-type=0
@@ -2119,14 +2119,6 @@ io-support=14
job-storage=0
linefeed-cal-type=0
model1=HP LaserJet 100 Color MFP M175
-model2=HP LaserJet 100 Color MFP M175a
-model3=HP LaserJet 100 Color MFP M175b
-model4=HP LaserJet 100 Color MFP M175c
-model5=HP LaserJet 100 Color MFP M175e
-model6=HP LaserJet 100 Color MFP M175nw
-model7=HP LaserJet 100 Color MFP M175p
-model8=HP LaserJet 100 Color MFP M175q
-model9=HP LaserJet 100 Color MFP M175r
ppd-name=hp-laserjet_100_color_mfp_m175-ps.ppd
monitor-type=0
panel-check-type=0
@@ -2218,6 +2210,378 @@ usb-pid=62a
usb-vid=3f0
wifi-config=3
+[hp_laserjet_100_colormfp_m175r]
+align-type=0
+clean-type=0
+color-cal-type=0
+copy-type=0
+embedded-server-type=1
+fax-type=0
+fw-download=False
+icon=hp_color_laserjet_cm1312_mfp.png
+io-mfp-mode=3
+io-mode=1
+io-support=14
+job-storage=0
+linefeed-cal-type=0
+model1=HP LaserJet 100 Color MFP M175
+ppd-name=hp-laserjet_100_color_mfp_m175-ps.ppd
+monitor-type=0
+panel-check-type=0
+pcard-type=0
+plugin=1
+plugin-reason=64
+power-settings=0
+pq-diag-type=0
+r-type=0
+r0-agent1-kind=4
+r0-agent1-sku=CE310A
+r0-agent1-type=1
+r0-agent2-kind=4
+r0-agent2-sku=CE311A
+r0-agent2-type=4
+r0-agent3-kind=4
+r0-agent3-sku=CE313A
+r0-agent3-type=5
+r0-agent4-kind=4
+r0-agent4-sku=CE312A
+r0-agent4-type=6
+scan-src=3
+scan-type=5
+status-battery-check=0
+status-dynamic-counters=0
+status-type=10
+support-released=True
+support-subtype=219b2b
+support-type=2
+support-ver=3.11.7
+tech-class=Postscript
+family-class=Undefined
+tech-subclass=Normal
+tech-type=4
+usb-pid=62a
+usb-vid=3f0
+wifi-config=3
+
+[hp_laserjet_100_colormfp_m175q]
+align-type=0
+clean-type=0
+color-cal-type=0
+copy-type=0
+embedded-server-type=1
+fax-type=0
+fw-download=False
+icon=hp_color_laserjet_cm1312_mfp.png
+io-mfp-mode=3
+io-mode=1
+io-support=14
+job-storage=0
+linefeed-cal-type=0
+model1=HP LaserJet 100 Color MFP M175
+ppd-name=hp-laserjet_100_color_mfp_m175-ps.ppd
+monitor-type=0
+panel-check-type=0
+pcard-type=0
+plugin=1
+plugin-reason=64
+power-settings=0
+pq-diag-type=0
+r-type=0
+r0-agent1-kind=4
+r0-agent1-sku=CE310A
+r0-agent1-type=1
+r0-agent2-kind=4
+r0-agent2-sku=CE311A
+r0-agent2-type=4
+r0-agent3-kind=4
+r0-agent3-sku=CE313A
+r0-agent3-type=5
+r0-agent4-kind=4
+r0-agent4-sku=CE312A
+r0-agent4-type=6
+scan-src=3
+scan-type=5
+status-battery-check=0
+status-dynamic-counters=0
+status-type=10
+support-released=True
+support-subtype=219b2b
+support-type=2
+support-ver=3.11.7
+tech-class=Postscript
+family-class=Undefined
+tech-subclass=Normal
+tech-type=4
+usb-pid=62a
+usb-vid=3f0
+wifi-config=3
+
+[hp_laserjet_100_colormfp_m175p]
+align-type=0
+clean-type=0
+color-cal-type=0
+copy-type=0
+embedded-server-type=1
+fax-type=0
+fw-download=False
+icon=hp_color_laserjet_cm1312_mfp.png
+io-mfp-mode=3
+io-mode=1
+io-support=14
+job-storage=0
+linefeed-cal-type=0
+model1=HP LaserJet 100 Color MFP M175
+ppd-name=hp-laserjet_100_color_mfp_m175-ps.ppd
+monitor-type=0
+panel-check-type=0
+pcard-type=0
+plugin=1
+plugin-reason=64
+power-settings=0
+pq-diag-type=0
+r-type=0
+r0-agent1-kind=4
+r0-agent1-sku=CE310A
+r0-agent1-type=1
+r0-agent2-kind=4
+r0-agent2-sku=CE311A
+r0-agent2-type=4
+r0-agent3-kind=4
+r0-agent3-sku=CE313A
+r0-agent3-type=5
+r0-agent4-kind=4
+r0-agent4-sku=CE312A
+r0-agent4-type=6
+scan-src=3
+scan-type=5
+status-battery-check=0
+status-dynamic-counters=0
+status-type=10
+support-released=True
+support-subtype=219b2b
+support-type=2
+support-ver=3.11.7
+tech-class=Postscript
+family-class=Undefined
+tech-subclass=Normal
+tech-type=4
+usb-pid=62a
+usb-vid=3f0
+wifi-config=3
+
+[hp_laserjet_100_colormfp_m175e]
+align-type=0
+clean-type=0
+color-cal-type=0
+copy-type=0
+embedded-server-type=1
+fax-type=0
+fw-download=False
+icon=hp_color_laserjet_cm1312_mfp.png
+io-mfp-mode=3
+io-mode=1
+io-support=2
+job-storage=0
+linefeed-cal-type=0
+model1=HP LaserJet 100 Color MFP M175
+ppd-name=hp-laserjet_100_color_mfp_m175-ps.ppd
+monitor-type=0
+panel-check-type=0
+pcard-type=0
+plugin=1
+plugin-reason=64
+power-settings=0
+pq-diag-type=0
+r-type=0
+r0-agent1-kind=4
+r0-agent1-sku=CE310A
+r0-agent1-type=1
+r0-agent2-kind=4
+r0-agent2-sku=CE311A
+r0-agent2-type=4
+r0-agent3-kind=4
+r0-agent3-sku=CE313A
+r0-agent3-type=5
+r0-agent4-kind=4
+r0-agent4-sku=CE312A
+r0-agent4-type=6
+scan-src=3
+scan-type=5
+status-battery-check=0
+status-dynamic-counters=0
+status-type=10
+support-released=True
+support-subtype=219b2b
+support-type=2
+support-ver=3.11.7
+tech-class=Postscript
+family-class=Undefined
+tech-subclass=Normal
+tech-type=4
+usb-pid=62a
+usb-vid=3f0
+wifi-config=-1
+
+[hp_laserjet_100_colormfp_m175a]
+align-type=0
+clean-type=0
+color-cal-type=0
+copy-type=0
+embedded-server-type=1
+ppd-name=hp-laserjet_100_color_mfp_m175-ps.ppd
+family-ppd=hp-postscript-laserjet-pro.ppd
+fax-type=0
+fw-download=False
+icon=hp_color_laserjet_cm1312_mfp.png
+io-mfp-mode=3
+io-mode=1
+io-support=2
+job-storage=0
+linefeed-cal-type=0
+model1=HP LaserJet 100 Color MFP M175
+monitor-type=0
+panel-check-type=0
+pcard-type=0
+plugin=1
+plugin-reason=64
+power-settings=0
+pq-diag-type=0
+r-type=0
+r0-agent1-kind=4
+r0-agent1-sku=CE310A
+r0-agent1-type=1
+r0-agent2-kind=4
+r0-agent2-sku=CE311A
+r0-agent2-type=4
+r0-agent3-kind=4
+r0-agent3-sku=CE313A
+r0-agent3-type=5
+r0-agent4-kind=4
+r0-agent4-sku=CE312A
+r0-agent4-type=6
+scan-src=3
+scan-type=5
+status-battery-check=0
+status-dynamic-counters=0
+status-type=10
+support-released=True
+support-subtype=219b2b
+support-type=2
+support-ver=3.11.7
+tech-class=Postscript
+family-class=Undefined
+tech-subclass=Normal
+tech-type=4
+usb-pid=62a
+usb-vid=3f0
+wifi-config=-1
+
+[hp_laserjet_100_colormfp_m175c]
+align-type=0
+clean-type=0
+color-cal-type=0
+copy-type=0
+embedded-server-type=1
+fax-type=0
+fw-download=False
+icon=hp_color_laserjet_cm1312_mfp.png
+io-mfp-mode=3
+io-mode=1
+io-support=2
+job-storage=0
+linefeed-cal-type=0
+model1=HP LaserJet 100 Color MFP M175
+ppd-name=hp-laserjet_100_color_mfp_m175-ps.ppd
+monitor-type=0
+panel-check-type=0
+pcard-type=0
+plugin=1
+plugin-reason=64
+power-settings=0
+pq-diag-type=0
+r-type=0
+r0-agent1-kind=4
+r0-agent1-sku=CE310A
+r0-agent1-type=1
+r0-agent2-kind=4
+r0-agent2-sku=CE311A
+r0-agent2-type=4
+r0-agent3-kind=4
+r0-agent3-sku=CE313A
+r0-agent3-type=5
+r0-agent4-kind=4
+r0-agent4-sku=CE312A
+r0-agent4-type=6
+scan-src=3
+scan-type=5
+status-battery-check=0
+status-dynamic-counters=0
+status-type=10
+support-released=True
+support-subtype=219b2b
+support-type=2
+support-ver=3.11.7
+tech-class=Postscript
+family-class=Undefined
+tech-subclass=Normal
+tech-type=4
+usb-pid=62a
+usb-vid=3f0
+wifi-config=-1
+
+[hp_laserjet_100_colormfp_m175b]
+align-type=0
+clean-type=0
+color-cal-type=0
+copy-type=0
+embedded-server-type=1
+fax-type=0
+fw-download=False
+icon=hp_color_laserjet_cm1312_mfp.png
+io-mfp-mode=3
+io-mode=1
+io-support=2
+job-storage=0
+linefeed-cal-type=0
+model1=HP LaserJet 100 Color MFP M175
+ppd-name=hp-laserjet_100_color_mfp_m175-ps.ppd
+monitor-type=0
+panel-check-type=0
+pcard-type=0
+plugin=1
+plugin-reason=64
+power-settings=0
+pq-diag-type=0
+r-type=0
+r0-agent1-kind=4
+r0-agent1-sku=CE310A
+r0-agent1-type=1
+r0-agent2-kind=4
+r0-agent2-sku=CE311A
+r0-agent2-type=4
+r0-agent3-kind=4
+r0-agent3-sku=CE313A
+r0-agent3-type=5
+r0-agent4-kind=4
+r0-agent4-sku=CE312A
+r0-agent4-type=6
+scan-src=3
+scan-type=5
+status-battery-check=0
+status-dynamic-counters=0
+status-type=10
+support-released=True
+support-subtype=219b2b
+support-type=2
+support-ver=3.11.7
+tech-class=Postscript
+family-class=Undefined
+tech-subclass=Normal
+tech-type=4
+usb-pid=62a
+usb-vid=3f0
+wifi-config=-1
+
[officejet_100_mobile_l411]
align-type=-1
clean-type=1
@@ -17920,6 +18284,58 @@ usb-pid=2c17
usb-vid=3f0
wifi-config=0
+[hp_laserjet_cp_1025nw]
+align-type=0
+clean-type=0
+color-cal-type=0
+copy-type=0
+embedded-server-type=1
+fax-type=0
+fw-download=False
+icon=hp_color_laserjet_cp2025.png
+io-mfp-mode=1
+io-mode=1
+io-support=14
+job-storage=0
+linefeed-cal-type=0
+model1=HP LaserJet Pro CP 1025nw Color Printer Series
+monitor-type=0
+panel-check-type=0
+pcard-type=0
+plugin=1
+plugin-reason=1
+power-settings=0
+pq-diag-type=0
+r-type=0
+r0-agent1-kind=4
+r0-agent1-sku=CE310A
+r0-agent1-type=1
+r0-agent2-kind=4
+r0-agent2-sku=CE311A
+r0-agent2-type=4
+r0-agent3-kind=4
+r0-agent3-sku=CE313A
+r0-agent3-type=5
+r0-agent4-kind=4
+r0-agent4-sku=CE312A
+r0-agent4-type=6
+scan-src=0
+scan-type=0
+status-battery-check=0
+status-dynamic-counters=0
+status-type=8
+support-released=True
+support-subtype=219b2b
+support-type=2
+support-ver=3.12.4
+tech-class=LJZjsColor
+family-class=LJ-Class4
+tech-subclass=Advanced
+tech-type=4
+usb-pid=112a
+usb-vid=3f0
+wifi-config=3
+
[hp_laserjet_cp1025nw]
align-type=0
clean-type=0
@@ -18521,6 +18937,49 @@ usb-pid=3011
usb-vid=3f0
wifi-config=0
+[hp_laserjet_professional_p1102w]
+align-type=0
+clean-type=0
+color-cal-type=0
+copy-type=0
+embedded-server-type=0
+fax-type=0
+fw-download=False
+icon=HP_LaserJet_1012.png
+io-mfp-mode=6
+io-mode=1
+io-support=10
+job-storage=0
+linefeed-cal-type=0
+model1=HP LaserJet Professional P1102w Printer
+monitor-type=0
+panel-check-type=0
+pcard-type=0
+plugin=1
+plugin-reason=1
+power-settings=0
+pq-diag-type=0
+r-type=0
+r0-agent1-kind=4
+r0-agent1-sku=85A
+r0-agent1-type=1
+scan-src=0
+scan-type=0
+status-battery-check=0
+status-dynamic-counters=0
+status-type=8
+support-released=True
+support-subtype=219b2b
+support-type=2
+support-ver=3.10.4
+tech-class=LJZjsMono
+family-class=LJ-Class4
+tech-subclass=NoAutoDuplex
+tech-type=3
+usb-pid=32a
+usb-vid=3f0
+wifi-config=3
+
[hp_laserjet_professional_p1102]
align-type=0
clean-type=0
diff --git a/prnt/drv/hpcups.drv.in b/prnt/drv/hpcups.drv.in
index 2829168..3c1377a 100644
--- a/prnt/drv/hpcups.drv.in
+++ b/prnt/drv/hpcups.drv.in
@@ -23107,6 +23107,14 @@ Group "RLT/HP Real Life Technologies"
Attribute "Product" "" "(HP LaserJet Professional p1102 Printer)"
Attribute "Product" "" "(HP LaserJet Professional p1102s Printer)"
}
+ {
+ ModelName "HP LaserJet Professional p1102w"
+ Attribute "NickName" "" "HP LaserJet Professional p1102w, hpcups $Version, requires proprietary plugin"
+ Attribute "ShortNickName" "" "HP LaserJet Professional p1102w hpijs"
+ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:hp laserjet professional p1102w;DES:hp laserjet professional p1102w;"
+ PCFileName "hp-laserjet_professional_p1102w.ppd"
+ Attribute "Product" "" "(HP LaserJet Professional p1102w Printer)"
+ }
{
ModelName "HP LaserJet Professional p1106"
Attribute "NickName" "" "HP LaserJet Professional p1106, hpcups $Version"
@@ -23541,6 +23549,14 @@ Group "RLT/HP Real Life Technologies"
PCFileName "hp-laserjet_cp1025nw.ppd"
Attribute "Product" "" "(HP LaserJet Pro cp1025nw Color Printer Series)"
}
+ {
+ ModelName "HP LaserJet Cp 1025nw"
+ Attribute "NickName" "" "HP LaserJet Cp 1025nw, hpcups $Version, requires proprietary plugin"
+ Attribute "ShortNickName" "" "HP LaserJet Cp 1025nw hpijs"
+ Attribute "1284DeviceID" "" "MFG:Hewlett-Packard;MDL:hp laserjet cp 1025nw;DES:hp laserjet cp 1025nw;"
+ PCFileName "hp-laserjet_cp_1025nw.ppd"
+ Attribute "Product" "" "(HP LaserJet Pro Cp 1025nw Color Printer Series)"
+ }
}
} // End LJZjsColor (for proprietary plugin)
--
2.43.0

View File

@ -0,0 +1,11 @@
diff -ur hplip-3.19.3-orig/scan/sane/orblite.c hplip-3.19.3/scan/sane/orblite.c
--- hplip-3.19.3-orig/scan/sane/orblite.c 2019-03-14 10:28:56.000000000 +0100
+++ hplip-3.19.3/scan/sane/orblite.c 2019-04-12 18:59:07.734202665 +0200
@@ -331,6 +331,7 @@
return &g_handle->Options[option];
}
//return g_handle->bb_orblite_get_option_descriptor(g_handle, option);
+ return NULL;
}

17
hplip-pserror-c99.patch Normal file
View File

@ -0,0 +1,17 @@
prnt/pserror.c: Replace an implicit int with an explicit int
Submitted upstream: <https://bugs.launchpad.net/hplip/+bug/1997875>
diff --git a/prnt/hpps/pserror.c b/prnt/hpps/pserror.c
index 114d7e1b5fa364fb..493b49c27917a7e6 100644
--- a/prnt/hpps/pserror.c
+++ b/prnt/hpps/pserror.c
@@ -24,7 +24,7 @@ extern char *program ; /* Defined by main program, giving program name */
void message(int flags, char *format, ...)
{
va_list args ;
- static column = 0 ; /* current screen column for message wrap */
+ static int column = 0 ; /* current screen column for message wrap */
char msgbuf[MAX_MESSAGE] ; /* buffer in which to put the message */
char *bufptr = msgbuf ; /* message buffer pointer */

View File

@ -0,0 +1,38 @@
diff -ur hplip-3.21.4.orig/Makefile.am hplip-3.21.4/Makefile.am
--- hplip-3.21.4.orig/Makefile.am 2021-05-06 10:39:14.000000000 +0200
+++ hplip-3.21.4/Makefile.am 2021-06-16 09:19:42.354489830 +0200
@@ -167,7 +167,7 @@
dist_hplip_SCRIPTS = hpssd.py __init__.py hpdio.py
endif #HPLIP_CLASS_DRIVER
-dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template prnt/hpcups/libImageProcessor-x86_64.so prnt/hpcups/libImageProcessor-x86_32.so
+dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template
dist_noinst_DATA += prnt/ipp-usb/HPLIP.conf
dist_noinst_SCRIPTS += dat2drv.py install.py hplip-install init-suse-firewall init-iptables-firewall class_rpm_build.sh hplipclassdriver.spec createPPD.sh Makefile_dat2drv hpijs-drv
@@ -595,7 +595,7 @@
prnt/hpcups/ImageProcessor.h
hpcups_CXXFLAGS = $(APDK_ENDIAN_FLAG) $(DBUS_CFLAGS)
-hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lImageProcessor -lcups -lcupsimage -lz $(DBUS_LIBS)
+hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lcups -lcupsimage -lz $(DBUS_LIBS)
#else
#hpcupsdir = $(cupsfilterdir)
#hpcups_PROGRAMS = hpcups
@@ -685,16 +685,6 @@
install-data-hook:
if HPLIP_BUILD
- if [ \( "$(UNAME)" = "x86_64" -a -d "$(libdir)/" \) ]; then \
- cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \
- chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \
- ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \
- fi; \
- if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \
- cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \
- chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \
- ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \
- fi
if [ -d "/usr/share/ipp-usb/quirks/" ]; then \
echo "ipp-usb directory exists"; \
cp prnt/ipp-usb/HPLIP.conf /usr/share/ipp-usb/quirks/ ; \

9
hplip-rpmlintrc Normal file
View File

@ -0,0 +1,9 @@
from Config import *
addFilter("arch-dependent-file-in-usr-share")
# Ignore any duplicate files
addFilter("files-duplicate .*/hplip/.*/__init__.py")
addFilter("files-duplicate .*/hplip/*/__init__.*pyc")
addFilter("files-duplicate .*/hplip/.*/__pycache__/__init__.*.pyc")
#
addFilter("non-executable-script /usr/share/hplip/.*")

View File

@ -0,0 +1,19 @@
scam/sane/hpaio.c: Include orblite.h for more function prototypes
Otherwise the build fails with compilers which do not support
implicit function declarations.
Submitted upstream: <https://bugs.launchpad.net/hplip/+bug/1997875>
diff --git a/scan/sane/hpaio.c b/scan/sane/hpaio.c
index d342626822fc2190..57d1ddea32fb5816 100644
--- a/scan/sane/hpaio.c
+++ b/scan/sane/hpaio.c
@@ -50,6 +50,7 @@
#include "sclpml.h"
#include "escl.h"
#include "io.h"
+#include "orblite.h"
#include "orblitei.h"

View File

@ -0,0 +1,48 @@
scan/sane/orblite: Include <dflcn.h> for function prototypes
This is required for C99 compatibility. Also delete the unused
bb_unload function because it calls a call to the undefined
_DBG function/macro.
Submitted upstream: <https://bugs.launchpad.net/hplip/+bug/1997875>
diff --git a/scan/sane/orblite.c b/scan/sane/orblite.c
index ba86640c7528fc9c..ac59dda9c2dba593 100644
--- a/scan/sane/orblite.c
+++ b/scan/sane/orblite.c
@@ -20,6 +20,7 @@
#include "orblitei.h"
#include "orblite.h"//Added New
#include <math.h>
+#include <dlfcn.h>
#include "utils.h"
#include "io.h"
@@ -193,27 +194,6 @@ bugout:
}
-static int bb_unload(SANE_THandle ps)
-{
- _DBG("Calling orblite bb_unload: \n");
- if (ps->bb_handle)
- {
- dlclose(ps->bb_handle);
- ps->bb_handle = NULL;
- }
- if (ps->hpmud_handle)
- {
- dlclose(ps->hpmud_handle);
- ps->hpmud_handle = NULL;
- }
-// if (ps->math_handle)
-// {
-// dlclose(ps->math_handle);
-// ps->math_handle = NULL;
-// }
- return 0;
-}
-
SANE_Status
orblite_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
{

View File

@ -0,0 +1,20 @@
Kludge to support building C99 mode. This should no longer be needed
once glibc declares strcasestr by default, and not just with
-D_GNU_SOURCE.
Submitted upstream: <https://bugs.launchpad.net/hplip/+bug/1997875>
diff --git a/scan/sane/sclpml.c b/scan/sane/sclpml.c
index dc8b32ce02ad1202..f2cacd53e86800ce 100644
--- a/scan/sane/sclpml.c
+++ b/scan/sane/sclpml.c
@@ -47,6 +47,9 @@
#define DEBUG_DECLARE_ONLY
#include "sanei_debug.h"
+/* This file is not built with _GNU_SOURCE. */
+char *strcasestr(const char *, const char *);
+
//# define SCLPML_DEBUG
# ifdef SCLPML_DEBUG
# define _DBG(args...) syslog(LOG_INFO, __FILE__ " " STRINGIZE(__LINE__) ": " args)

View File

@ -0,0 +1,13 @@
Index: hplip-3.20.9/Makefile.am
===================================================================
--- hplip-3.20.9.orig/Makefile.am
+++ hplip-3.20.9/Makefile.am
@@ -137,7 +137,7 @@ dist_rulessystem_DATA =data/rules/hplip-
# hpmud.rules
if !HPLIP_CLASS_DRIVER
-rulesdir = /etc/udev/rules.d
+rulesdir = /usr/lib/udev/rules.d
if UDEV_SYSFS_RULES
dist_rules_DATA = data/rules/56-hpmud_sysfs.rules
else

3726
hplip.changes Normal file

File diff suppressed because it is too large Load Diff

39
hplip.keyring Normal file
View File

@ -0,0 +1,39 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.18 (GNU/Linux)
mQGiBEsnpscRBACyclffkMVkXXdtY2qTT2+B6HN4hBoUxBwZBULyHFuSP9lsB7wK
16Hl5ZTu+oy+GegzzFRrHWxBLN9i67T0plNkqDJhWUrmXR7xvX+dFc+Qrl+uPR0i
CY1NMnWwnFh01YtYb9NAlb3bLn8RLBH8Zo60i7wfwdW9Wi1mgzmUT/UI9wCg7y6R
VmF4RjNWJ2WRdL/jVeAB8H0D/0xfePoYWrSGzOp7+Vl+xYo5TdSrzohUUnly6xla
UIKwlBCG/jpQqKH17803GpkFyh5FxG1Db7VWsciDv7flcBLPtn75gU2fPHXL+gnv
r1eJ+ugQwCl4/8d4iJ5TMXmHQOW2Pd0U47OmbZYNNgtA+lXhF8n8+6w3GRhqubLF
/9b/A/4wH37bv1shLhdLpP+9WYHc8z9+jmStVUFdAGoD/n6vOpBX+GQYaEY5Y8RS
Wf0DFhMF6CFYNZ2ngDyvPt53M2jU7hrxXIfs/b5bLMqG2et9M/avdEWGUKTsC7wu
0zeGtD07r9EA3WDIhxN9QEGZAq5Q3NSbedMHIVE4Ynq7VNCdsrQ0SFBMSVAgKEhQ
IExpbnV4IEltYWdpbmcgYW5kIFByaW50aW5nKSA8aHBsaXBAaHAuY29tPohgBBMR
AgAgBQJLJ6bHAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQc9dwzaWQR7n4
dQCghZgIpxuTC+GhiQIO0dK9wTlbMmoAoOB252fEOvf73v8Ya8qmN1GlmYiXiJwE
EAECAAYFAk7UORAACgkQnsV5kCcUcIjUuAP8D2rK0KZyA0uHyap2BkF5U4wm6qQ3
p27K0hh50dZMIMSt3FH0TpW994jaoqBKqrHBk3U+/ZT4tD43hmaqc+XmnYNrNMRO
KBwkjEzKeKaOBXd1I5Tid0I2u1L6bl5IlQzujbWsn/5YbWypLlZhf3Hxg8uuHYu9
kiQLYM4jqIi0YgSJARwEEAECAAYFAk3NP24ACgkQd7E6jROY7coc8Af8DYe87G2u
OSSPGkebecci11oTX9mudvDCQkuTFBcGPlMnPl6bn5QcMjBxuAm2TO0mYlR0QcPU
vQ+tNypw4AZGfsgnvG1EsxSfTgiR6tD2KdIZD8GJw/GudmtUgF3sZkw1txLkk57u
YufHc9u56oMvntAaU7nisosE1rdqON9fLf+tqvMcrX2+8tDHobfimltC+J+F5dyx
Cnef+zB9/+dzAAjiunicNZ35zv9tKBh83kECPUpScpHjrXxAqdSHrNlnjGZdmiFB
0luSbPCIF8sYyLYb5W+Sw1t7WsZ1XRgq67gTV8Vw2o9jw10a/vclwFHeVEtius6g
Cj0CwkJ1uRuiLrkCDQRLJ6bHEAgAhDv8Ifl/QKaJONb5/qm8uWC70rlzXLm9YlUp
bAcr/tvCkG271wzT4Sz/cHTvQ5s3yBsGq49Li7Z9IfVFk5xKV0mdGyiZwmHOxmaV
L3DcoyLkrOvYStqy3d/DEm9YaAWiAi42REVIXvmRsJce87wCIIY/rLNbncKXOj3H
TzWopqfnJPf/nkqYqwWbFkQxMmGfK9E84dLwjGRtwCWb5uN/YLM3uSJrwLfsRZbm
EQhzAJF2mIplwIqR3R7naruQdfyjad5EXOvKQ8P5MxUieGxHUlv90LuYCcW+MvVw
0zIqchbdWGaz+LGCTRDAIyJZZzB6kLCuHn3TWPyUpPdsBI5jfwAECwf+Nl+UUqw0
HPZP9kXYG0VED1wFxWEckgzLeF32kDQGIlNp0NbYcSbi8xS56fFbpszA+LZrJgTZ
mnFRUwDCclma7punj3b8nM0gRtHvuLentmAhnQPIX8SWDRwhBNIujSOxQrtjjw6o
FyrMlYqpe73IUAAINzeCCwZXKDvOiTgm7oI/mI6fJiNrc8NqNxhGS4Bzw/rexAhZ
ngekMqR9Nglxk7EzUOqrffc6/Orq1fE2t/UNAOqVVfNX5F2hiINXi1+ywhOYOJVf
Q/xuil2FmI7txAc/7XmUcqxNwayjOzBKlVHIAcIyLMATw3yRVvh+gezGvUbE9Hny
YHq7nO9dmenM7YhJBBgRAgAJBQJLJ6bHAhsMAAoJEHPXcM2lkEe5pLMAnA/kDShH
CzfV5loZcyX8M41tzSYDAJ4jUTgQV69+3QpJmsE3GoCksIYlMQ==
=lgaV
-----END PGP PUBLIC KEY BLOCK-----

752
hplip.spec Normal file
View File

@ -0,0 +1,752 @@
#
# spec file for package hplip
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# python-rpm-macros doesn't work for hplip!
# We just build for py3 since SLE15
%define pyversion 3
%define pymod() python3-%{**}
%define pyver %{py3_ver}
%define pyexe %{_bindir}/python3
%global use_qt5 1
Name: hplip
Version: 3.24.4
Release: 0
Summary: HP's Printing, Scanning, and Faxing Software
License: BSD-3-Clause AND GPL-2.0-or-later AND MIT
Group: Hardware/Printing
URL: https://developers.hp.com/hp-linux-imaging-and-printing
# Source0...Source9 is for sources from HP:
# URL for Source0: http://prdownloads.sourceforge.net/hplip/hplip-3.15.9.tar.gz
# URL to verify Source0: http://prdownloads.sourceforge.net/hplip/hplip-3.15.9.tar.gz.asc
# How to verify Source0 see: http://hplipopensource.com/node/327
# For example: /usr/bin/gpg --keyserver pgp.mit.edu --recv-keys 0xA59047B9
# /usr/bin/gpg --verify hplip-3.15.9.tar.gz.asc hplip-3.15.9.tar.gz
# must result: Good signature from "HPLIP (HP Linux Imaging and Printing) <hplip@hp.com>"
Source0: https://sourceforge.net/projects/hplip/files/hplip/%{version}/hplip-%{version}.tar.gz
Source1: https://sourceforge.net/projects/hplip/files/hplip/%{version}/hplip-%{version}.tar.gz.asc
Source2: hplip.keyring
# Patch0...Patch9 is for patches from HP:
# Patch10...Patch99 is for Suse patches for the sources from HP:
# Source100... is for special SUSE sources:
# Source102 is a small man page for /usr/bin/hpijs:
Source102: hpijs.1.gz
# Actual drivers for hplip-missing-drivers.patch
Source103: hp-laserjet_cp_1025nw.ppd.gz
Source104: hp-laserjet_professional_p_1102w.ppd.gz
#
Source1000: %{name}-rpmlintrc
# Patch100... is for special Suse patches:
# Patch101 change-udev-rules.diff changes the udev rules file 56-hpmud.rules
Patch101: change-udev-rules.diff
# Patch106 disable_hp-upgrade.patch disables hp-upgrade/upgrade.py for security reasons,
# see https://bugzilla.novell.com/show_bug.cgi?id=853405
# To upgrade HPLIP an openSUSE software package manager like YaST or zypper should be used.
Patch106: disable_hp-upgrade.patch
# PATCH-FIX-SUSE: use proper udev rulesdir which is in usr not in /etc
Patch107: hplip-udev-rules-in-usr.patch
# Patch108 add_missing_includes_and_define_GNU_SOURCE.patch adds missing '#include <...>'
# and missing '#define _GNU_SOURCE' see https://bugs.launchpad.net/hplip/+bug/1456590
Patch108: add_missing_includes_and_define_GNU_SOURCE.patch
Patch110: hpijs-avoid-segfault-in-DJGenericVIP-DJGenericVIP.patch
Patch112: ui5-systemtray-wait-only-10s-for-system-tray.patch
# Python3 port: cleanup patches
Patch300: pcardext-python3-fixes.patch
Patch301: hplip-misc-missing-includes-and-definitions.patch
Patch302: hp_ipp.h-add-missing-prototypes.patch
# bsc#1159240, lp#1859179
Patch304: hp-sendfax-avoid-crash-if-python-reportlab-is-missin.patch
# bsc#1166623, hp-toolbox crashes without python3-distro module
Patch305: Use-lsb_release-fallback-code-if-import-distro-fails.patch
# bsc#1180724
Patch306: dcheck.py-fix-crash-in-Qt4-version-check.patch
# PATCH-FIX-SUSE: Remove references to the closed-source ImageProcessor
Patch400: hplip-remove-imageprocessor.diff
# Let a function return NULL instead of nothing
Patch401: hplip-orblite-return-null.diff
# Use a pgp server (pool.sks-keyservers.net) which doesn't throw proxy errors
# or run into timeouts most of the time
Patch402: hplip-change-pgp-server.patch
# boo#1107711
Patch403: Revert-changes-from-3.18.5-that-break-hp-setup-for-f.patch
# PATCH-FIX-UPSTREAM: https://bugs.launchpad.net/hplip/+bug/1879445
Patch404: hplip-3.20.6-python-includes.patch
Patch500: hplip-missing-drivers.patch
# PATCH-FIX-UPSTREAM boo#1225777
Patch601: hplip-pserror-c99.patch
Patch602: hplip-scan-hpaio-include.patch
Patch603: hplip-scan-orblite-c99.patch
Patch604: hplip-sclpml-strcasestr.patch
Patch605: hplip-hpaio-gcc14.patch
BuildRequires: %{pymod devel}
BuildRequires: %{pymod qt5-devel}
BuildRequires: %{pymod xml}
BuildRequires: cups > 1.5
BuildRequires: cups-devel > 1.5
BuildRequires: dbus-1-devel
BuildRequires: fdupes
BuildRequires: hicolor-icon-theme
BuildRequires: libavahi-devel
BuildRequires: libdrm-devel
BuildRequires: libgphoto2-devel
BuildRequires: libjpeg-devel
BuildRequires: libtool
BuildRequires: libusb-1_0-devel
BuildRequires: net-snmp-devel
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: readline-devel
BuildRequires: sane-backends-devel
BuildRequires: systemd-rpm-macros
BuildRequires: update-desktop-files
#!BuildIgnore: clang8
#!BuildIgnore: libclang8
# Break this dependency chain that has caused build breakage
# python3-qt5-devel -> libqt5-qttools-devel -> libqt5-qttools-doc -> clang8
#!BuildIgnore: libqt5-qttools-devel
#!BuildIgnore: libqt5-qtwebengine
# Break this dependency chain that has caused build breakage
# python3-qt5-devel -> libqt5-qtwebengine-devel -> libavcodec58 -> libdav1d.so.1
#!BuildIgnore: libqt5-qtwebengine-devel
# Require the exact matching version-release of the hpijs sub-package to make sure
# to have the exact matching version of libhpip and libhpmud installed.
# The exact matching version-release of the sub-package is available on the same
# repository where the main-package is (compare the "Recommends: hplip" entry below).
Requires: %{name}-hpijs = %{version}-%{release}
# Require the exact matching version-release of the sane sub-package to make sure
# to have the exact matching version of libsane-hpaio installed:
Requires: %{name}-sane = %{version}-%{release}
Requires: %{pymod dbus-python} >= 0.80
Requires: %{pymod gobject}
Requires: %{pymod qt5}
Requires: cups > 1.5
# foomatic-filters and cups-filters-foomatic-rip
# do not require Ghostscript because depending on the PPD
# (e.g. some PPDs for PostScript printers in OpenPrintingPPDs-postscript)
# foomatic-rip can also be used without Ghostscript but for the drivers
# HPIJS and HPCUPS Ghostscript is needed.
# The RPM requirement for ghostscript should actually be in the
# hplip-hpijs sub-package but this would bloat a minimalist system
# (see the comment for the hplip-hpijs sub-package below).
# Therefore the hplip main package which is intended
# to get "all the HPLIP stuff" installed has the RPM requirement:
# Because foomatic-rip-hplip has CVE-2011-2697 (bnc#698451)
# plus a leftover in CVE-2004-0801 (bnc#59233)
# foomatic-rip-hplip is no longer installed and foomatic-rip
# from foomatic-filters or cups-filters-foomatic-rip is used instead.
# The RPM requirement for foomatic-filters should actually be
# in the hplip-hpijs sub-package but this would bloat a minimalist system
# (see the comment for the hplip-hpijs sub-package below).
# Therefore the hplip main package which is intended
# to get "all the HPLIP stuff" installed has the RPM requirement:
Requires: foomatic-filters
Requires: ghostscript
# hp-plugin requries lsb_release
Requires: lsb-release
Requires(post): %{_bindir}/find
Requires(post): /bin/grep
Requires(post): /bin/sed
Requires(post): coreutils
Recommends: python3-reportlab
# Obsolete earlier package names
Obsoletes: hplip17
Provides: hplip3 = 3.9.5
Obsoletes: hplip3 < 3.9.5
# cups-rpm-helper is now pulled in indirectly via cups-devel.
# This causes the "postscriptdriver" provides to be generated.
# To avoid that, put "Ignore: cups-devel: cups-rpm-helper in the prjconf.
%description
The Hewlett-Packard Linux Imaging and Printing project (HPLIP) provides
a unified single and multifunction connectivity solution for HP
printers, scanners, and all-in-one devices.
This package contains command line and UI front-ends for HPLIP, and tools
for extra functionality such as status and supply information. It is
not required for basic printing and scanning with HP hardware, except
for those devices that need the proprietary hplip plugin, see
https://developers.hp.com/hp-linux-imaging-and-printing/binary_plugin.html
%package hpijs
Summary: Printer drivers for HP printers and all-in-one devices
# On a minimalist system only hplip-hpijs may be installed
# or on a minimalist package repository (e.g. on the openSUSE CDs)
# only hplip-hpijs may be available (even when a usual system is installed).
# When only hplip-hpijs is there, it should tell the dependency resolver
# that for usual functionality, hplip should be installed too (if possible).
# Unfortunately the installer ignores suggested packages silently
# but on the other hand I cannot use "Recommends hplip" here
# because the installer installs recommended packages silently
# which would bloat a minimal selection (when hplip is available to be installed)
# because the minimal selection contains hplip-hpijs which recommends hplip
# so that the installer installs hplip and all what this requires silently
# see https://bugzilla.novell.com/show_bug.cgi?id=546893
# Require only the matching version of the hplip main-package
# (compare the "Requires: hplip-hpijs" entry above) but do not depend
# on the exact matching release because the exact matching release
# may be not available to be installed (e.g. when hplip-hpijs-1.2.3-4.5 is
# installed from the openSUSE CDs but on our official online repository
# only hplip-1.2.3-6.7 is available which should usually also work):
Group: Hardware/Printing
Requires: %{name}-udev-rules = %{version}-%{release}
Suggests: %{name} = %{version}
# Since Nov 14 2007 ghostscript-library does no longer require /usr/bin/hpijs
# but only "Suggests hplip-hpijs" (see Novell/Suse Bugzilla bnc#341564).
# Have the matching "reverse suggests" = "Enhances" here
# to document the ghostscript <-> hplip-hpijs relationship:
Enhances: ghostscript
# hpijs-standalone was a stand-alone minimalist package
# which is no longer provided since a long time.
# hplip-hpijs and hpijs-standalone both contain /usr/bin/hpijs
# so that both packages have a RPM conflict which should
# be solved by a silent replacement of the old hpijs-standalone.
# This Obsoletes is intentionally unversioned because
# hplip-hpijs should replace any version of hpijs-standalone.
Obsoletes: hpijs-standalone
# Either the hplip17 packages or the hplip packages can be installed,
# see https://bugzilla.novell.com/show_bug.cgi?id=251830#c20
# for the full story why there is this unversioned Obsoletes:
Obsoletes: hplip17-hpijs
# Obsolete the hplip3 copy that was introduced for older SLED11-GA HP preloads:
Provides: hplip3-hpijs = 3.9.5
Obsoletes: hplip3-hpijs < 3.9.5
# PackMan provides HPLIP in the packages hplip and hplip-hpcups.
# HPLIP does not work if the openSUSE packages hplip and hplip-hpijs
# are installed together with a leftover PackMan package hplip-hpcups
# see https://bugzilla.novell.com/show_bug.cgi?id=515005#c17
# This Obsoletes is intentionally unversioned because
# the openSUSE package hplip-hpijs must replace
# any version of PackMan's hplip-hpcups package.
Obsoletes: hplip-hpcups
%description hpijs
This package contains the backend drivers and PPDs for printing
with HP printers using CUPS.
HPCUPS is HPLIP's native CUPS printer driver for HP printers.
HPIJS (deprecated) is HPLIP's Ghostscript printer driver for
HP printers, and only used for some Fax devices nowadays.
Install the "hplip" package if you need the proprietary HP plugin
required by some devices, or additional functionality besides plain
printing.
%package sane
Summary: SANE backends for HP scanners and all-in-one devices
# Require the exact matching version-release of the hpijs sub-package to make sure
# to have the exact matching version of libhpip and libhpmud installed.
# A wrong library version may let libsane-hpaio crash (e.g. segfault)
# which lets the whole scanning stack frontend<->libsane-dll<->libsane-backend crash
# also for any other backend when the hpaio backend is enabled (e.g. "scanimage -L"):
Group: Hardware/Scanner
Requires: %{name}-hpijs = %{version}-%{release}
Requires: %{name}-udev-rules = %{version}-%{release}
# See comment in hpijs sub-package for same Suggests:
Suggests: %{name} = %{version}
Enhances: sane-backends
# Automatically install this package if hpijs sub-package and sane-backends are
# both installed:
Supplements: (%{name}-hpijs and sane-backends)
%description sane
This package includes the backend driver for scanning with HP scanners
and all-in-one devices using SANE tools like xsane or scanimage.
%package scan-utils
Summary: HPLIP scanning frontends hp-scan and hp-uiscan
# SLE does not provide python-pillow (PIL) (bsc#1131613)
Group: Hardware/Scanner
Requires: %{pymod Pillow}
# hp-scan et al. import skimage from the scikit-image package.
# It is pretty heavy-weight and pulls in various other packages.
Requires: %{pymod scikit-image}
Requires: hplip
Enhances: hplip
# "hplip-scan" has been replaced by hplip-scan-utils
Provides: %{name}-scan = %{version}-%{release}
Obsoletes: %{name}-scan < %{version}-%{release}
%description scan-utils
This package provides the "hp-scan" and "hp-uiscan" frontend utilities. These
utilities are alternatives to the SANE frontends "xsane" and "scanimage". They
expose some advanced features of certain HP scanner models.
%package udev-rules
Summary: HPLIP udev rules
Group: Hardware/Scanner
%description udev-rules
This package provides the udev rules required to use these devices as a normal user.
%package devel
Summary: Development files for hplip
# Require the exact matching version-release of the hpijs sub-package to make sure
# to have the exact matching version of libhpip and libhpmud installed:
Group: Development/Languages/C and C++
Requires: %{name}-hpijs = %{version}-%{release}
# Require the exact matching version-release of the sane sub-package to make sure
# to have the exact matching version of libsane-hpaio installed:
Requires: %{name}-sane = %{version}-%{release}
Requires: cups-devel
Requires: dbus-1-devel
Requires: libopenssl-devel
Requires: libusb-1_0-devel
Requires: net-snmp-devel
%description devel
This sub-package is only required by developers.
%prep
# Be quiet when unpacking:
%setup -q
# Patch101 change-udev-rules.diff changes the udev rules file 56-hpmud.rules
%patch -P 101 -p1 -b .change-udev-rules.orig
# Patch106 disable_hp-upgrade.patch disables hp-upgrade/upgrade.py for security reasons,
# see https://bugzilla.novell.com/show_bug.cgi?id=853405
# To upgrade HPLIP an openSUSE software package manager like YaST or zypper should be used.
%patch -P 106 -p1 -b .disable_hp-upgrade.orig
%patch -P 107 -p1 -b .udev_rules_dir.orig
# Patch108 add_missing_includes_and_define_GNU_SOURCE.patch adds missing '#include <...>'
# and missing '#define _GNU_SOURCE' see https://bugs.launchpad.net/hplip/+bug/1456590
%patch -P 108 -p1 -b .add_missing_includes_and_define_GNU_SOURCE.orig
%patch -P 110 -p1 -b .boo1094141
%patch -P 112 -p1
%patch -P 300 -p1 -b .pcardext-python3
%patch -P 301 -p1 -b .misc-headers
%patch -P 302 -p1 -b .hp_ipp_missing_prototypes
%patch -P 304 -p1
%patch -P 305 -p1
%patch -P 306 -p1
%patch -P 400 -p1
%patch -P 401 -p1
%patch -P 402 -p1
%patch -P 403 -p1
%patch -P 404 -p1
%patch -P 500 -p1
%patch -P 601 -p1
%patch -P 602 -p1
%patch -P 603 -p1
%patch -P 604 -p1
%patch -P 605 -p1
# replace "env" shebang and "/usr/bin/python" with real executable
find . -name '*.py' -o -name pstotiff | \
xargs -n 1 sed -i '1s,^#!\(%{_bindir}/env python\|%{_bindir}/python\),#!%{pyexe},'
sed -i 's,%{_bindir}/python\>,%{pyexe},' \
data/rules/*
# remove shebang line and replace icon not available on openSUSE
sed -i -e '/#!.*xdg-open$/d' \
-e 's|%{_datadir}/icons/Humanity/devices/48/printer.svg|printer|' hp-uiscan.desktop.in
cp -p %{SOURCE103} %{SOURCE104} ppd/hpcups
%build
# If AUTOMAKE='automake --foreign' is not set, autoreconf (in fact automake)
# complains about missing files like NEWS, README, AUTHORS, ChangeLog
# in each directory where a Makefile.am exists:
AUTOMAKE='automake --foreign' autoreconf -fvi
# Fix improper method of Python.h lookup in configure, no longer working with Python 3.8
PYTHON_INCLUDEDIR="$(python3-config --includes)"
# Set our preferred architecture-specific flags for the compiler and linker:
export CFLAGS="%{optflags} ${PYTHON_INCLUDEDIR} -Wno-error=return-type"
export CXXFLAGS="%{optflags} ${PYTHON_INCLUDEDIR} -fno-strict-aliasing -Wno-error=return-type"
# --disable-pp-build disables parallel port build because parallel port support is deprecated by upstream HPLIP
# and by upstream in general cf. "Parallel port printers" at https://en.opensuse.org/SDB:Installing_a_Printer
# Since version 3.9.6 the default printer driver install changed from hpijs to hpcups.
# According to http://hplipopensource.com/hplip-web/release_notes.html
# all drv installs require CUPSDDK 1.2.3 or higher.
# Otherwise a static PPD install must be performed.
# Furthermore dynamic PPDs will be deprecated in the future in CUPS,
# see http://www.cups.org/str.php?L3772
# For hpcups static PPD install one needs:
# --enable-hpcups-install enable hpcups install (default=yes)
# --disable-cups-drv-install enable cups dynamic ppd install (default=yes)
# --enable-cups-ppd-install enable cups static ppd install (default=no)
# For both hpcups and hpijs install with static PPDs one needs additionally:
# --enable-hpijs-install enable hpijs install (default=no)
# --disable-foomatic-drv-install enable foomatic dynamic ppd install (default=no), uses drvdir and hpppddir
# --enable-foomatic-ppd-install enable foomatic static ppd install (default=no), uses hpppddir
# Because foomatic-rip-hplip has CVE-2011-2697 (bnc#698451) plus a leftover in CVE-2004-0801 (bnc#59233)
# which are fixed up to openSUSE 11.4 with patches, after openSUSE 11.4 (i.e. since openSUSE 12.1)
# foomatic-rip-hplip is no longer installed and foomatic-rip from
# foomatic-filters or cups-filters-foomatic-rip is used instead so that
# --disable-foomatic-rip-hplip-install is explicitly set and as a consequence the "cupsFilter" entries
# in the static PPDs are changed in the install section to use foomatic-rip.
# Since HPLIP 3.13.10 --with-htmldir is new but it does not inhertit its value from --with-docdir
# so that --with-htmldir must be explicitly set.
%configure \
--disable-qt3 \
--disable-qt4 \
--enable-qt5 \
--disable-policykit \
--enable-doc-build \
--enable-network-build \
--disable-pp-build \
--enable-scan-build \
--enable-gui-build \
--enable-fax-build \
--enable-dbus-build \
--enable-hpcups-install \
--disable-cups-drv-install \
--enable-cups-ppd-install \
--enable-hpijs-install \
--disable-foomatic-drv-install \
--disable-imageProcessor-build \
--enable-foomatic-ppd-install \
--disable-foomatic-rip-hplip-install \
--with-hpppddir=%{_datadir}/cups/model/manufacturer-PPDs/%{name} \
--with-cupsbackenddir=%{_prefix}/lib/cups/backend \
--with-cupsfilterdir=%{_prefix}/lib/cups/filter \
--with-drvdir=%{_prefix}/lib/cups/driver \
--with-mimedir=%{_sysconfdir}/cups \
--with-docdir=%{_defaultdocdir}/%{name} \
--with-htmldir=%{_defaultdocdir}/%{name} \
PYTHON=%{pyexe}
%make_build
sed -i 's|ppd/hpcups/\*.ppd.gz ||g' Makefile
%install
%make_install
# Make and install Python compiled bytecode files
%py3_compile %{buildroot}%{_datadir}/hplip
%py3_compile -O %{buildroot}%{_datadir}/hplip
# Hardlink .pyc and .pyo when they have same content.
# Do not run "fdupes buildroot/_datadir/hplip" because
# fdupes will link any files with same content there
# which can have unexpected side-effects, compare
# https://bugzilla.opensuse.org/show_bug.cgi?id=784670
for pyc in $( find %{buildroot}%{_datadir}/hplip -name '*.pyc' )
do
pyo="${pyc%.pyc}.opt-1.pyc"
if test -f $pyo && cmp -s $pyc $pyo
then echo hardlinking $pyc and $pyo because both have same content
ln -f $pyc $pyo
fi
done
# HPLIP's "make install" installs -rw-r--r-- usr/share/hplip/fax/pstotiff
# and usr/lib/cups/filter/pstotiff -> usr/share/hplip/fax/pstotiff
# so that when the CUPS filter usr/lib/cups/filter/pstotiff is called,
# it cannot execute usr/share/hplip/fax/pstotiff which is fixed hereby
# (see https://bugs.launchpad.net/hplip/+bug/1064247 and bnc#783810):
chmod a+x %{buildroot}%{_datadir}/hplip/fax/pstotiff
# The /var/lib/hp directory is created everywhere except on openSUSE 12.2 and later versions
# (perhaps an autoconf issue) so that it is created here as simple and fail-safe workaround
# see https://bugs.launchpad.net/bugs/1018303 and bnc#780413
# using fixed "/var/log/hp" because this is hardcoded in the HPLIP sources
# regarding owner and permissions see the "files hpijs" section below
# and Patch102 no-chgrp_lp_hplip_Logdir.diff:
test -d %{buildroot}%{_localstatedir}/lib/hp || install -d %{buildroot}%{_localstatedir}/lib/hp
# Create a /var/log/hp/tmp/ directory that is needed by hp-sendfax
# as a workaround until HPLIP upstream implemented it correctly
# see https://bugzilla.novell.com/show_bug.cgi?id=800312
# and https://bugs.launchpad.net/bugs/1016507
install -d %{buildroot}%{_localstatedir}/log/hp/tmp
# Remove the installed /etc/sane.d/dll.conf
# because this is provided by the sane-backends package:
rm %{buildroot}%{_sysconfdir}/sane.d/dll.conf
mkdir %{buildroot}%{_sysconfdir}/sane.d/dll.d
echo hpaio >%{buildroot}%{_sysconfdir}/sane.d/dll.d/hpaio
# Remove the installed HAL fdi file because HAL is no longer used (HAL is deprecated):
rm %{buildroot}%{_datadir}/hal/fdi/preprobe/10osvendor/20-hplip-devices.fdi
# Remove the installed hplip-printer@.service file for systemd
# because it would run hp-config_usb_printer - a tool to automatically
# set up HP USB printers and if needed automatically download and install
# non-free proprietary plugin software from HP which should not happen
# and it can cause whatever kind of strange behaviour
# see for example https://bugs.launchpad.net/bugs/1197416
# while in contrast manual printer setup via hp-setup usually "just works"
# and it is clear for the user what goes on and in case of failure what went wrong.
rm %{buildroot}%{_unitdir}/hplip-printer@.service
# Remove selinux configurations we are not supporting on SUSE
# force for not on all distributions the files were installed
# Can't be disabled during configure
rm -f %{buildroot}/%{name}.{fc,if,pp,te}
# Begin "General tests and adjustments for all PPDs" (see manufacturer-PPDs.spec):
pushd %{buildroot}%{_datadir}/cups/model/manufacturer-PPDs/%{name}
# Do not pollute the build log file with zillions of meaningless messages:
set +x
gunzip *.ppd.gz
# Make some general tests and adjustments for all PPDs:
echo "Making some general tests and adjustments for all PPDs:"
# Add a line-feed to the end of all PPDs to fix those PPDs where it is missing.
# See Novell/Suse Bugzilla bug #309832: Unix/Linux text files must end with a line-feed.
# Otherwise reading the last line results EOF and then some programs may ignore the last line.
echo "Adding a line-feed to the end of all PPDs to fix those PPDs where it is missing..."
for p in *.ppd
do echo -en '\n' >>$p
done
# Because foomatic-rip-hplip has CVE-2011-2697 (bnc#698451) plus a leftover in CVE-2004-0801 (bnc#59233)
# foomatic-rip-hplip is no longer installed and foomatic-rip from foomatic-filters or cups-filters-foomatic-rip
# is used instead so that the "cupsFilter" entries in the static PPDs must be changed accordingly:
echo "Replacing insecure foomatic-rip-hplip with foomatic-rip everywhere in in the PPDs..."
for p in *.ppd
do sed -i -e 's/foomatic-rip-hplip/foomatic-rip/' $p
done
# Final test by cupstestppd:
# To save disk space gzip the files (gzipped PPDs can also be used by CUPS).
# Future goal: Only have files which don't FAIL for cupstestppd.
# Ignore FAILs because of errors in UIConstraints and/or NonUIConstraints
# which are detected since cupstestppd in CUPS > 1.2.7 (i.e. in openSUSE 10.3).
# See Novell/Suse Bugzilla bug #309822: When this bug is fixed, cupstestppd would
# no longer result zero exit code.
# In the long run the PPDs should be fixed but as far as we know there have been
# no problems because of such UIConstraints errors so that it should be o.k.
# let those PPDs pass even if they are not strictly compliant.
# Ignore FAILs because of missing cupsFilter programs because
# in the package build environment the usual HPLIP filters
# like "hpcups" and "hpcupsfax" are
# installed at an unusual place (in the BuildRoot directory).
# For now keep all PPDs even if cupstestppd FAILs.
# Reason:
# With each CUPS version upgrade cupstestppd finds more and more errors
# so that more and more PPDs would be no longer included in the RPM
# which have been included before which results a regression.
# As far as we know there have been no problems at all because of
# not strictly compliant PPDs in HPLIP so that it is much better
# to provide all HPLIP PPDs so that the matching printers can be used
# than to be rigorous regarding enforcing compliance to the PPD specification:
echo "Final testing by cupstestppd..."
for p in *.ppd
do grep -E -v '^\*UIConstraints:|^\*NonUIConstraints:|^\*cupsFilter:' $p | cupstestppd - || true
gzip -n -9 $p
done
echo "Moving PPDs that use the hpps filter to %{_datadir}/cups/model/manufacturer-PPDs/hplip-hpps..."
# PPDs for various printers that use the hpps filter
# must be moved to the hplip main-package because
# the /usr/lib/cups/filter/hpps Python script imports
# various HPLIP modules from the hplip main-package
# so that the hpps filter belongs to the hplip main-package
# (see https://bugzilla.novell.com/show_bug.cgi?id=876690).
# Accordingly the PPDs that use the hpps filter must be moved
# to the hplip main-package which is implemented by moving them
# to a new directory /usr/share/cups/model/manufacturer-PPDs/hplip-hpps
# that is listed in the files list of the hplip main-package:
install -d %{buildroot}%{_datadir}/cups/model/manufacturer-PPDs/%{name}-hpps
for p in *.ppd.gz
do zgrep -q '^\*cupsFilter:.*hpps' $p && mv $p ../%{name}-hpps
done
echo "Moving PPDs that require a proprietary plugin from HP to %{_datadir}/cups/model/manufacturer-PPDs/hplip-plugin..."
# PPDs for various printers that require a proprietary plugin from HP
# must be moved to the hplip main-package because
# the proprietary plugin from HP must be downloaded and installed
# by using HP's "hp-plugin" tool from the hplip main-package
# (HP's "hp-setup" tool calls "hp-plugin" when needed).
# Accordingly PPDs that require a proprietary plugin from HP must be moved
# to the hplip main-package which is implemented by moving them
# to a new directory /usr/share/cups/model/manufacturer-PPDs/hplip-plugin
# that is listed in the files list of the hplip main-package
# (see https://bugzilla.novell.com/show_bug.cgi?id=876690):
install -d %{buildroot}%{_datadir}/cups/model/manufacturer-PPDs/%{name}-plugin
for p in *.ppd.gz
do zgrep -q '^\*NickName:.*requires proprietary plugin' $p && mv $p ../%{name}-plugin
done
echo "End of general tests and adjustments for all PPDs."
# Switch back to the usual build log messages:
set -x
# End of "General tests and adjustments for all PPDs":
popd
# Replace the invalid Desktop categories
%suse_update_desktop_file -r %{buildroot}%{_datadir}/applications/hplip.desktop System HardwareSettings
%suse_update_desktop_file -r %{buildroot}%{_datadir}/applications/hp-uiscan.desktop System HardwareSettings
# Let suse_update_desktop_file add X-SuSE-translate key to /etc/xdg/autostart/hplip-systray.desktop
# so that we can update its translations with translation-only packages.
%suse_update_desktop_file -i %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
# End of "Desktop menue entry stuff".
# Install the man page for /usr/bin/hpijs:
install -d %{buildroot}%{_mandir}/man1
install -m 644 %{SOURCE102} %{buildroot}%{_mandir}/man1/
# remove libtool archives
find "%{buildroot}" -type f -name "*.la" -delete -print
# Run fdupes:
# The RPM macro fdupes runs /usr/bin/fdupes that links files with identical content.
# Never run fdupes carelessly over the whole buildroot directory
# because in older openSUSE and SLE11 versions fdupes
# links files with different owner, group, or permissions
# see https://bugzilla.novell.com/show_bug.cgi?id=784670
# and even in current openSUSE versions fdupes links across sub-package boundaries,
# compare https://bugzilla.novell.com/show_bug.cgi?id=784869
# so that fdupes can only run for specific directories where linking files is safe:
%fdupes -s %{buildroot}%{_datadir}/hplip/data/images
%post -p /bin/bash
%udev_rules_update
%desktop_database_post
%icon_theme_cache_post
/sbin/ldconfig
exit 0
%postun -p /bin/bash
%desktop_database_postun
%icon_theme_cache_postun
/sbin/ldconfig
%postun sane
# Earlier versions of hplip modified /etc/sane.d/dll.conf
# Now we use /etc/sane.d/dll.d (multiple hpaio entries don't hurt).
# If the package was removed (but not if it was updated)
# then remove the hpaio lines in /etc/sane.d/dll.conf.
if [ "$1" = "0" ] && [ -w %{_sysconfdir}/sane.d/dll.conf ]; then
sed -i -e '/hpaio/d' %{_sysconfdir}/sane.d/dll.conf
fi
exit 0
%post hpijs -p /bin/bash
/sbin/ldconfig
exit 0
%postun hpijs -p /bin/bash
/sbin/ldconfig
exit 0
%files
%config %{_sysconfdir}/xdg/autostart/hplip-systray.desktop
%{_bindir}/hp-align
%{_bindir}/hp-check
%{_bindir}/hp-clean
%{_bindir}/hp-colorcal
%{_bindir}/hp-config_usb_printer
%{_bindir}/hp-devicesettings
%{_bindir}/hp-diagnose_plugin
%{_bindir}/hp-diagnose_queues
%{_bindir}/hp-doctor
%{_bindir}/hp-fab
%{_bindir}/hp-faxsetup
%{_bindir}/hp-firmware
%{_bindir}/hp-info
%{_bindir}/hp-levels
%{_bindir}/hp-linefeedcal
%{_bindir}/hp-logcapture
%{_bindir}/hp-makecopies
%{_bindir}/hp-makeuri
%{_bindir}/hp-pkservice
%{_bindir}/hp-plugin
%{_bindir}/hp-pqdiag
%{_bindir}/hp-print
%{_bindir}/hp-printsettings
%{_bindir}/hp-probe
%{_bindir}/hp-query
%{_bindir}/hp-sendfax
%{_bindir}/hp-setup
%{_bindir}/hp-systray
%{_bindir}/hp-testpage
%{_bindir}/hp-timedate
%{_bindir}/hp-toolbox
%{_bindir}/hp-uninstall
%{_bindir}/hp-unload
%{_bindir}/hp-upgrade
%{_bindir}/hp-wificonfig
%{_libdir}/python%{pyver}/site-packages/cupsext.*
%{_libdir}/python%{pyver}/site-packages/hpmudext.*
%{_libdir}/python%{pyver}/site-packages/pcardext.*
%dir %{_prefix}/lib/cups
%dir %{_prefix}/lib/cups/backend
%{_prefix}/lib/cups/backend/hpfax
%dir %{_prefix}/lib/cups/filter
%{_prefix}/lib/cups/filter/hpps
%dir %{_datadir}/cups
%dir %{_datadir}/cups/model
%dir %{_datadir}/cups/model/manufacturer-PPDs
%{_datadir}/cups/model/manufacturer-PPDs/%{name}-hpps/
%{_datadir}/cups/model/manufacturer-PPDs/%{name}-plugin/
%doc %{_defaultdocdir}/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/hplip/
%exclude %{_datadir}/hplip/data/models/models.dat
%exclude %{_datadir}/hplip/base/imageprocessing.py*
%exclude %{_datadir}/hplip/ui5/scandialog.py*
%exclude %{_datadir}/hplip/scan
%exclude %{_datadir}/hplip/scan.py*
%exclude %{_datadir}/hplip/uiscan.py*
%exclude %{_datadir}/hplip/__pycache__/uiscan.*
%exclude %{_datadir}/hplip/__pycache__/scan.*
%exclude %{_datadir}/hplip/base/__pycache__/imageprocessing.*
%exclude %{_datadir}/hplip/ui5/__pycache__/scandialog.*
# The scanning utils depend on PIL and python3-scikit-image,
# which are not available in SLE
%files scan-utils
%{_datadir}/applications/hp-uiscan.desktop
%{_libdir}/python%{pyver}/site-packages/scanext.*
%{_bindir}/hp-scan
%{_bindir}/hp-uiscan
%{_datadir}/hplip/scan
%{_datadir}/hplip/scan.py*
%{_datadir}/hplip/uiscan.py*
%{_datadir}/hplip/base/imageprocessing.py*
%{_datadir}/hplip/ui5/scandialog.py*
%{_datadir}/hplip/__pycache__/uiscan.*
%{_datadir}/hplip/__pycache__/scan.*
%{_datadir}/hplip/base/__pycache__/imageprocessing.*
%{_datadir}/hplip/ui5/__pycache__/scandialog.*
%files hpijs
%config %{_sysconfdir}/hp/
%config %{_sysconfdir}/cups/pstotiff.convs
%config %{_sysconfdir}/cups/pstotiff.types
%{_bindir}/hpijs
%{_mandir}/man1/hpijs.1%{?ext_man}
%{_libdir}/libhpip.so.*
%{_libdir}/libhpipp.so.*
%{_libdir}/libhpmud.so.*
%{_libdir}/libhpdiscovery.so.*
%dir %{_prefix}/lib/cups
%dir %{_prefix}/lib/cups/backend
%{_prefix}/lib/cups/backend/hp
%dir %{_prefix}/lib/cups/filter
%{_prefix}/lib/cups/filter/hpcups
%{_prefix}/lib/cups/filter/hpcupsfax
%{_prefix}/lib/cups/filter/hpcdmfax
%{_prefix}/lib/cups/filter/pstotiff
%dir %{_datadir}/cups
%dir %{_datadir}/cups/model
%dir %{_datadir}/cups/model/manufacturer-PPDs
%{_datadir}/cups/model/manufacturer-PPDs/%{name}/
%{_datadir}/%{name}/data/models/models.dat
# Use fixed "/var/log/hp" because this is hardcoded in the HPLIP sources.
# Regarding attr(0775,root,lp) see the comment for /var/log/hp/tmp below:
%dir %attr(0775,root,lp) %{_localstatedir}/log/hp
# Regarding attr(0775,root,lp) for /var/log/hp/tmp
# see https://bugzilla.novell.com/show_bug.cgi?id=800312#c0
# i.e. it is reasonable secure and hp-sendfax works with it:
%dir %attr(0775,root,lp) %{_localstatedir}/log/hp/tmp
# Use fixed "/var/lib/hp" because this is hardcoded in the HPLIP sources:
%dir %{_localstatedir}/lib/hp
%files sane
%dir %{_libdir}/sane
%{_libdir}/sane/libsane-hpaio.so.*
%dir %{_sysconfdir}/sane.d
%dir %{_sysconfdir}/sane.d/dll.d
%{_sysconfdir}/sane.d/dll.d/hpaio
%files udev-rules
%{_udevrulesdir}/56-hpmud.rules
%files devel
%{_libdir}/libhpip.so
%{_libdir}/libhpipp.so
%{_libdir}/libhpmud.so
%{_libdir}/libhpdiscovery.so
%{_libdir}/sane/libsane-hpaio.so
%changelog

View File

@ -0,0 +1,81 @@
From 74ed15a16e7564d0665afc68defbd6d03bdff21d Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Wed, 21 Mar 2018 23:55:12 +0100
Subject: [PATCH] pcardext: python3 fixes
---
pcard/pcardext/pcardext.c | 36 ++++++++++++++++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
diff --git a/pcard/pcardext/pcardext.c b/pcard/pcardext/pcardext.c
index c1a8273e4359..cdf260d62223 100644
--- a/pcard/pcardext/pcardext.c
+++ b/pcard/pcardext/pcardext.c
@@ -36,6 +36,12 @@ typedef int Py_ssize_t;
#define PY_SSIZE_T_MIN INT_MIN
#endif
+#if PY_MAJOR_VERSION >= 3
+#define PyString_AsStringAndSize PyBytes_AsStringAndSize
+#define PyString_FromStringAndSize PyBytes_FromStringAndSize
+#define PyInt_AS_LONG PyLong_AS_LONG
+#endif
+
int verbose=0;
PyObject * readsectorFunc = NULL;
@@ -78,8 +84,11 @@ int WriteSector(int sector, int nsector, void *buf, int size )
if( writesectorFunc )
{
+#if PY_MAJOR_VERSION >= 3
result = PyObject_CallFunction( writesectorFunc, "iis#", sector, nsector, buf, size );
-
+#else
+ result = PyObject_CallFunction( writesectorFunc, "iiy#", sector, nsector, buf, size );
+#endif
return PyInt_AS_LONG( result );
}
@@ -230,9 +239,31 @@ static PyMethodDef pcardext_methods[] =
{ NULL, NULL }
};
-
static char pcardext_documentation[] = "Python extension for HP photocard services";
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef moduledef = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = "pcardext",
+ .m_doc = pcardext_documentation,
+ .m_size = -1,
+ .m_methods = pcardext_methods,
+ .m_slots = NULL,
+ .m_traverse = NULL,
+ .m_clear = NULL,
+ .m_free = NULL,
+};
+
+PyMODINIT_FUNC
+PyInit_pcardext( void )
+{
+ PyObject *module = PyModule_Create2(&moduledef, PYTHON_API_VERSION);
+
+ return module;
+}
+
+#else
+
void initpcardext( void )
{
PyObject * mod = Py_InitModule4( "pcardext", pcardext_methods,
@@ -243,4 +274,5 @@ void initpcardext( void )
return;
}
+#endif
--
2.16.1

View File

@ -0,0 +1,27 @@
From 92ddbb36e2a589fe4d1cf27c30b67a1bb12bf9dc Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Fri, 16 Nov 2018 11:00:44 +0100
Subject: [PATCH] ui5/systemtray: wait only 10s for system tray
On GNOME >= 3.26, it will never show up. This may cause hangs on
logout if users log in and log out quickly again.
---
ui5/systemtray.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui5/systemtray.py b/ui5/systemtray.py
index a0cdaf1..101807a 100644
--- a/ui5/systemtray.py
+++ b/ui5/systemtray.py
@@ -841,7 +841,7 @@ def run(read_pipe):
app.setQuitOnLastWindowClosed(False) # If not set, settings dlg closes app
i = 0
- while i < 60:
+ while i < 10:
if QSystemTrayIcon.isSystemTrayAvailable():
break
time.sleep(1.0)
--
2.21.0