wok-6.x rev 14624

Up: hplip to 3.12.11.
author Christopher Rogers <slaxemulator@gmail.com>
date Sat Jun 01 10:21:01 2013 +0000 (2013-06-01)
parents c1685ec71d84
children 1bf5511f099e
files hplip/receipt hplip/stuff/cups-1.6-buildfix.diff hplip/stuff/hplip-cups-1.5.0-compatibility.patch
line diff
     1.1 --- a/hplip/receipt	Sat Jun 01 10:16:08 2013 +0000
     1.2 +++ b/hplip/receipt	Sat Jun 01 10:21:01 2013 +0000
     1.3 @@ -1,18 +1,18 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="hplip"
     1.7 -VERSION="3.12.2" 
     1.8 +VERSION="3.12.11" 
     1.9  CATEGORY="system-tools"
    1.10  SHORT_DESC="Drivers for HP DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet"
    1.11  MAINTAINER="jozee@slitaz.org"
    1.12  DEPENDS="ghostscript python cups dbus-python libusb jpeg tiff sane-backends \
    1.13 -libgphoto2 libexif gcc-lib-base libtool libv4l"
    1.14 -BUILD_DEPENDS="ghostscript-dev dbus-python-dev sane-backends-dev sane-backends \
    1.15 -libexif-dev libgphoto2-dev libgphoto2 pkg-config libusb-dev jpeg-dev cups-dev \
    1.16 -dbus-dev tiff-dev python python-dev dbus-python libtool"
    1.17 +libgphoto2 libexif gcc-lib-base libtool libv4l net-snmp PyQt-x11-gpl"
    1.18 +BUILD_DEPENDS="ghostscript-dev dbus-python-dev sane-backends-dev \
    1.19 +sane-backends libexif-dev libgphoto2-dev Qt4-dev libgphoto2 pkg-config libusb-dev \
    1.20 +jpeg-dev cups-dev dbus-dev tiff-dev python python-dev dbus-python net-snmp-dev"
    1.21  TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.22  WEB_SITE="http://hplipopensource.com"
    1.23 -WGET_URL="http://downloads.sourceforge.net/sourceforge/hplip/$TARBALL"
    1.24 +WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    1.25  TAGS="printer driver printing"
    1.26  BUGS="Unable to delete hplip.desktop from $fs.  Using hack in post_install."
    1.27  
    1.28 @@ -20,18 +20,18 @@
    1.29  compile_rules()
    1.30  {
    1.31  	cd $src
    1.32 +
    1.33 +	# fix build with cups 1.6 - FC hplip-ipp-accessors.patch
    1.34 +	patch -Np1 -i $stuff/cups-1.6-buildfix.diff
    1.35 +
    1.36  	./configure  \
    1.37  		--prefix=/usr \
    1.38  		--sysconfdir=/etc \
    1.39 -		--disable-network-build \
    1.40  		--disable-doc-build \
    1.41 -		--disable-gui-build \
    1.42 -		--disable-fax-build \
    1.43 -		--disable-qt3 \
    1.44 -                --enable-pp-build \
    1.45 +		--enable-qt4 \
    1.46  		$CONFIGURE_ARGS &&
    1.47  	make &&
    1.48 -	make DESTDIR=$PWD/_pkg install
    1.49 +	make DESTDIR=$DESTDIR install
    1.50  }
    1.51  
    1.52  # Rules to gen a SliTaz package suitable for Tazpkg.
    1.53 @@ -39,21 +39,23 @@
    1.54  {
    1.55  	mkdir -p $fs/etc $fs/usr/lib $fs/usr/share
    1.56  	
    1.57 -	cp -a $_pkg/etc   $fs
    1.58 -	cp -a $_pkg/usr/bin $fs/usr
    1.59 -	cp -a $_pkg/usr/lib/cups $fs/usr/lib
    1.60 -	cp -a $_pkg/usr/lib/python* $fs/usr/lib
    1.61 -	cp -a $_pkg/usr/lib/sane $fs/usr/lib
    1.62 -	cp -a $_pkg/usr/lib/*so* $fs/usr/lib
    1.63 -	cp -a $_pkg/usr/share/cups \
    1.64 -		   $_pkg/usr/share/hal \
    1.65 -		   $_pkg/usr/share/hplip \
    1.66 -		   $_pkg/usr/share/ppd \
    1.67 +	cp -a $install/etc   $fs
    1.68 +	cp -a $install/usr/bin $fs/usr
    1.69 +	cp -a $install/usr/lib/cups $fs/usr/lib
    1.70 +	cp -a $install/usr/lib/python* $fs/usr/lib
    1.71 +	cp -a $install/usr/lib/sane $fs/usr/lib
    1.72 +	cp -a $install/usr/lib/*so* $fs/usr/lib
    1.73 +	cp -a $install/usr/share/cups \
    1.74 +		   $install/usr/share/hplip \
    1.75 +		   $install/usr/share/ppd \
    1.76  		   $fs/usr/share
    1.77  
    1.78  	# compress non-zipped ppd files
    1.79  	find $fs/usr/share/ppd/HP -name "*.ppd" -exec gzip -n9 {} \;
    1.80 - 
    1.81 +
    1.82 +	# make sure hp-toolbox exist
    1.83 +	ln -sf ../share/hplip/toolbox.py $fs/usr/bin/hp-toolbox	
    1.84 +
    1.85  	# remove autostart of hp-daemon
    1.86  	rm -rf $fs/etc/sane.d
    1.87   
    1.88 @@ -63,8 +65,5 @@
    1.89  
    1.90  post_install()
    1.91  {
    1.92 -	# remove the desktop file                                   
    1.93 -	rm $fs/usr/share/applications/hplip.desktop
    1.94 -	                
    1.95  	tazpkg reconfigure udev --root=$1
    1.96  }
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/hplip/stuff/cups-1.6-buildfix.diff	Sat Jun 01 10:21:01 2013 +0000
     2.3 @@ -0,0 +1,392 @@
     2.4 +diff -up hplip-3.12.6/prnt/cupsext/cupsext.c.ipp_accessors hplip-3.12.6/prnt/cupsext/cupsext.c
     2.5 +--- hplip-3.12.6/prnt/cupsext/cupsext.c.ipp_accessors	2012-06-18 12:41:19.000000000 +0200
     2.6 ++++ hplip-3.12.6/prnt/cupsext/cupsext.c	2012-07-19 17:11:47.606524137 +0200
     2.7 +@@ -87,6 +87,46 @@ typedef int Py_ssize_t;
     2.8 + #define PY_SSIZE_T_MIN INT_MIN
     2.9 + #endif
    2.10 +
    2.11 ++#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
    2.12 ++#define HAVE_CUPS_1_6 1
    2.13 ++#endif
    2.14 ++
    2.15 ++#ifndef HAVE_CUPS_1_6
    2.16 ++#define ippGetCount(attr)     attr->num_values
    2.17 ++#define ippGetGroupTag(attr)  attr->group_tag
    2.18 ++#define ippGetValueTag(attr)  attr->value_tag
    2.19 ++#define ippGetName(attr)      attr->name
    2.20 ++#define ippGetBoolean(attr, element) attr->values[element].boolean
    2.21 ++#define ippGetInteger(attr, element) attr->values[element].integer
    2.22 ++#define ippGetStatusCode(ipp) ipp->request.status.status_code
    2.23 ++#define ippGetString(attr, element, language) attr->values[element].string.text
    2.24 ++
    2.25 ++static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp )
    2.26 ++{
    2.27 ++    if (!ipp)
    2.28 ++        return (NULL);
    2.29 ++    return (ipp->current = ipp->attrs);
    2.30 ++}
    2.31 ++
    2.32 ++static ipp_attribute_t * ippNextAttribute( ipp_t *ipp )
    2.33 ++{
    2.34 ++    if (!ipp || !ipp->current)
    2.35 ++        return (NULL);
    2.36 ++    return (ipp->current = ipp->current->next);
    2.37 ++}
    2.38 ++
    2.39 ++static int ippSetOperation( ipp_t *ipp, ipp_op_t op )
    2.40 ++{
    2.41 ++    ipp->request.op.operation_id = op;
    2.42 ++    return (1);
    2.43 ++}
    2.44 ++
    2.45 ++static int ippSetRequestId( ipp_t *ipp, int request_id )
    2.46 ++{
    2.47 ++    ipp->request.any.request_id = request_id;
    2.48 ++    return (1);
    2.49 ++}
    2.50 ++#endif
    2.51 +
    2.52 + int g_num_options = 0;
    2.53 + cups_option_t * g_options;
    2.54 +@@ -333,8 +373,8 @@ PyObject * getPrinters( PyObject * self,
    2.55 +     request = ippNew();
    2.56 +     language = cupsLangDefault();
    2.57 +
    2.58 +-    request->request.op.operation_id = CUPS_GET_PRINTERS;
    2.59 +-    request->request.any.request_id = 1;
    2.60 ++    ippSetOperation( request, CUPS_GET_PRINTERS );
    2.61 ++    ippSetRequestId ( request, 1);
    2.62 +
    2.63 +     ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
    2.64 +                   "attributes-charset", NULL, cupsLangEncoding( language ) );
    2.65 +@@ -378,10 +418,10 @@ PyObject * getPrinters( PyObject * self,
    2.66 +         ipp_pstate_t state;
    2.67 +         int i = 0;
    2.68 +
    2.69 +-        for ( attr = response->attrs; attr != NULL; attr = attr->next )
    2.70 ++        for ( attr = ippFirstAttribute( response ); attr != NULL; attr = ippNextAttribute( response ) )
    2.71 +         {
    2.72 +-            while ( attr != NULL && attr->group_tag != IPP_TAG_PRINTER )
    2.73 +-                attr = attr->next;
    2.74 ++            while ( attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER )
    2.75 ++                attr = ippNextAttribute( response );
    2.76 +
    2.77 +             if ( attr == NULL )
    2.78 +                 break;
    2.79 +@@ -390,41 +430,41 @@ PyObject * getPrinters( PyObject * self,
    2.80 +             state = IPP_PRINTER_IDLE;
    2.81 +             accepting = 0;
    2.82 +
    2.83 +-            while ( attr != NULL && attr->group_tag == IPP_TAG_PRINTER )
    2.84 ++            while ( attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER )
    2.85 +             {
    2.86 +-                if ( strcmp( attr->name, "printer-name" ) == 0 &&
    2.87 +-                        attr->value_tag == IPP_TAG_NAME )
    2.88 +-                    name = attr->values[ 0 ].string.text;
    2.89 +-
    2.90 +-                else if ( strcmp( attr->name, "device-uri" ) == 0 &&
    2.91 +-                        attr->value_tag == IPP_TAG_URI )
    2.92 +-                    device_uri = attr->values[ 0 ].string.text;
    2.93 +-
    2.94 +-                else if ( strcmp( attr->name, "printer-uri-supported" ) == 0 &&
    2.95 +-                        attr->value_tag == IPP_TAG_URI )
    2.96 +-                    printer_uri = attr->values[ 0 ].string.text;
    2.97 +-
    2.98 +-                else if ( strcmp( attr->name, "printer-info" ) == 0 &&
    2.99 +-                        attr->value_tag == IPP_TAG_TEXT )
   2.100 +-                    info = attr->values[ 0 ].string.text;
   2.101 +-
   2.102 +-                else if ( strcmp( attr->name, "printer-location" ) == 0 &&
   2.103 +-                        attr->value_tag == IPP_TAG_TEXT )
   2.104 +-                    location = attr->values[ 0 ].string.text;
   2.105 +-
   2.106 +-                else if ( strcmp( attr->name, "printer-make-and-model" ) == 0 &&
   2.107 +-                        attr->value_tag == IPP_TAG_TEXT )
   2.108 +-                    make_model = attr->values[ 0 ].string.text;
   2.109 +-
   2.110 +-                else if ( strcmp( attr->name, "printer-state" ) == 0 &&
   2.111 +-                        attr->value_tag == IPP_TAG_ENUM )
   2.112 +-                    state = ( ipp_pstate_t ) attr->values[ 0 ].integer;
   2.113 +-
   2.114 +-                else if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
   2.115 +-                        attr->value_tag == IPP_TAG_BOOLEAN)
   2.116 +-                    accepting = attr->values[ 0 ].boolean;
   2.117 ++                if ( strcmp( ippGetName( attr ), "printer-name" ) == 0 &&
   2.118 ++                        ippGetValueTag( attr ) == IPP_TAG_NAME )
   2.119 ++                    name = ippGetString( attr, 0, NULL );
   2.120 ++
   2.121 ++                else if ( strcmp( ippGetName( attr ), "device-uri" ) == 0 &&
   2.122 ++                        ippGetValueTag( attr ) == IPP_TAG_URI )
   2.123 ++                    device_uri = ippGetString( attr, 0, NULL );
   2.124 ++
   2.125 ++                else if ( strcmp( ippGetName( attr ), "printer-uri-supported" ) == 0 &&
   2.126 ++                        ippGetValueTag( attr ) == IPP_TAG_URI )
   2.127 ++                    printer_uri = ippGetString( attr, 0, NULL );
   2.128 ++
   2.129 ++                else if ( strcmp( ippGetName( attr ), "printer-info" ) == 0 &&
   2.130 ++                        ippGetValueTag( attr ) == IPP_TAG_TEXT )
   2.131 ++                    info = ippGetString( attr, 0, NULL );
   2.132 ++
   2.133 ++                else if ( strcmp( ippGetName( attr ), "printer-location" ) == 0 &&
   2.134 ++                        ippGetValueTag( attr ) == IPP_TAG_TEXT )
   2.135 ++                    location = ippGetString( attr, 0, NULL );
   2.136 ++
   2.137 ++                else if ( strcmp( ippGetName( attr ), "printer-make-and-model" ) == 0 &&
   2.138 ++                        ippGetValueTag( attr ) == IPP_TAG_TEXT )
   2.139 ++                    make_model = ippGetString( attr, 0, NULL );
   2.140 ++
   2.141 ++                else if ( strcmp( ippGetName( attr ), "printer-state" ) == 0 &&
   2.142 ++                        ippGetValueTag( attr ) == IPP_TAG_ENUM )
   2.143 ++                    state = ( ipp_pstate_t ) ippGetInteger( attr, 0 );
   2.144 ++
   2.145 ++                else if (!strcmp(ippGetName( attr ), "printer-is-accepting-jobs") &&
   2.146 ++                        ippGetValueTag( attr ) == IPP_TAG_BOOLEAN)
   2.147 ++                    accepting = ippGetBoolean( attr, 0 );
   2.148 +
   2.149 +-                attr = attr->next;
   2.150 ++                attr = ippNextAttribute( response );
   2.151 +             }
   2.152 +
   2.153 +             if ( device_uri == NULL )
   2.154 +@@ -522,8 +562,8 @@ PyObject * addPrinter( PyObject * self,
   2.155 +     request = ippNew();
   2.156 +     language = cupsLangDefault();
   2.157 +
   2.158 +-    request->request.op.operation_id = CUPS_ADD_PRINTER;
   2.159 +-    request->request.any.request_id = 1;
   2.160 ++    ippSetOperation( request, CUPS_ADD_PRINTER );
   2.161 ++    ippSetRequestId ( request, 1 );
   2.162 +
   2.163 +     ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
   2.164 +                   "attributes-charset", NULL, cupsLangEncoding( language ) );
   2.165 +@@ -568,7 +608,7 @@ PyObject * addPrinter( PyObject * self,
   2.166 +     }
   2.167 +     else
   2.168 +     {
   2.169 +-        status = response->request.status.status_code;
   2.170 ++        status = ippGetStatusCode( response );
   2.171 +         //ippDelete( response );
   2.172 +         r = 1;
   2.173 +     }
   2.174 +@@ -631,8 +671,8 @@ PyObject * delPrinter( PyObject * self,
   2.175 +        */
   2.176 +     request = ippNew();
   2.177 +
   2.178 +-    request->request.op.operation_id = CUPS_DELETE_PRINTER;
   2.179 +-    request->request.op.request_id = 1;
   2.180 ++    ippSetOperation( request, CUPS_DELETE_PRINTER );
   2.181 ++    ippSetRequestId ( request, 1 );
   2.182 +
   2.183 +     language = cupsLangDefault();
   2.184 +
   2.185 +@@ -650,7 +690,7 @@ PyObject * delPrinter( PyObject * self,
   2.186 +      */
   2.187 +     response = cupsDoRequest( http, request, "/admin/" );
   2.188 +
   2.189 +-    if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) )
   2.190 ++    if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) )
   2.191 +     {
   2.192 +         r = 1;
   2.193 +     }
   2.194 +@@ -721,8 +761,8 @@ PyObject * setDefaultPrinter( PyObject *
   2.195 +
   2.196 +     request = ippNew();
   2.197 +
   2.198 +-    request->request.op.operation_id = CUPS_SET_DEFAULT;
   2.199 +-    request->request.op.request_id = 1;
   2.200 ++    ippSetOperation( request, CUPS_SET_DEFAULT );
   2.201 ++    ippSetRequestId ( request, 1 );
   2.202 +
   2.203 +     language = cupsLangDefault();
   2.204 +
   2.205 +@@ -743,7 +783,7 @@ PyObject * setDefaultPrinter( PyObject *
   2.206 +
   2.207 +     response = cupsDoRequest( http, request, "/admin/" );
   2.208 +
   2.209 +-    if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) )
   2.210 ++    if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) )
   2.211 +     {
   2.212 +         r = 1;
   2.213 +     }
   2.214 +@@ -797,8 +837,8 @@ PyObject * controlPrinter( PyObject * se
   2.215 +
   2.216 +     request = ippNew();
   2.217 +
   2.218 +-    request->request.op.operation_id = op;
   2.219 +-    request->request.op.request_id = 1;
   2.220 ++    ippSetOperation( request, op );
   2.221 ++    ippSetRequestId ( request, 1 );
   2.222 +
   2.223 +     language = cupsLangDefault();
   2.224 +
   2.225 +@@ -822,7 +862,7 @@ PyObject * controlPrinter( PyObject * se
   2.226 +
   2.227 +     response = cupsDoRequest(http, request, "/admin/");
   2.228 +
   2.229 +-    if (( response != NULL ) && (response->request.status.status_code <= IPP_OK_CONFLICT))
   2.230 ++    if (( response != NULL ) && (ippGetStatusCode( response ) <= IPP_OK_CONFLICT))
   2.231 +     {
   2.232 +         r = 1;
   2.233 +     }
   2.234 +@@ -837,7 +877,7 @@ abort:
   2.235 +     if ( response != NULL )
   2.236 +         ippDelete( response );
   2.237 +
   2.238 +-    return Py_BuildValue( "i", r );;
   2.239 ++    return Py_BuildValue( "i", r );
   2.240 + }
   2.241 +
   2.242 +
   2.243 +@@ -1116,8 +1156,8 @@ PyObject * getPPDList( PyObject * self,
   2.244 +
   2.245 +     request = ippNew();
   2.246 +
   2.247 +-    request->request.op.operation_id = CUPS_GET_PPDS;
   2.248 +-    request->request.op.request_id   = 1;
   2.249 ++    ippSetOperation( request, CUPS_GET_PPDS );
   2.250 ++    ippSetRequestId ( request, 1 );
   2.251 +
   2.252 +     language = cupsLangDefault();
   2.253 +
   2.254 +@@ -1143,43 +1183,43 @@ PyObject * getPPDList( PyObject * self,
   2.255 +     if ((response = cupsDoRequest(http, request, "/")) != NULL)
   2.256 +     {
   2.257 +
   2.258 +-        for (attr = response->attrs; attr; attr = attr->next)
   2.259 ++        for (attr = ippFirstAttribute( response ); attr; attr = ippNextAttribute( response ))
   2.260 +         {
   2.261 +             PyObject *dict;
   2.262 +             char *ppdname = NULL;
   2.263 +
   2.264 +-            while (attr && attr->group_tag != IPP_TAG_PRINTER)
   2.265 +-                attr = attr->next;
   2.266 ++            while (attr && ippGetGroupTag( attr ) != IPP_TAG_PRINTER)
   2.267 ++                attr = ippNextAttribute( response );
   2.268 +
   2.269 +             if (!attr)
   2.270 +                 break;
   2.271 +
   2.272 +             dict = PyDict_New ();
   2.273 +
   2.274 +-            for (; attr && attr->group_tag == IPP_TAG_PRINTER; attr = attr->next)
   2.275 ++            for (; attr && ippGetGroupTag( attr ) == IPP_TAG_PRINTER; attr = ippNextAttribute( response ))
   2.276 +             {
   2.277 +                 PyObject *val = NULL;
   2.278 +
   2.279 +-                if (!strcmp (attr->name, "ppd-name") && attr->value_tag == IPP_TAG_NAME)
   2.280 ++                if (!strcmp (ippGetName( attr ), "ppd-name") && ippGetValueTag( attr ) == IPP_TAG_NAME)
   2.281 +                 {
   2.282 +-                    ppdname = attr->values[0].string.text;
   2.283 ++                    ppdname = ippGetString( attr, 0, NULL );
   2.284 +
   2.285 +                     //sprintf( buf, "print '%s'", ppdname);
   2.286 +                     //PyRun_SimpleString( buf );
   2.287 +                 }
   2.288 +
   2.289 +-                else if (attr->value_tag == IPP_TAG_TEXT || attr->value_tag == IPP_TAG_NAME || attr->value_tag == IPP_TAG_KEYWORD)
   2.290 +-                //else if ((!strcmp (attr->name, "ppd-natural-language") && attr->value_tag == IPP_TAG_LANGUAGE) ||
   2.291 +-                //    (!strcmp (attr->name, "ppd-make-and-model") && attr->value_tag == IPP_TAG_TEXT) ||
   2.292 +-                //    (!strcmp (attr->name, "ppd-make") && attr->value_tag == IPP_TAG_TEXT) ||
   2.293 +-                //    (!strcmp (attr->name, "ppd-device-id") && attr->value_tag == IPP_TAG_TEXT))
   2.294 ++                else if (ippGetValueTag( attr ) == IPP_TAG_TEXT || ippGetValueTag( attr ) == IPP_TAG_NAME || ippGetValueTag( attr ) == IPP_TAG_KEYWORD)
   2.295 ++                //else if ((!strcmp (ippGetName( attr ), "ppd-natural-language") && ippGetValueTag( attr ) == IPP_TAG_LANGUAGE) ||
   2.296 ++                //    (!strcmp (ippGetName( attr ), "ppd-make-and-model") && ippGetValueTag( attr ) == IPP_TAG_TEXT) ||
   2.297 ++                //    (!strcmp (ippGetName( attr ), "ppd-make") && ippGetValueTag( attr ) == IPP_TAG_TEXT) ||
   2.298 ++                //    (!strcmp (ippGetName( attr ), "ppd-device-id") && ippGetValueTag( attr ) == IPP_TAG_TEXT))
   2.299 +                 {
   2.300 +-                    val = PyObj_from_UTF8(attr->values[0].string.text);
   2.301 ++                    val = PyObj_from_UTF8(ippGetString( attr, 0, NULL ));
   2.302 +                 }
   2.303 +
   2.304 +                 if (val)
   2.305 +                 {
   2.306 +-                    PyDict_SetItemString (dict, attr->name, val);
   2.307 ++                    PyDict_SetItemString (dict, ippGetName( attr ), val);
   2.308 +                     Py_DECREF (val);
   2.309 +                 }
   2.310 +             }
   2.311 +diff -up hplip-3.12.6/scan/sane/hpaio.c.ipp_accessors hplip-3.12.6/scan/sane/hpaio.c
   2.312 +--- hplip-3.12.6/scan/sane/hpaio.c.ipp_accessors	2012-06-18 12:42:51.000000000 +0200
   2.313 ++++ hplip-3.12.6/scan/sane/hpaio.c	2012-07-19 17:12:34.557848760 +0200
   2.314 +@@ -47,6 +47,43 @@
   2.315 + #define DEBUG_DECLARE_ONLY
   2.316 + #include "sanei_debug.h"
   2.317 +
   2.318 ++#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
   2.319 ++#define HAVE_CUPS_1_6 1
   2.320 ++#endif
   2.321 ++
   2.322 ++#ifndef HAVE_CUPS_1_6
   2.323 ++#define ippGetGroupTag(attr)  attr->group_tag
   2.324 ++#define ippGetValueTag(attr)  attr->value_tag
   2.325 ++#define ippGetName(attr)      attr->name
   2.326 ++#define ippGetString(attr, element, language) attr->values[element].string.text
   2.327 ++
   2.328 ++static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp )
   2.329 ++{
   2.330 ++    if (!ipp)
   2.331 ++        return (NULL);
   2.332 ++    return (ipp->current = ipp->attrs);
   2.333 ++}
   2.334 ++
   2.335 ++static ipp_attribute_t * ippNextAttribute( ipp_t *ipp )
   2.336 ++{
   2.337 ++    if (!ipp || !ipp->current)
   2.338 ++        return (NULL);
   2.339 ++    return (ipp->current = ipp->current->next);
   2.340 ++}
   2.341 ++
   2.342 ++static int ippSetOperation( ipp_t *ipp, ipp_op_t op )
   2.343 ++{
   2.344 ++    ipp->request.op.operation_id = op;
   2.345 ++    return (1);
   2.346 ++}
   2.347 ++
   2.348 ++static int ippSetRequestId( ipp_t *ipp, int request_id )
   2.349 ++{
   2.350 ++    ipp->request.any.request_id = request_id;
   2.351 ++    return (1);
   2.352 ++}
   2.353 ++#endif
   2.354 ++
   2.355 + static SANE_Device **DeviceList = NULL;
   2.356 +
   2.357 + static int AddDeviceList(char *uri, char *model, SANE_Device ***pd)
   2.358 +@@ -186,8 +223,8 @@ static int GetCupsPrinters(char ***print
   2.359 +    /* Assemble the IPP request */
   2.360 +    request = ippNew();
   2.361 +
   2.362 +-   request->request.op.operation_id = CUPS_GET_PRINTERS;
   2.363 +-   request->request.any.request_id  = 1;
   2.364 ++   ippSetOperation( request, CUPS_GET_PRINTERS );
   2.365 ++   ippSetRequestId( request, 1 );
   2.366 +
   2.367 +    ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8");
   2.368 +    ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, "en");
   2.369 +@@ -197,20 +234,20 @@ static int GetCupsPrinters(char ***print
   2.370 +    if ((response = cupsDoRequest(http, request, "/")) == NULL)
   2.371 +       goto bugout;
   2.372 +
   2.373 +-   for (attr = response->attrs; attr != NULL; attr = attr->next)
   2.374 ++   for (attr = ippFirstAttribute ( response ); attr != NULL; attr = ippNextAttribute( response ))
   2.375 +    {
   2.376 +       /* Skip leading attributes until we hit a printer. */
   2.377 +-      while (attr != NULL && attr->group_tag != IPP_TAG_PRINTER)
   2.378 +-         attr = attr->next;
   2.379 ++      while (attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER)
   2.380 ++         attr = ippNextAttribute( response );
   2.381 +
   2.382 +       if (attr == NULL)
   2.383 +          break;
   2.384 +
   2.385 +-      while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
   2.386 ++      while (attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER)
   2.387 +       {
   2.388 +-         if (strcmp(attr->name, "device-uri") == 0 && attr->value_tag == IPP_TAG_URI && AddCupsList(attr->values[0].string.text, printer) == 0)
   2.389 ++         if (strcmp(ippGetName( attr ), "device-uri") == 0 && ippGetValueTag( attr ) == IPP_TAG_URI && AddCupsList(ippGetString( attr, 0, NULL ), printer) == 0)
   2.390 +             cnt++;
   2.391 +-         attr = attr->next;
   2.392 ++         attr = ippNextAttribute( response );
   2.393 +       }
   2.394 +
   2.395 +       if (attr == NULL)
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/hplip/stuff/hplip-cups-1.5.0-compatibility.patch	Sat Jun 01 10:21:01 2013 +0000
     3.3 @@ -0,0 +1,9 @@
     3.4 +--- hplip-3.11.7~/prnt/hpps/hppsfilter.c	2011-07-24 18:58:05.000000000 +0000
     3.5 ++++ hplip-3.11.7/prnt/hpps/hppsfilter.c	2011-08-09 20:51:54.150214165 +0000
     3.6 +@@ -38,6 +38,7 @@
     3.7 + #include <unistd.h>
     3.8 + #include <fcntl.h>
     3.9 + #include <cups/cups.h>
    3.10 ++#include <cups/ppd.h>
    3.11 + #include <sys/types.h>
    3.12 + #include <sys/stat.h>