]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blob - pkgs/cups/patches/cups-serverbin-compat.patch
Change file layout of the makefiles.
[people/arne_f/ipfire-3.x.git] / pkgs / cups / patches / cups-serverbin-compat.patch
1 diff -up cups-1.4.4/scheduler/conf.c.serverbin-compat cups-1.4.4/scheduler/conf.c
2 --- cups-1.4.4/scheduler/conf.c.serverbin-compat 2010-04-23 19:56:34.000000000 +0100
3 +++ cups-1.4.4/scheduler/conf.c 2010-09-15 13:20:41.339960335 +0100
4 @@ -488,6 +488,9 @@ cupsdReadConfiguration(void)
5 cupsdClearString(&ServerName);
6 cupsdClearString(&ServerAdmin);
7 cupsdSetString(&ServerBin, CUPS_SERVERBIN);
8 +#ifdef __x86_64__
9 + cupsdSetString(&ServerBin_compat, "/usr/lib64/cups");
10 +#endif /* __x86_64__ */
11 cupsdSetString(&RequestRoot, CUPS_REQUESTS);
12 cupsdSetString(&CacheDir, CUPS_CACHEDIR);
13 cupsdSetString(&DataDir, CUPS_DATADIR);
14 @@ -1318,7 +1321,12 @@ cupsdReadConfiguration(void)
15 * Read the MIME type and conversion database...
16 */
17
18 +#ifdef __x86_64__
19 + snprintf(temp, sizeof(temp), "%s/filter:%s/filter", ServerBin,
20 + ServerBin_compat);
21 +#else
22 snprintf(temp, sizeof(temp), "%s/filter", ServerBin);
23 +#endif
24 snprintf(mimedir, sizeof(mimedir), "%s/mime", DataDir);
25
26 MimeDatabase = mimeLoadTypes(NULL, mimedir);
27 diff -up cups-1.4.4/scheduler/conf.h.serverbin-compat cups-1.4.4/scheduler/conf.h
28 --- cups-1.4.4/scheduler/conf.h.serverbin-compat 2010-04-23 19:56:34.000000000 +0100
29 +++ cups-1.4.4/scheduler/conf.h 2010-09-15 13:20:41.340959464 +0100
30 @@ -105,6 +105,10 @@ VAR char *ConfigurationFile VALUE(NULL)
31 /* Root directory for scheduler */
32 *ServerBin VALUE(NULL),
33 /* Root directory for binaries */
34 +#ifdef __x86_64__
35 + *ServerBin_compat VALUE(NULL),
36 + /* Compat directory for binaries */
37 +#endif /* __x86_64__ */
38 *StateDir VALUE(NULL),
39 /* Root directory for state data */
40 *RequestRoot VALUE(NULL),
41 diff -up cups-1.4.4/scheduler/env.c.serverbin-compat cups-1.4.4/scheduler/env.c
42 --- cups-1.4.4/scheduler/env.c.serverbin-compat 2009-06-15 18:13:52.000000000 +0100
43 +++ cups-1.4.4/scheduler/env.c 2010-09-15 13:20:41.341959587 +0100
44 @@ -87,8 +87,13 @@ cupsdInitEnv(void)
45 cupsdSetEnv("LD_LIBRARY_PATH", NULL);
46 cupsdSetEnv("LD_PRELOAD", NULL);
47 cupsdSetEnv("NLSPATH", NULL);
48 +#ifdef __x86_64__
49 + cupsdSetEnvf("PATH", "%s/filter:%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR
50 + ":/bin:/usr/bin", ServerBin, ServerBin_compat);
51 +#else /* ! defined(__x86_64__) */
52 cupsdSetEnvf("PATH", "%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR
53 ":/bin:/usr/bin", ServerBin);
54 +#endif
55 cupsdSetEnv("SERVER_ADMIN", ServerAdmin);
56 cupsdSetEnv("SHLIB_PATH", NULL);
57 cupsdSetEnv("SOFTWARE", CUPS_MINIMAL);
58 diff -up cups-1.4.4/scheduler/ipp.c.serverbin-compat cups-1.4.4/scheduler/ipp.c
59 --- cups-1.4.4/scheduler/ipp.c.serverbin-compat 2010-04-23 19:56:34.000000000 +0100
60 +++ cups-1.4.4/scheduler/ipp.c 2010-09-15 13:20:41.359835378 +0100
61 @@ -2615,9 +2615,18 @@ add_printer(cupsd_client_t *con, /* I -
62 * Could not find device in list!
63 */
64
65 +#ifdef __x86_64__
66 + snprintf(srcfile, sizeof(srcfile), "%s/backend/%s", ServerBin_compat,
67 + scheme);
68 + if (access(srcfile, X_OK))
69 + {
70 +#endif /* __x86_64__ */
71 send_ipp_status(con, IPP_NOT_POSSIBLE, _("Bad device-uri scheme \"%s\"!"),
72 scheme);
73 return;
74 +#ifdef __x86_64__
75 + }
76 +#endif /* __x86_64__ */
77 }
78 }
79
80 diff -up cups-1.4.4/scheduler/job.c.serverbin-compat cups-1.4.4/scheduler/job.c
81 --- cups-1.4.4/scheduler/job.c.serverbin-compat 2010-03-30 23:07:33.000000000 +0100
82 +++ cups-1.4.4/scheduler/job.c 2010-09-15 13:20:41.366836134 +0100
83 @@ -972,8 +972,32 @@ cupsdContinueJob(cupsd_job_t *job) /* I
84 i ++, filter = (mime_filter_t *)cupsArrayNext(filters))
85 {
86 if (filter->filter[0] != '/')
87 - snprintf(command, sizeof(command), "%s/filter/%s", ServerBin,
88 - filter->filter);
89 + {
90 + snprintf(command, sizeof(command), "%s/filter/%s", ServerBin,
91 + filter->filter);
92 +#ifdef __x86_64__
93 + if (access(command, F_OK))
94 + {
95 + snprintf(command, sizeof(command), "%s/filter/%s",
96 + ServerBin_compat, filter->filter);
97 + if (!access(command, F_OK))
98 + {
99 + /* Not in the correct directory, but found it in the compat
100 + * directory. Issue a warning. */
101 + cupsdLogMessage(CUPSD_LOG_INFO,
102 + "Filter '%s' not in %s/filter!",
103 + filter->filter, ServerBin);
104 + }
105 + else
106 + {
107 + /* Not in the compat directory either; make any error
108 + * messages use the correct directory name then. */
109 + snprintf(command, sizeof(command), "%s/filter/%s", ServerBin,
110 + filter->filter);
111 + }
112 + }
113 +#endif /* __x86_64__ */
114 + }
115 else
116 strlcpy(command, filter->filter, sizeof(command));
117
118 @@ -1119,6 +1143,28 @@ cupsdContinueJob(cupsd_job_t *job) /* I
119 cupsdClosePipe(job->print_pipes);
120 cupsdClosePipe(job->back_pipes);
121 cupsdClosePipe(job->side_pipes);
122 +#ifdef __x86_64__
123 + if (access(command, F_OK))
124 + {
125 + snprintf(command, sizeof(command), "%s/backend/%s", ServerBin_compat,
126 + method);
127 + if (!access(command, F_OK))
128 + {
129 + /* Not in the correct directory, but we found it in the compat
130 + * directory. Issue a warning. */
131 + cupsdLogMessage(CUPSD_LOG_INFO,
132 + "Backend '%s' not in %s/backend!", method,
133 + ServerBin);
134 + }
135 + else
136 + {
137 + /* Not in the compat directory either; make any error
138 + messages use the correct directory name then. */
139 + snprintf(command, sizeof(command), "%s/backend/%s", ServerBin,
140 + method);
141 + }
142 + }
143 +#endif /* __x86_64__ */
144
145 close(job->status_pipes[1]);
146 job->status_pipes[1] = -1;
147 diff -up cups-1.4.4/scheduler/printers.c.serverbin-compat cups-1.4.4/scheduler/printers.c
148 --- cups-1.4.4/scheduler/printers.c.serverbin-compat 2010-04-23 21:53:38.000000000 +0100
149 +++ cups-1.4.4/scheduler/printers.c 2010-09-15 13:21:39.627960657 +0100
150 @@ -1059,9 +1059,19 @@ cupsdLoadAllPrinters(void)
151 * Backend does not exist, stop printer...
152 */
153
154 +#ifdef __x86_64__
155 + snprintf(line, sizeof(line), "%s/backend/%s", ServerBin_compat,
156 + p->device_uri);
157 + if (access(line, 0))
158 + {
159 +#endif /* __x86_64__ */
160 +
161 p->state = IPP_PRINTER_STOPPED;
162 snprintf(p->state_message, sizeof(p->state_message),
163 "Backend %s does not exist!", line);
164 +#ifdef __x86_64__
165 + }
166 +#endif /* __x86_64__ */
167 }
168 }
169
170 @@ -3603,6 +3613,14 @@ add_printer_filter(
171
172 if (stat(filename, &fileinfo))
173 {
174 +#ifdef __x86_64__
175 + snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin_compat,
176 + program);
177 + if (stat(filename, &fileinfo))
178 + {
179 + snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin,
180 + program);
181 +#endif /* __x86_64__ */
182 memset(&fileinfo, 0, sizeof(fileinfo));
183
184 snprintf(p->state_message, sizeof(p->state_message),
185 @@ -3611,6 +3629,9 @@ add_printer_filter(
186 cupsdSetPrinterReasons(p, "+cups-missing-filter-warning");
187
188 cupsdLogMessage(CUPSD_LOG_ERROR, "%s", p->state_message);
189 +#ifdef __x86_64__
190 + }
191 +#endif /* __x86_64__ */
192 }
193
194 /*