From c6faf6b8a2f8db0b3308a136352dfc2f5678bf0e Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Fri, 5 Sep 2014 01:16:44 -0300 Subject: hplip: remove libre suffix and add complex pkgrel --- libre/hplip-libre/PKGBUILD | 125 --------- libre/hplip-libre/cups-1.6-buildfix.diff | 392 ---------------------------- libre/hplip-libre/disable_upgrade.patch | 14 - libre/hplip-libre/hp-mkuri.patch | 11 - libre/hplip-libre/hplip-CVE-2013-4325.patch | 22 -- libre/hplip-libre/hplip.install | 18 -- libre/hplip-libre/hplip_typo.patch | 11 - libre/hplip/PKGBUILD | 123 +++++++++ libre/hplip/cups-1.6-buildfix.diff | 392 ++++++++++++++++++++++++++++ libre/hplip/disable_upgrade.patch | 14 + libre/hplip/hp-mkuri.patch | 11 + libre/hplip/hplip-CVE-2013-4325.patch | 22 ++ libre/hplip/hplip.install | 18 ++ libre/hplip/hplip_typo.patch | 11 + 14 files changed, 591 insertions(+), 593 deletions(-) delete mode 100644 libre/hplip-libre/PKGBUILD delete mode 100644 libre/hplip-libre/cups-1.6-buildfix.diff delete mode 100644 libre/hplip-libre/disable_upgrade.patch delete mode 100644 libre/hplip-libre/hp-mkuri.patch delete mode 100644 libre/hplip-libre/hplip-CVE-2013-4325.patch delete mode 100644 libre/hplip-libre/hplip.install delete mode 100644 libre/hplip-libre/hplip_typo.patch create mode 100644 libre/hplip/PKGBUILD create mode 100644 libre/hplip/cups-1.6-buildfix.diff create mode 100644 libre/hplip/disable_upgrade.patch create mode 100644 libre/hplip/hp-mkuri.patch create mode 100644 libre/hplip/hplip-CVE-2013-4325.patch create mode 100644 libre/hplip/hplip.install create mode 100644 libre/hplip/hplip_typo.patch (limited to 'libre') diff --git a/libre/hplip-libre/PKGBUILD b/libre/hplip-libre/PKGBUILD deleted file mode 100644 index 5558c54cc..000000000 --- a/libre/hplip-libre/PKGBUILD +++ /dev/null @@ -1,125 +0,0 @@ -# $Id: PKGBUILD 214338 2014-06-06 21:56:37Z andyrtr $ -# Maintainer (Arch): Andreas Radke -# Maintainer (Arch): Tom Gundersen -# Contributor (Arch): Rémy Oudompheng -# Contributor (Arch): Morgan LEFIEUX -# Maintainer: Jorge López - -_pkgname=hplip -pkgname=hplip-libre -pkgver=3.14.6 -pkgrel=1 -pkgdesc="Drivers for HP DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet, without printers with nonfree drivers support and hplip-plugin binary blobs recommendation (Parabola rebranded)" -arch=('i686' 'x86_64' 'mips64el') -url="http://hplipopensource.com" -license=('GPL') -depends=('python2' 'ghostscript>=8.64-6' 'foomatic-db' 'foomatic-db-engine' - 'net-snmp>=5.7.1' 'wget') -makedepends=('python2-pyqt4' 'python2-gobject2' 'sane' 'rpcbind' 'cups' 'libusb') -optdepends=('cups: for printing support' - 'python2-dbus: for dbus support' - 'sane: for scanner support' - 'python2-pillow: for commandline scanning support' - 'python2-notify: for Desktop notification support' - 'python2-reportlab: for pdf output in hp-scan' - 'rpcbind: for network support' - 'python2-pyqt4: for running GUI and hp-toolbox' - 'python2-gobject2: for running hp-toolbox' - 'libusb: for advanced usb support') -replaces=($_pkgname) -conflicts=($_pkgname) -provides=($_pkgname=$pkgver) -install=hplip.install -source=(http://downloads.sourceforge.net/${_pkgname}/$_pkgname-$pkgver.tar.gz{,.asc} - disable_upgrade.patch) -md5sums=('ec14b3bf3ac17a7c00b96e51d4c38114' - 'SKIP' - 'a853ba0eb0883f4bcee00b4277128b29') - -prepare() { - cd $_pkgname-$pkgver - - echo "Removing printers not supported with free drivers from the database" - - # based on http://devel.trisquel.info/gitweb/?p=package-helpers.git;a=blob_plain;f=helpers/make-hplip;hb=refs/heads/toutatis revision 4 - # keep header license - sed '/\[/,99999d' data/models/models.dat > mktemp - - for model in $(grep '\[' data/models/models.dat | /bin/sed 's/\[//; s/\]//'); do - sed -n "/\[$model\]/,/^$/p;" data/models/models.dat > mktemp1 - grep '^download=True' -q mktemp1 && continue - grep '^plugin=1' -q mktemp1 && continue - grep '^support-type=0' -q mktemp1 && continue - cat mktemp1 >> mktemp - done - - sed -i 's/plugin=2/plugin=0/g' mktemp - - cp mktemp data/models/models.dat - - rm -v mktemp{,1} - - echo "Preparing source" - - export PYTHON=python2 - - find . -type f -exec sed -i 's~^#.*env python~#!/usr/bin/env python2~' {} + - sed -i '1s|#!/usr/bin/python|#!/usr/bin/python2|' doctor.py setup.py makeuri.py logcapture.py base/magic.py - sed -i '1s|#!/usr/bin/python|#!/usr/bin/python2|' ui/upgradeform.py uninstall.py upgrade.py config_usb_printer.py - sed -i 's|python ./print.py|python2 ./print.py|' scan.py - sed -i 's|python ./testpage.py|python2 ./testpage.py|' setup.py - sed -i 's|python ./setup.py|python2 ./setup.py|' ui4/devmgr5.py ui4/nodevicesdialog.py - sed -i 's|python %HOME%|python2 %HOME%|' base/utils.py - sed -i 's|python ./plugin.py|python2 ./plugin.py|' base/pkit.py - sed -i 's|/usr/bin/python|/usr/bin/python2|' data/rules/hplip-printer@.service - - # disable insecure update - https://bugs.archlinux.org/task/38083 - patch -Np0 -i ${srcdir}/disable_upgrade.patch - - # https://bugs.archlinux.org/task/30085 - hack found in Gentoo - # Use system foomatic-rip for hpijs driver instead of foomatic-rip-hplip - # The hpcups driver does not use foomatic-rip - local i - for i in ppd/hpijs/*.ppd.gz ; do - rm -f ${i}.temp - gunzip -c ${i} | sed 's/foomatic-rip-hplip/foomatic-rip/g' | \ - gzip > ${i}.temp || return 1 - mv ${i}.temp ${i} - done - - export AUTOMAKE='automake --foreign' - autoreconf --force --install -} - -build() { - cd $_pkgname-$pkgver - ./configure --prefix=/usr \ - --enable-qt4 \ - --disable-foomatic-rip-hplip-install \ - --enable-foomatic-ppd-install \ - --enable-hpcups-install \ - --enable-new-hpcups \ - --enable-cups-ppd-install \ - --enable-cups-drv-install \ - --enable-hpijs-install \ - --enable-foomatic-drv-install \ - --enable-pp-build \ - --enable-udev-acl-rules #--help - - make -} - -package() { - #cd $_pkgname-$pkgver - cd $_pkgname-${pkgver/.a/a} - make rulesdir=/usr/lib/udev/rules.d DESTDIR="$pkgdir/" install - - # remove config provided by sane and autostart of hp-daemon - rm -rf "$pkgdir"/etc/{sane.d,xdg} - - # remove HAL .fdi file because HAL is no longer used - rm -vrf "$pkgdir"/usr/share/hal - - # remove rc script - rm -vrf "$pkgdir"/etc/init.d -} diff --git a/libre/hplip-libre/cups-1.6-buildfix.diff b/libre/hplip-libre/cups-1.6-buildfix.diff deleted file mode 100644 index 8341a1610..000000000 --- a/libre/hplip-libre/cups-1.6-buildfix.diff +++ /dev/null @@ -1,392 +0,0 @@ -diff -up hplip-3.12.6/prnt/cupsext/cupsext.c.ipp_accessors hplip-3.12.6/prnt/cupsext/cupsext.c ---- hplip-3.12.6/prnt/cupsext/cupsext.c.ipp_accessors 2012-06-18 12:41:19.000000000 +0200 -+++ hplip-3.12.6/prnt/cupsext/cupsext.c 2012-07-19 17:11:47.606524137 +0200 -@@ -87,6 +87,46 @@ typedef int Py_ssize_t; - #define PY_SSIZE_T_MIN INT_MIN - #endif - -+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) -+#define HAVE_CUPS_1_6 1 -+#endif -+ -+#ifndef HAVE_CUPS_1_6 -+#define ippGetCount(attr) attr->num_values -+#define ippGetGroupTag(attr) attr->group_tag -+#define ippGetValueTag(attr) attr->value_tag -+#define ippGetName(attr) attr->name -+#define ippGetBoolean(attr, element) attr->values[element].boolean -+#define ippGetInteger(attr, element) attr->values[element].integer -+#define ippGetStatusCode(ipp) ipp->request.status.status_code -+#define ippGetString(attr, element, language) attr->values[element].string.text -+ -+static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp ) -+{ -+ if (!ipp) -+ return (NULL); -+ return (ipp->current = ipp->attrs); -+} -+ -+static ipp_attribute_t * ippNextAttribute( ipp_t *ipp ) -+{ -+ if (!ipp || !ipp->current) -+ return (NULL); -+ return (ipp->current = ipp->current->next); -+} -+ -+static int ippSetOperation( ipp_t *ipp, ipp_op_t op ) -+{ -+ ipp->request.op.operation_id = op; -+ return (1); -+} -+ -+static int ippSetRequestId( ipp_t *ipp, int request_id ) -+{ -+ ipp->request.any.request_id = request_id; -+ return (1); -+} -+#endif - - int g_num_options = 0; - cups_option_t * g_options; -@@ -333,8 +373,8 @@ PyObject * getPrinters( PyObject * self, - request = ippNew(); - language = cupsLangDefault(); - -- request->request.op.operation_id = CUPS_GET_PRINTERS; -- request->request.any.request_id = 1; -+ ippSetOperation( request, CUPS_GET_PRINTERS ); -+ ippSetRequestId ( request, 1); - - ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding( language ) ); -@@ -378,10 +418,10 @@ PyObject * getPrinters( PyObject * self, - ipp_pstate_t state; - int i = 0; - -- for ( attr = response->attrs; attr != NULL; attr = attr->next ) -+ for ( attr = ippFirstAttribute( response ); attr != NULL; attr = ippNextAttribute( response ) ) - { -- while ( attr != NULL && attr->group_tag != IPP_TAG_PRINTER ) -- attr = attr->next; -+ while ( attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER ) -+ attr = ippNextAttribute( response ); - - if ( attr == NULL ) - break; -@@ -390,41 +430,41 @@ PyObject * getPrinters( PyObject * self, - state = IPP_PRINTER_IDLE; - accepting = 0; - -- while ( attr != NULL && attr->group_tag == IPP_TAG_PRINTER ) -+ while ( attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER ) - { -- if ( strcmp( attr->name, "printer-name" ) == 0 && -- attr->value_tag == IPP_TAG_NAME ) -- name = attr->values[ 0 ].string.text; -- -- else if ( strcmp( attr->name, "device-uri" ) == 0 && -- attr->value_tag == IPP_TAG_URI ) -- device_uri = attr->values[ 0 ].string.text; -- -- else if ( strcmp( attr->name, "printer-uri-supported" ) == 0 && -- attr->value_tag == IPP_TAG_URI ) -- printer_uri = attr->values[ 0 ].string.text; -- -- else if ( strcmp( attr->name, "printer-info" ) == 0 && -- attr->value_tag == IPP_TAG_TEXT ) -- info = attr->values[ 0 ].string.text; -- -- else if ( strcmp( attr->name, "printer-location" ) == 0 && -- attr->value_tag == IPP_TAG_TEXT ) -- location = attr->values[ 0 ].string.text; -- -- else if ( strcmp( attr->name, "printer-make-and-model" ) == 0 && -- attr->value_tag == IPP_TAG_TEXT ) -- make_model = attr->values[ 0 ].string.text; -- -- else if ( strcmp( attr->name, "printer-state" ) == 0 && -- attr->value_tag == IPP_TAG_ENUM ) -- state = ( ipp_pstate_t ) attr->values[ 0 ].integer; -- -- else if (!strcmp(attr->name, "printer-is-accepting-jobs") && -- attr->value_tag == IPP_TAG_BOOLEAN) -- accepting = attr->values[ 0 ].boolean; -+ if ( strcmp( ippGetName( attr ), "printer-name" ) == 0 && -+ ippGetValueTag( attr ) == IPP_TAG_NAME ) -+ name = ippGetString( attr, 0, NULL ); -+ -+ else if ( strcmp( ippGetName( attr ), "device-uri" ) == 0 && -+ ippGetValueTag( attr ) == IPP_TAG_URI ) -+ device_uri = ippGetString( attr, 0, NULL ); -+ -+ else if ( strcmp( ippGetName( attr ), "printer-uri-supported" ) == 0 && -+ ippGetValueTag( attr ) == IPP_TAG_URI ) -+ printer_uri = ippGetString( attr, 0, NULL ); -+ -+ else if ( strcmp( ippGetName( attr ), "printer-info" ) == 0 && -+ ippGetValueTag( attr ) == IPP_TAG_TEXT ) -+ info = ippGetString( attr, 0, NULL ); -+ -+ else if ( strcmp( ippGetName( attr ), "printer-location" ) == 0 && -+ ippGetValueTag( attr ) == IPP_TAG_TEXT ) -+ location = ippGetString( attr, 0, NULL ); -+ -+ else if ( strcmp( ippGetName( attr ), "printer-make-and-model" ) == 0 && -+ ippGetValueTag( attr ) == IPP_TAG_TEXT ) -+ make_model = ippGetString( attr, 0, NULL ); -+ -+ else if ( strcmp( ippGetName( attr ), "printer-state" ) == 0 && -+ ippGetValueTag( attr ) == IPP_TAG_ENUM ) -+ state = ( ipp_pstate_t ) ippGetInteger( attr, 0 ); -+ -+ else if (!strcmp(ippGetName( attr ), "printer-is-accepting-jobs") && -+ ippGetValueTag( attr ) == IPP_TAG_BOOLEAN) -+ accepting = ippGetBoolean( attr, 0 ); - -- attr = attr->next; -+ attr = ippNextAttribute( response ); - } - - if ( device_uri == NULL ) -@@ -522,8 +562,8 @@ PyObject * addPrinter( PyObject * self, - request = ippNew(); - language = cupsLangDefault(); - -- request->request.op.operation_id = CUPS_ADD_PRINTER; -- request->request.any.request_id = 1; -+ ippSetOperation( request, CUPS_ADD_PRINTER ); -+ ippSetRequestId ( request, 1 ); - - ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding( language ) ); -@@ -568,7 +608,7 @@ PyObject * addPrinter( PyObject * self, - } - else - { -- status = response->request.status.status_code; -+ status = ippGetStatusCode( response ); - //ippDelete( response ); - r = 1; - } -@@ -631,8 +671,8 @@ PyObject * delPrinter( PyObject * self, - */ - request = ippNew(); - -- request->request.op.operation_id = CUPS_DELETE_PRINTER; -- request->request.op.request_id = 1; -+ ippSetOperation( request, CUPS_DELETE_PRINTER ); -+ ippSetRequestId ( request, 1 ); - - language = cupsLangDefault(); - -@@ -650,7 +690,7 @@ PyObject * delPrinter( PyObject * self, - */ - response = cupsDoRequest( http, request, "/admin/" ); - -- if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) ) -+ if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) ) - { - r = 1; - } -@@ -721,8 +761,8 @@ PyObject * setDefaultPrinter( PyObject * - - request = ippNew(); - -- request->request.op.operation_id = CUPS_SET_DEFAULT; -- request->request.op.request_id = 1; -+ ippSetOperation( request, CUPS_SET_DEFAULT ); -+ ippSetRequestId ( request, 1 ); - - language = cupsLangDefault(); - -@@ -743,7 +783,7 @@ PyObject * setDefaultPrinter( PyObject * - - response = cupsDoRequest( http, request, "/admin/" ); - -- if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) ) -+ if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) ) - { - r = 1; - } -@@ -797,8 +837,8 @@ PyObject * controlPrinter( PyObject * se - - request = ippNew(); - -- request->request.op.operation_id = op; -- request->request.op.request_id = 1; -+ ippSetOperation( request, op ); -+ ippSetRequestId ( request, 1 ); - - language = cupsLangDefault(); - -@@ -822,7 +862,7 @@ PyObject * controlPrinter( PyObject * se - - response = cupsDoRequest(http, request, "/admin/"); - -- if (( response != NULL ) && (response->request.status.status_code <= IPP_OK_CONFLICT)) -+ if (( response != NULL ) && (ippGetStatusCode( response ) <= IPP_OK_CONFLICT)) - { - r = 1; - } -@@ -837,7 +877,7 @@ abort: - if ( response != NULL ) - ippDelete( response ); - -- return Py_BuildValue( "i", r );; -+ return Py_BuildValue( "i", r ); - } - - -@@ -1116,8 +1156,8 @@ PyObject * getPPDList( PyObject * self, - - request = ippNew(); - -- request->request.op.operation_id = CUPS_GET_PPDS; -- request->request.op.request_id = 1; -+ ippSetOperation( request, CUPS_GET_PPDS ); -+ ippSetRequestId ( request, 1 ); - - language = cupsLangDefault(); - -@@ -1143,43 +1183,43 @@ PyObject * getPPDList( PyObject * self, - if ((response = cupsDoRequest(http, request, "/")) != NULL) - { - -- for (attr = response->attrs; attr; attr = attr->next) -+ for (attr = ippFirstAttribute( response ); attr; attr = ippNextAttribute( response )) - { - PyObject *dict; - char *ppdname = NULL; - -- while (attr && attr->group_tag != IPP_TAG_PRINTER) -- attr = attr->next; -+ while (attr && ippGetGroupTag( attr ) != IPP_TAG_PRINTER) -+ attr = ippNextAttribute( response ); - - if (!attr) - break; - - dict = PyDict_New (); - -- for (; attr && attr->group_tag == IPP_TAG_PRINTER; attr = attr->next) -+ for (; attr && ippGetGroupTag( attr ) == IPP_TAG_PRINTER; attr = ippNextAttribute( response )) - { - PyObject *val = NULL; - -- if (!strcmp (attr->name, "ppd-name") && attr->value_tag == IPP_TAG_NAME) -+ if (!strcmp (ippGetName( attr ), "ppd-name") && ippGetValueTag( attr ) == IPP_TAG_NAME) - { -- ppdname = attr->values[0].string.text; -+ ppdname = ippGetString( attr, 0, NULL ); - - //sprintf( buf, "print '%s'", ppdname); - //PyRun_SimpleString( buf ); - } - -- else if (attr->value_tag == IPP_TAG_TEXT || attr->value_tag == IPP_TAG_NAME || attr->value_tag == IPP_TAG_KEYWORD) -- //else if ((!strcmp (attr->name, "ppd-natural-language") && attr->value_tag == IPP_TAG_LANGUAGE) || -- // (!strcmp (attr->name, "ppd-make-and-model") && attr->value_tag == IPP_TAG_TEXT) || -- // (!strcmp (attr->name, "ppd-make") && attr->value_tag == IPP_TAG_TEXT) || -- // (!strcmp (attr->name, "ppd-device-id") && attr->value_tag == IPP_TAG_TEXT)) -+ else if (ippGetValueTag( attr ) == IPP_TAG_TEXT || ippGetValueTag( attr ) == IPP_TAG_NAME || ippGetValueTag( attr ) == IPP_TAG_KEYWORD) -+ //else if ((!strcmp (ippGetName( attr ), "ppd-natural-language") && ippGetValueTag( attr ) == IPP_TAG_LANGUAGE) || -+ // (!strcmp (ippGetName( attr ), "ppd-make-and-model") && ippGetValueTag( attr ) == IPP_TAG_TEXT) || -+ // (!strcmp (ippGetName( attr ), "ppd-make") && ippGetValueTag( attr ) == IPP_TAG_TEXT) || -+ // (!strcmp (ippGetName( attr ), "ppd-device-id") && ippGetValueTag( attr ) == IPP_TAG_TEXT)) - { -- val = PyObj_from_UTF8(attr->values[0].string.text); -+ val = PyObj_from_UTF8(ippGetString( attr, 0, NULL )); - } - - if (val) - { -- PyDict_SetItemString (dict, attr->name, val); -+ PyDict_SetItemString (dict, ippGetName( attr ), val); - Py_DECREF (val); - } - } -diff -up hplip-3.12.6/scan/sane/hpaio.c.ipp_accessors hplip-3.12.6/scan/sane/hpaio.c ---- hplip-3.12.6/scan/sane/hpaio.c.ipp_accessors 2012-06-18 12:42:51.000000000 +0200 -+++ hplip-3.12.6/scan/sane/hpaio.c 2012-07-19 17:12:34.557848760 +0200 -@@ -47,6 +47,43 @@ - #define DEBUG_DECLARE_ONLY - #include "sanei_debug.h" - -+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) -+#define HAVE_CUPS_1_6 1 -+#endif -+ -+#ifndef HAVE_CUPS_1_6 -+#define ippGetGroupTag(attr) attr->group_tag -+#define ippGetValueTag(attr) attr->value_tag -+#define ippGetName(attr) attr->name -+#define ippGetString(attr, element, language) attr->values[element].string.text -+ -+static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp ) -+{ -+ if (!ipp) -+ return (NULL); -+ return (ipp->current = ipp->attrs); -+} -+ -+static ipp_attribute_t * ippNextAttribute( ipp_t *ipp ) -+{ -+ if (!ipp || !ipp->current) -+ return (NULL); -+ return (ipp->current = ipp->current->next); -+} -+ -+static int ippSetOperation( ipp_t *ipp, ipp_op_t op ) -+{ -+ ipp->request.op.operation_id = op; -+ return (1); -+} -+ -+static int ippSetRequestId( ipp_t *ipp, int request_id ) -+{ -+ ipp->request.any.request_id = request_id; -+ return (1); -+} -+#endif -+ - static SANE_Device **DeviceList = NULL; - - static int AddDeviceList(char *uri, char *model, SANE_Device ***pd) -@@ -186,8 +223,8 @@ static int GetCupsPrinters(char ***print - /* Assemble the IPP request */ - request = ippNew(); - -- request->request.op.operation_id = CUPS_GET_PRINTERS; -- request->request.any.request_id = 1; -+ ippSetOperation( request, CUPS_GET_PRINTERS ); -+ ippSetRequestId( request, 1 ); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8"); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, "en"); -@@ -197,20 +234,20 @@ static int GetCupsPrinters(char ***print - if ((response = cupsDoRequest(http, request, "/")) == NULL) - goto bugout; - -- for (attr = response->attrs; attr != NULL; attr = attr->next) -+ for (attr = ippFirstAttribute ( response ); attr != NULL; attr = ippNextAttribute( response )) - { - /* Skip leading attributes until we hit a printer. */ -- while (attr != NULL && attr->group_tag != IPP_TAG_PRINTER) -- attr = attr->next; -+ while (attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER) -+ attr = ippNextAttribute( response ); - - if (attr == NULL) - break; - -- while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER) -+ while (attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER) - { -- if (strcmp(attr->name, "device-uri") == 0 && attr->value_tag == IPP_TAG_URI && AddCupsList(attr->values[0].string.text, printer) == 0) -+ if (strcmp(ippGetName( attr ), "device-uri") == 0 && ippGetValueTag( attr ) == IPP_TAG_URI && AddCupsList(ippGetString( attr, 0, NULL ), printer) == 0) - cnt++; -- attr = attr->next; -+ attr = ippNextAttribute( response ); - } - - if (attr == NULL) diff --git a/libre/hplip-libre/disable_upgrade.patch b/libre/hplip-libre/disable_upgrade.patch deleted file mode 100644 index 600d6ccc7..000000000 --- a/libre/hplip-libre/disable_upgrade.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- upgrade.py.orig 2013-10-31 12:46:54.000000000 +0100 -+++ upgrade.py 2013-12-04 14:58:03.000000000 +0100 -@@ -134,6 +134,11 @@ except getopt.GetoptError, e: - if os.getenv("HPLIP_DEBUG"): - log.set_level('debug') - -+ -+log.error("HPLIP upgrade is disabled by Parabola for security reasons, see https://bugs.archlinux.org/task/38083 - if you like to upgrade HPLIP, use the Parabola software package manager pacman.") -+clean_exit(1) -+ -+ - for o, a in opts: - if o in ('-h', '--help'): - usage() diff --git a/libre/hplip-libre/hp-mkuri.patch b/libre/hplip-libre/hp-mkuri.patch deleted file mode 100644 index 518e7608f..000000000 --- a/libre/hplip-libre/hp-mkuri.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- io/hpmud/hp-mkuri.c.orig 2013-03-17 09:15:15.360624061 -0400 -+++ io/hpmud/hp-mkuri.c 2013-03-17 09:15:30.924316847 -0400 -@@ -266,7 +266,7 @@ - - /* Bypass glib build dependencies by loading libnotify manually. */ - -- if ((handle = load_library("libnotify.so.1")) == NULL) -+ if ((handle = load_library("libnotify.so.4")) == NULL) - { - BUG("failed to open libnotify: %m\n"); - goto bugout; diff --git a/libre/hplip-libre/hplip-CVE-2013-4325.patch b/libre/hplip-libre/hplip-CVE-2013-4325.patch deleted file mode 100644 index 85bff893b..000000000 --- a/libre/hplip-libre/hplip-CVE-2013-4325.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -up hplip-3.13.7/base/pkit.py.CVE-2013-4325 hplip-3.13.7/base/pkit.py ---- hplip-3.13.7/base/pkit.py.CVE-2013-4325 2013-07-23 06:18:29.000000000 +0100 -+++ hplip-3.13.7/base/pkit.py 2013-09-11 10:54:13.252419283 +0100 -@@ -176,15 +176,10 @@ class PolicyKitService(dbus.service.Obje - "/org/freedesktop/PolicyKit1/Authority", - "org.freedesktop.PolicyKit1.Authority") - policy_kit = dbus.Interface(obj, "org.freedesktop.PolicyKit1.Authority") -- info = dbus.Interface(connection.get_object("org.freedesktop.DBus", -- "/org/freedesktop/DBus/Bus", -- False), -- "org.freedesktop.DBus") -- pid = info.GetConnectionUnixProcessID(sender) - - subject = ( -- 'unix-process', -- { 'pid' : dbus.UInt32(pid, variant_level = 1) } -+ 'system-bus-name', -+ { 'name' : dbus.String(sender, variant_level = 1) } - ) - details = { '' : '' } - flags = dbus.UInt32(1) # AllowUserInteraction = 0x00000001 - diff --git a/libre/hplip-libre/hplip.install b/libre/hplip-libre/hplip.install deleted file mode 100644 index 74532cde3..000000000 --- a/libre/hplip-libre/hplip.install +++ /dev/null @@ -1,18 +0,0 @@ -post_install() { - cat << EOF - -NOTE ----- -# If you want to use this driver with sane: -# echo "hpaio" >> /etc/sane.d/dll.conf - -EOF -} - -post_upgrade() { - if [ "`vercmp $2 3.12.4-2`" -lt 0 ]; then - # important upgrade notice - echo "> Please remove your printer in cups, then add it" - echo "> back and reconfigure it to make it work again!" - fi -} diff --git a/libre/hplip-libre/hplip_typo.patch b/libre/hplip-libre/hplip_typo.patch deleted file mode 100644 index 8d22f51ea..000000000 --- a/libre/hplip-libre/hplip_typo.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- config_usb_printer.py 2013-05-19 02:23:17.506716304 +0300 -+++ config_usb_printer.py.new 2013-05-19 02:23:30.140049848 +0300 -@@ -257,7 +257,7 @@ - # ******************************* RUNNING FIRMWARE DOWNLOAD TO DEVICE FOR SUPPORTED PRINTER'S - fw_download_req = mq.get('fw-download', False) - if fw_download_req: -- fw_cmd = utlis.which('hp-firmware', True) -+ fw_cmd = utils.which('hp-firmware', True) - if fw_cmd: - fw_cmd += " -y3 -s %s"%param - log.debug(fw_cmd) diff --git a/libre/hplip/PKGBUILD b/libre/hplip/PKGBUILD new file mode 100644 index 000000000..f4665872d --- /dev/null +++ b/libre/hplip/PKGBUILD @@ -0,0 +1,123 @@ +# $Id: PKGBUILD 214338 2014-06-06 21:56:37Z andyrtr $ +# Maintainer (Arch): Andreas Radke +# Maintainer (Arch): Tom Gundersen +# Contributor (Arch): Rémy Oudompheng +# Contributor (Arch): Morgan LEFIEUX +# Maintainer: Jorge López + +pkgname=hplip +pkgver=3.14.6 +pkgrel=1.parabola1 +pkgdesc="Drivers for HP DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet, without printers with nonfree drivers support and hplip-plugin binary blobs recommendation (Parabola rebranded)" +arch=('i686' 'x86_64' 'mips64el') +url="http://hplipopensource.com" +license=('GPL') +depends=('python2' 'ghostscript>=8.64-6' 'foomatic-db' 'foomatic-db-engine' + 'net-snmp>=5.7.1' 'wget') +makedepends=('python2-pyqt4' 'python2-gobject2' 'sane' 'rpcbind' 'cups' 'libusb') +optdepends=('cups: for printing support' + 'python2-dbus: for dbus support' + 'sane: for scanner support' + 'python2-pillow: for commandline scanning support' + 'python2-notify: for Desktop notification support' + 'python2-reportlab: for pdf output in hp-scan' + 'rpcbind: for network support' + 'python2-pyqt4: for running GUI and hp-toolbox' + 'python2-gobject2: for running hp-toolbox' + 'libusb: for advanced usb support') +replaces=(${pkgname}-libre) +conflicts=(${pkgname}-libre) +install=hplip.install +source=(http://downloads.sourceforge.net/${pkgname}/$pkgname-$pkgver.tar.gz{,.asc} + disable_upgrade.patch) +md5sums=('ec14b3bf3ac17a7c00b96e51d4c38114' + 'SKIP' + 'a853ba0eb0883f4bcee00b4277128b29') + +prepare() { + cd $pkgname-$pkgver + + echo "Removing printers not supported with free drivers from the database" + + # based on http://devel.trisquel.info/gitweb/?p=package-helpers.git;a=blob_plain;f=helpers/make-hplip;hb=refs/heads/toutatis revision 4 + # keep header license + sed '/\[/,99999d' data/models/models.dat > mktemp + + for model in $(grep '\[' data/models/models.dat | /bin/sed 's/\[//; s/\]//'); do + sed -n "/\[$model\]/,/^$/p;" data/models/models.dat > mktemp1 + grep '^download=True' -q mktemp1 && continue + grep '^plugin=1' -q mktemp1 && continue + grep '^support-type=0' -q mktemp1 && continue + cat mktemp1 >> mktemp + done + + sed -i 's/plugin=2/plugin=0/g' mktemp + + cp mktemp data/models/models.dat + + rm -v mktemp{,1} + + echo "Preparing source" + + export PYTHON=python2 + + find . -type f -exec sed -i 's~^#.*env python~#!/usr/bin/env python2~' {} + + sed -i '1s|#!/usr/bin/python|#!/usr/bin/python2|' doctor.py setup.py makeuri.py logcapture.py base/magic.py + sed -i '1s|#!/usr/bin/python|#!/usr/bin/python2|' ui/upgradeform.py uninstall.py upgrade.py config_usb_printer.py + sed -i 's|python ./print.py|python2 ./print.py|' scan.py + sed -i 's|python ./testpage.py|python2 ./testpage.py|' setup.py + sed -i 's|python ./setup.py|python2 ./setup.py|' ui4/devmgr5.py ui4/nodevicesdialog.py + sed -i 's|python %HOME%|python2 %HOME%|' base/utils.py + sed -i 's|python ./plugin.py|python2 ./plugin.py|' base/pkit.py + sed -i 's|/usr/bin/python|/usr/bin/python2|' data/rules/hplip-printer@.service + + # disable insecure update - https://bugs.archlinux.org/task/38083 + patch -Np0 -i ${srcdir}/disable_upgrade.patch + + # https://bugs.archlinux.org/task/30085 - hack found in Gentoo + # Use system foomatic-rip for hpijs driver instead of foomatic-rip-hplip + # The hpcups driver does not use foomatic-rip + local i + for i in ppd/hpijs/*.ppd.gz ; do + rm -f ${i}.temp + gunzip -c ${i} | sed 's/foomatic-rip-hplip/foomatic-rip/g' | \ + gzip > ${i}.temp || return 1 + mv ${i}.temp ${i} + done + + export AUTOMAKE='automake --foreign' + autoreconf --force --install +} + +build() { + cd $pkgname-$pkgver + ./configure --prefix=/usr \ + --enable-qt4 \ + --disable-foomatic-rip-hplip-install \ + --enable-foomatic-ppd-install \ + --enable-hpcups-install \ + --enable-new-hpcups \ + --enable-cups-ppd-install \ + --enable-cups-drv-install \ + --enable-hpijs-install \ + --enable-foomatic-drv-install \ + --enable-pp-build \ + --enable-udev-acl-rules #--help + + make +} + +package() { + #cd $pkgname-$pkgver + cd $pkgname-${pkgver/.a/a} + make rulesdir=/usr/lib/udev/rules.d DESTDIR="$pkgdir/" install + + # remove config provided by sane and autostart of hp-daemon + rm -rf "$pkgdir"/etc/{sane.d,xdg} + + # remove HAL .fdi file because HAL is no longer used + rm -vrf "$pkgdir"/usr/share/hal + + # remove rc script + rm -vrf "$pkgdir"/etc/init.d +} diff --git a/libre/hplip/cups-1.6-buildfix.diff b/libre/hplip/cups-1.6-buildfix.diff new file mode 100644 index 000000000..8341a1610 --- /dev/null +++ b/libre/hplip/cups-1.6-buildfix.diff @@ -0,0 +1,392 @@ +diff -up hplip-3.12.6/prnt/cupsext/cupsext.c.ipp_accessors hplip-3.12.6/prnt/cupsext/cupsext.c +--- hplip-3.12.6/prnt/cupsext/cupsext.c.ipp_accessors 2012-06-18 12:41:19.000000000 +0200 ++++ hplip-3.12.6/prnt/cupsext/cupsext.c 2012-07-19 17:11:47.606524137 +0200 +@@ -87,6 +87,46 @@ typedef int Py_ssize_t; + #define PY_SSIZE_T_MIN INT_MIN + #endif + ++#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) ++#define HAVE_CUPS_1_6 1 ++#endif ++ ++#ifndef HAVE_CUPS_1_6 ++#define ippGetCount(attr) attr->num_values ++#define ippGetGroupTag(attr) attr->group_tag ++#define ippGetValueTag(attr) attr->value_tag ++#define ippGetName(attr) attr->name ++#define ippGetBoolean(attr, element) attr->values[element].boolean ++#define ippGetInteger(attr, element) attr->values[element].integer ++#define ippGetStatusCode(ipp) ipp->request.status.status_code ++#define ippGetString(attr, element, language) attr->values[element].string.text ++ ++static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp ) ++{ ++ if (!ipp) ++ return (NULL); ++ return (ipp->current = ipp->attrs); ++} ++ ++static ipp_attribute_t * ippNextAttribute( ipp_t *ipp ) ++{ ++ if (!ipp || !ipp->current) ++ return (NULL); ++ return (ipp->current = ipp->current->next); ++} ++ ++static int ippSetOperation( ipp_t *ipp, ipp_op_t op ) ++{ ++ ipp->request.op.operation_id = op; ++ return (1); ++} ++ ++static int ippSetRequestId( ipp_t *ipp, int request_id ) ++{ ++ ipp->request.any.request_id = request_id; ++ return (1); ++} ++#endif + + int g_num_options = 0; + cups_option_t * g_options; +@@ -333,8 +373,8 @@ PyObject * getPrinters( PyObject * self, + request = ippNew(); + language = cupsLangDefault(); + +- request->request.op.operation_id = CUPS_GET_PRINTERS; +- request->request.any.request_id = 1; ++ ippSetOperation( request, CUPS_GET_PRINTERS ); ++ ippSetRequestId ( request, 1); + + ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, + "attributes-charset", NULL, cupsLangEncoding( language ) ); +@@ -378,10 +418,10 @@ PyObject * getPrinters( PyObject * self, + ipp_pstate_t state; + int i = 0; + +- for ( attr = response->attrs; attr != NULL; attr = attr->next ) ++ for ( attr = ippFirstAttribute( response ); attr != NULL; attr = ippNextAttribute( response ) ) + { +- while ( attr != NULL && attr->group_tag != IPP_TAG_PRINTER ) +- attr = attr->next; ++ while ( attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER ) ++ attr = ippNextAttribute( response ); + + if ( attr == NULL ) + break; +@@ -390,41 +430,41 @@ PyObject * getPrinters( PyObject * self, + state = IPP_PRINTER_IDLE; + accepting = 0; + +- while ( attr != NULL && attr->group_tag == IPP_TAG_PRINTER ) ++ while ( attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER ) + { +- if ( strcmp( attr->name, "printer-name" ) == 0 && +- attr->value_tag == IPP_TAG_NAME ) +- name = attr->values[ 0 ].string.text; +- +- else if ( strcmp( attr->name, "device-uri" ) == 0 && +- attr->value_tag == IPP_TAG_URI ) +- device_uri = attr->values[ 0 ].string.text; +- +- else if ( strcmp( attr->name, "printer-uri-supported" ) == 0 && +- attr->value_tag == IPP_TAG_URI ) +- printer_uri = attr->values[ 0 ].string.text; +- +- else if ( strcmp( attr->name, "printer-info" ) == 0 && +- attr->value_tag == IPP_TAG_TEXT ) +- info = attr->values[ 0 ].string.text; +- +- else if ( strcmp( attr->name, "printer-location" ) == 0 && +- attr->value_tag == IPP_TAG_TEXT ) +- location = attr->values[ 0 ].string.text; +- +- else if ( strcmp( attr->name, "printer-make-and-model" ) == 0 && +- attr->value_tag == IPP_TAG_TEXT ) +- make_model = attr->values[ 0 ].string.text; +- +- else if ( strcmp( attr->name, "printer-state" ) == 0 && +- attr->value_tag == IPP_TAG_ENUM ) +- state = ( ipp_pstate_t ) attr->values[ 0 ].integer; +- +- else if (!strcmp(attr->name, "printer-is-accepting-jobs") && +- attr->value_tag == IPP_TAG_BOOLEAN) +- accepting = attr->values[ 0 ].boolean; ++ if ( strcmp( ippGetName( attr ), "printer-name" ) == 0 && ++ ippGetValueTag( attr ) == IPP_TAG_NAME ) ++ name = ippGetString( attr, 0, NULL ); ++ ++ else if ( strcmp( ippGetName( attr ), "device-uri" ) == 0 && ++ ippGetValueTag( attr ) == IPP_TAG_URI ) ++ device_uri = ippGetString( attr, 0, NULL ); ++ ++ else if ( strcmp( ippGetName( attr ), "printer-uri-supported" ) == 0 && ++ ippGetValueTag( attr ) == IPP_TAG_URI ) ++ printer_uri = ippGetString( attr, 0, NULL ); ++ ++ else if ( strcmp( ippGetName( attr ), "printer-info" ) == 0 && ++ ippGetValueTag( attr ) == IPP_TAG_TEXT ) ++ info = ippGetString( attr, 0, NULL ); ++ ++ else if ( strcmp( ippGetName( attr ), "printer-location" ) == 0 && ++ ippGetValueTag( attr ) == IPP_TAG_TEXT ) ++ location = ippGetString( attr, 0, NULL ); ++ ++ else if ( strcmp( ippGetName( attr ), "printer-make-and-model" ) == 0 && ++ ippGetValueTag( attr ) == IPP_TAG_TEXT ) ++ make_model = ippGetString( attr, 0, NULL ); ++ ++ else if ( strcmp( ippGetName( attr ), "printer-state" ) == 0 && ++ ippGetValueTag( attr ) == IPP_TAG_ENUM ) ++ state = ( ipp_pstate_t ) ippGetInteger( attr, 0 ); ++ ++ else if (!strcmp(ippGetName( attr ), "printer-is-accepting-jobs") && ++ ippGetValueTag( attr ) == IPP_TAG_BOOLEAN) ++ accepting = ippGetBoolean( attr, 0 ); + +- attr = attr->next; ++ attr = ippNextAttribute( response ); + } + + if ( device_uri == NULL ) +@@ -522,8 +562,8 @@ PyObject * addPrinter( PyObject * self, + request = ippNew(); + language = cupsLangDefault(); + +- request->request.op.operation_id = CUPS_ADD_PRINTER; +- request->request.any.request_id = 1; ++ ippSetOperation( request, CUPS_ADD_PRINTER ); ++ ippSetRequestId ( request, 1 ); + + ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, + "attributes-charset", NULL, cupsLangEncoding( language ) ); +@@ -568,7 +608,7 @@ PyObject * addPrinter( PyObject * self, + } + else + { +- status = response->request.status.status_code; ++ status = ippGetStatusCode( response ); + //ippDelete( response ); + r = 1; + } +@@ -631,8 +671,8 @@ PyObject * delPrinter( PyObject * self, + */ + request = ippNew(); + +- request->request.op.operation_id = CUPS_DELETE_PRINTER; +- request->request.op.request_id = 1; ++ ippSetOperation( request, CUPS_DELETE_PRINTER ); ++ ippSetRequestId ( request, 1 ); + + language = cupsLangDefault(); + +@@ -650,7 +690,7 @@ PyObject * delPrinter( PyObject * self, + */ + response = cupsDoRequest( http, request, "/admin/" ); + +- if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) ) ++ if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) ) + { + r = 1; + } +@@ -721,8 +761,8 @@ PyObject * setDefaultPrinter( PyObject * + + request = ippNew(); + +- request->request.op.operation_id = CUPS_SET_DEFAULT; +- request->request.op.request_id = 1; ++ ippSetOperation( request, CUPS_SET_DEFAULT ); ++ ippSetRequestId ( request, 1 ); + + language = cupsLangDefault(); + +@@ -743,7 +783,7 @@ PyObject * setDefaultPrinter( PyObject * + + response = cupsDoRequest( http, request, "/admin/" ); + +- if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) ) ++ if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) ) + { + r = 1; + } +@@ -797,8 +837,8 @@ PyObject * controlPrinter( PyObject * se + + request = ippNew(); + +- request->request.op.operation_id = op; +- request->request.op.request_id = 1; ++ ippSetOperation( request, op ); ++ ippSetRequestId ( request, 1 ); + + language = cupsLangDefault(); + +@@ -822,7 +862,7 @@ PyObject * controlPrinter( PyObject * se + + response = cupsDoRequest(http, request, "/admin/"); + +- if (( response != NULL ) && (response->request.status.status_code <= IPP_OK_CONFLICT)) ++ if (( response != NULL ) && (ippGetStatusCode( response ) <= IPP_OK_CONFLICT)) + { + r = 1; + } +@@ -837,7 +877,7 @@ abort: + if ( response != NULL ) + ippDelete( response ); + +- return Py_BuildValue( "i", r );; ++ return Py_BuildValue( "i", r ); + } + + +@@ -1116,8 +1156,8 @@ PyObject * getPPDList( PyObject * self, + + request = ippNew(); + +- request->request.op.operation_id = CUPS_GET_PPDS; +- request->request.op.request_id = 1; ++ ippSetOperation( request, CUPS_GET_PPDS ); ++ ippSetRequestId ( request, 1 ); + + language = cupsLangDefault(); + +@@ -1143,43 +1183,43 @@ PyObject * getPPDList( PyObject * self, + if ((response = cupsDoRequest(http, request, "/")) != NULL) + { + +- for (attr = response->attrs; attr; attr = attr->next) ++ for (attr = ippFirstAttribute( response ); attr; attr = ippNextAttribute( response )) + { + PyObject *dict; + char *ppdname = NULL; + +- while (attr && attr->group_tag != IPP_TAG_PRINTER) +- attr = attr->next; ++ while (attr && ippGetGroupTag( attr ) != IPP_TAG_PRINTER) ++ attr = ippNextAttribute( response ); + + if (!attr) + break; + + dict = PyDict_New (); + +- for (; attr && attr->group_tag == IPP_TAG_PRINTER; attr = attr->next) ++ for (; attr && ippGetGroupTag( attr ) == IPP_TAG_PRINTER; attr = ippNextAttribute( response )) + { + PyObject *val = NULL; + +- if (!strcmp (attr->name, "ppd-name") && attr->value_tag == IPP_TAG_NAME) ++ if (!strcmp (ippGetName( attr ), "ppd-name") && ippGetValueTag( attr ) == IPP_TAG_NAME) + { +- ppdname = attr->values[0].string.text; ++ ppdname = ippGetString( attr, 0, NULL ); + + //sprintf( buf, "print '%s'", ppdname); + //PyRun_SimpleString( buf ); + } + +- else if (attr->value_tag == IPP_TAG_TEXT || attr->value_tag == IPP_TAG_NAME || attr->value_tag == IPP_TAG_KEYWORD) +- //else if ((!strcmp (attr->name, "ppd-natural-language") && attr->value_tag == IPP_TAG_LANGUAGE) || +- // (!strcmp (attr->name, "ppd-make-and-model") && attr->value_tag == IPP_TAG_TEXT) || +- // (!strcmp (attr->name, "ppd-make") && attr->value_tag == IPP_TAG_TEXT) || +- // (!strcmp (attr->name, "ppd-device-id") && attr->value_tag == IPP_TAG_TEXT)) ++ else if (ippGetValueTag( attr ) == IPP_TAG_TEXT || ippGetValueTag( attr ) == IPP_TAG_NAME || ippGetValueTag( attr ) == IPP_TAG_KEYWORD) ++ //else if ((!strcmp (ippGetName( attr ), "ppd-natural-language") && ippGetValueTag( attr ) == IPP_TAG_LANGUAGE) || ++ // (!strcmp (ippGetName( attr ), "ppd-make-and-model") && ippGetValueTag( attr ) == IPP_TAG_TEXT) || ++ // (!strcmp (ippGetName( attr ), "ppd-make") && ippGetValueTag( attr ) == IPP_TAG_TEXT) || ++ // (!strcmp (ippGetName( attr ), "ppd-device-id") && ippGetValueTag( attr ) == IPP_TAG_TEXT)) + { +- val = PyObj_from_UTF8(attr->values[0].string.text); ++ val = PyObj_from_UTF8(ippGetString( attr, 0, NULL )); + } + + if (val) + { +- PyDict_SetItemString (dict, attr->name, val); ++ PyDict_SetItemString (dict, ippGetName( attr ), val); + Py_DECREF (val); + } + } +diff -up hplip-3.12.6/scan/sane/hpaio.c.ipp_accessors hplip-3.12.6/scan/sane/hpaio.c +--- hplip-3.12.6/scan/sane/hpaio.c.ipp_accessors 2012-06-18 12:42:51.000000000 +0200 ++++ hplip-3.12.6/scan/sane/hpaio.c 2012-07-19 17:12:34.557848760 +0200 +@@ -47,6 +47,43 @@ + #define DEBUG_DECLARE_ONLY + #include "sanei_debug.h" + ++#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) ++#define HAVE_CUPS_1_6 1 ++#endif ++ ++#ifndef HAVE_CUPS_1_6 ++#define ippGetGroupTag(attr) attr->group_tag ++#define ippGetValueTag(attr) attr->value_tag ++#define ippGetName(attr) attr->name ++#define ippGetString(attr, element, language) attr->values[element].string.text ++ ++static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp ) ++{ ++ if (!ipp) ++ return (NULL); ++ return (ipp->current = ipp->attrs); ++} ++ ++static ipp_attribute_t * ippNextAttribute( ipp_t *ipp ) ++{ ++ if (!ipp || !ipp->current) ++ return (NULL); ++ return (ipp->current = ipp->current->next); ++} ++ ++static int ippSetOperation( ipp_t *ipp, ipp_op_t op ) ++{ ++ ipp->request.op.operation_id = op; ++ return (1); ++} ++ ++static int ippSetRequestId( ipp_t *ipp, int request_id ) ++{ ++ ipp->request.any.request_id = request_id; ++ return (1); ++} ++#endif ++ + static SANE_Device **DeviceList = NULL; + + static int AddDeviceList(char *uri, char *model, SANE_Device ***pd) +@@ -186,8 +223,8 @@ static int GetCupsPrinters(char ***print + /* Assemble the IPP request */ + request = ippNew(); + +- request->request.op.operation_id = CUPS_GET_PRINTERS; +- request->request.any.request_id = 1; ++ ippSetOperation( request, CUPS_GET_PRINTERS ); ++ ippSetRequestId( request, 1 ); + + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8"); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, "en"); +@@ -197,20 +234,20 @@ static int GetCupsPrinters(char ***print + if ((response = cupsDoRequest(http, request, "/")) == NULL) + goto bugout; + +- for (attr = response->attrs; attr != NULL; attr = attr->next) ++ for (attr = ippFirstAttribute ( response ); attr != NULL; attr = ippNextAttribute( response )) + { + /* Skip leading attributes until we hit a printer. */ +- while (attr != NULL && attr->group_tag != IPP_TAG_PRINTER) +- attr = attr->next; ++ while (attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER) ++ attr = ippNextAttribute( response ); + + if (attr == NULL) + break; + +- while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER) ++ while (attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER) + { +- if (strcmp(attr->name, "device-uri") == 0 && attr->value_tag == IPP_TAG_URI && AddCupsList(attr->values[0].string.text, printer) == 0) ++ if (strcmp(ippGetName( attr ), "device-uri") == 0 && ippGetValueTag( attr ) == IPP_TAG_URI && AddCupsList(ippGetString( attr, 0, NULL ), printer) == 0) + cnt++; +- attr = attr->next; ++ attr = ippNextAttribute( response ); + } + + if (attr == NULL) diff --git a/libre/hplip/disable_upgrade.patch b/libre/hplip/disable_upgrade.patch new file mode 100644 index 000000000..600d6ccc7 --- /dev/null +++ b/libre/hplip/disable_upgrade.patch @@ -0,0 +1,14 @@ +--- upgrade.py.orig 2013-10-31 12:46:54.000000000 +0100 ++++ upgrade.py 2013-12-04 14:58:03.000000000 +0100 +@@ -134,6 +134,11 @@ except getopt.GetoptError, e: + if os.getenv("HPLIP_DEBUG"): + log.set_level('debug') + ++ ++log.error("HPLIP upgrade is disabled by Parabola for security reasons, see https://bugs.archlinux.org/task/38083 - if you like to upgrade HPLIP, use the Parabola software package manager pacman.") ++clean_exit(1) ++ ++ + for o, a in opts: + if o in ('-h', '--help'): + usage() diff --git a/libre/hplip/hp-mkuri.patch b/libre/hplip/hp-mkuri.patch new file mode 100644 index 000000000..518e7608f --- /dev/null +++ b/libre/hplip/hp-mkuri.patch @@ -0,0 +1,11 @@ +--- io/hpmud/hp-mkuri.c.orig 2013-03-17 09:15:15.360624061 -0400 ++++ io/hpmud/hp-mkuri.c 2013-03-17 09:15:30.924316847 -0400 +@@ -266,7 +266,7 @@ + + /* Bypass glib build dependencies by loading libnotify manually. */ + +- if ((handle = load_library("libnotify.so.1")) == NULL) ++ if ((handle = load_library("libnotify.so.4")) == NULL) + { + BUG("failed to open libnotify: %m\n"); + goto bugout; diff --git a/libre/hplip/hplip-CVE-2013-4325.patch b/libre/hplip/hplip-CVE-2013-4325.patch new file mode 100644 index 000000000..85bff893b --- /dev/null +++ b/libre/hplip/hplip-CVE-2013-4325.patch @@ -0,0 +1,22 @@ +diff -up hplip-3.13.7/base/pkit.py.CVE-2013-4325 hplip-3.13.7/base/pkit.py +--- hplip-3.13.7/base/pkit.py.CVE-2013-4325 2013-07-23 06:18:29.000000000 +0100 ++++ hplip-3.13.7/base/pkit.py 2013-09-11 10:54:13.252419283 +0100 +@@ -176,15 +176,10 @@ class PolicyKitService(dbus.service.Obje + "/org/freedesktop/PolicyKit1/Authority", + "org.freedesktop.PolicyKit1.Authority") + policy_kit = dbus.Interface(obj, "org.freedesktop.PolicyKit1.Authority") +- info = dbus.Interface(connection.get_object("org.freedesktop.DBus", +- "/org/freedesktop/DBus/Bus", +- False), +- "org.freedesktop.DBus") +- pid = info.GetConnectionUnixProcessID(sender) + + subject = ( +- 'unix-process', +- { 'pid' : dbus.UInt32(pid, variant_level = 1) } ++ 'system-bus-name', ++ { 'name' : dbus.String(sender, variant_level = 1) } + ) + details = { '' : '' } + flags = dbus.UInt32(1) # AllowUserInteraction = 0x00000001 + diff --git a/libre/hplip/hplip.install b/libre/hplip/hplip.install new file mode 100644 index 000000000..74532cde3 --- /dev/null +++ b/libre/hplip/hplip.install @@ -0,0 +1,18 @@ +post_install() { + cat << EOF + +NOTE +---- +# If you want to use this driver with sane: +# echo "hpaio" >> /etc/sane.d/dll.conf + +EOF +} + +post_upgrade() { + if [ "`vercmp $2 3.12.4-2`" -lt 0 ]; then + # important upgrade notice + echo "> Please remove your printer in cups, then add it" + echo "> back and reconfigure it to make it work again!" + fi +} diff --git a/libre/hplip/hplip_typo.patch b/libre/hplip/hplip_typo.patch new file mode 100644 index 000000000..8d22f51ea --- /dev/null +++ b/libre/hplip/hplip_typo.patch @@ -0,0 +1,11 @@ +--- config_usb_printer.py 2013-05-19 02:23:17.506716304 +0300 ++++ config_usb_printer.py.new 2013-05-19 02:23:30.140049848 +0300 +@@ -257,7 +257,7 @@ + # ******************************* RUNNING FIRMWARE DOWNLOAD TO DEVICE FOR SUPPORTED PRINTER'S + fw_download_req = mq.get('fw-download', False) + if fw_download_req: +- fw_cmd = utlis.which('hp-firmware', True) ++ fw_cmd = utils.which('hp-firmware', True) + if fw_cmd: + fw_cmd += " -y3 -s %s"%param + log.debug(fw_cmd) -- cgit v1.2.3-54-g00ecf