1 |
Description: Add-on to cups-avahi.patch to support Apple AirPrint (printing from iPhone, iPad, iPod Touch to a CUPS server), patch is separate as this part is not in the upstream repository of cups-avahi.patch because it is not intencded to be submitted to CUPS upstream. |
2 |
Author: Till Kamppeter <till.kamppeter@gmail.com> |
3 |
Bug: https://bugs.launchpad.net/bugs/711779 |
4 |
|
5 |
|
6 |
diff -Naurp cups-1.5.4/conf/mime.convs.in cups-1.5.4.oden/conf/mime.convs.in |
7 |
--- cups-1.5.4/conf/mime.convs.in 2011-05-07 00:53:53.000000000 +0200 |
8 |
+++ cups-1.5.4.oden/conf/mime.convs.in 2012-12-28 12:47:46.294421925 +0100 |
9 |
@@ -86,6 +86,9 @@ application/postscript application/vnd. |
10 |
# PWG Raster filter for IPP Everywhere... |
11 |
application/vnd.cups-raster image/pwg-raster 100 rastertopwg |
12 |
|
13 |
+# Needed for printing from iOS (AirPrint) clients |
14 |
+image/urf application/pdf 100 - |
15 |
+ |
16 |
######################################################################## |
17 |
# |
18 |
# Raw filter... |
19 |
diff -Naurp cups-1.5.4/conf/mime.types cups-1.5.4.oden/conf/mime.types |
20 |
--- cups-1.5.4/conf/mime.types 2011-08-06 08:34:46.000000000 +0200 |
21 |
+++ cups-1.5.4.oden/conf/mime.types 2012-12-28 12:47:46.294421925 +0100 |
22 |
@@ -110,6 +110,9 @@ image/x-alias pix short(8,8) short(8,2 |
23 |
image/x-bitmap bmp string(0,BM) + !printable(2,14) |
24 |
image/x-icon ico |
25 |
|
26 |
+# Needed for printing from iOS (AirPrint) clients |
27 |
+image/urf urf string(0,UNIRAST<00>) |
28 |
+ |
29 |
######################################################################## |
30 |
# |
31 |
# Text files... |
32 |
diff -Naurp cups-1.5.4/scheduler/conf.c cups-1.5.4.oden/scheduler/conf.c |
33 |
--- cups-1.5.4/scheduler/conf.c 2012-12-28 12:47:26.910270977 +0100 |
34 |
+++ cups-1.5.4.oden/scheduler/conf.c 2012-12-28 12:47:46.290421883 +0100 |
35 |
@@ -660,7 +660,7 @@ cupsdReadConfiguration(void) |
36 |
DefaultShared = CUPS_DEFAULT_DEFAULT_SHARED; |
37 |
|
38 |
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) |
39 |
- cupsdSetString(&DNSSDRegType, "_ipp._tcp,_cups"); |
40 |
+ cupsdSetString(&DNSSDRegType, "_ipp._tcp,_cups,_universal"); |
41 |
#endif /* HAVE_DNSSD */ |
42 |
|
43 |
cupsdSetString(&LPDConfigFile, CUPS_DEFAULT_LPD_CONFIG_FILE); |
44 |
diff -Naurp cups-1.5.4/scheduler/dirsvc.c cups-1.5.4.oden/scheduler/dirsvc.c |
45 |
--- cups-1.5.4/scheduler/dirsvc.c 2012-12-28 12:47:26.877270719 +0100 |
46 |
+++ cups-1.5.4.oden/scheduler/dirsvc.c 2012-12-28 12:47:46.293421915 +0100 |
47 |
@@ -2530,6 +2530,12 @@ dnssdBuildTxtRecord( |
48 |
keyvalue[i ][0] = "pdl"; |
49 |
keyvalue[i++][1] = p->pdl ? p->pdl : "application/postscript"; |
50 |
|
51 |
+ /* iOS 6 does not accept this printer as AirPrint printer if there is |
52 |
+ no URF txt record or "URF=none", "DM3" is the minimum needed found |
53 |
+ by try and error */ |
54 |
+ keyvalue[i ][0] = "URF"; |
55 |
+ keyvalue[i++][1] = "DM3"; |
56 |
+ |
57 |
if (get_auth_info_required(p, air_str, sizeof(air_str))) |
58 |
{ |
59 |
keyvalue[i ][0] = "air"; |
60 |
diff -Naurp cups-1.5.4/scheduler/printers.c cups-1.5.4.oden/scheduler/printers.c |
61 |
--- cups-1.5.4/scheduler/printers.c 2012-12-28 12:47:26.868270650 +0100 |
62 |
+++ cups-1.5.4.oden/scheduler/printers.c 2012-12-28 12:47:46.298421949 +0100 |
63 |
@@ -3930,7 +3930,9 @@ add_printer_formats(cupsd_printer_t *p) |
64 |
} |
65 |
else if (!_cups_strcasecmp(type->super, "image")) |
66 |
{ |
67 |
- if (!_cups_strcasecmp(type->type, "jpeg")) |
68 |
+ if (!_cups_strcasecmp(type->type, "urf")) |
69 |
+ strlcat(pdl, "image/urf,", sizeof(pdl)); |
70 |
+ else if (!_cups_strcasecmp(type->type, "jpeg")) |
71 |
strlcat(pdl, "image/jpeg,", sizeof(pdl)); |
72 |
else if (!_cups_strcasecmp(type->type, "png")) |
73 |
strlcat(pdl, "image/png,", sizeof(pdl)); |