--- /dev/null
+--- hplip-3.11.10/base/pkit.py~ 2011-10-02 05:06:15.000000000 +0200
++++ hplip-3.11.10/base/pkit.py 2011-11-30 19:07:51.344925378 +0100
+@@ -318,7 +318,28 @@
+ log.debug("shutdown: %s" % str(e))
+ return False
+
+-
++def binaryPatch(f):
++ try
++ # file, md5sum, replace content at address with specified byte
++ patches = { 'lj-x86_32.so' : { 'md5': '30bdf8c844508a53d80362f9eba670c5',
++ # https://bugs.launchpad.net/hplip/+bug/666780
++ 'replace' : [ (0xA068, 0x10) ]
++ } }
++ if f in patches:
++ d = open(f, 'rb').read()
++ m = hashlib.md5()
++ m.update(d)
++ m.digest()
++ if patches[f]['md5'] == m.hexdigest():
++ file = open(f, 'rb+')
++ for (addr, val) in patches[f]['replace']:
++ file.seek(addr)
++ file.write(chr(val))
++ file.close()
++ except Exception, e:
++ log.debug("binaryPatch: %s" % str(e))
++ return False
++ return True
+
+ def copyPluginFiles(src_dir):
+ os.chdir(src_dir)
+@@ -411,6 +432,11 @@
+ continue
+
+ else:
++
++ if not binaryPatch(trg):
++ log.error("Target file %s could not be binary patched to fixup bugs." % trg)
++ continue
++
+ if not os.path.exists(trg):
+ log.error("Target file %s does not exist. File copy failed." % trg)
+ continue
Summary(pl.UTF-8): Narzędzia Hewlett-Packard Linux Imaging and Printing - drukowanie i skanowanie przy użyciu urządzeń HP
Name: hplip
Version: 3.11.10
-Release: 1
+Release: 1.2
License: BSD (hpijs), MIT (low-level scanning and printing code), GPL v2 (the rest)
Group: Applications/System
Source0: http://downloads.sourceforge.net/hplip/%{name}-%{version}.tar.gz
Patch0: %{name}-desktop.patch
Patch1: unresolved.patch
Patch2: pld-distro.patch
+Patch3: %{name}-binary-fixup.patch
URL: http://hplipopensource.com/
BuildRequires: autoconf
BuildRequires: automake
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
%{__sed} -i -e's,^#!/usr/bin/env python$,#!/usr/bin/python,' *.py
%{__sed} -i -e 's#test -d /usr/share/polkit-1#true#' configure.in