427ab21
--- cups-1.2.1/scheduler/ipp.c.serverbin-compat	2006-06-07 11:47:18.000000000 +0100
427ab21
+++ cups-1.2.1/scheduler/ipp.c	2006-06-07 11:50:06.000000000 +0100
427ab21
@@ -2209,9 +2209,18 @@
427ab21
         * Could not find device in list!
427ab21
 	*/
427ab21
 
427ab21
+#ifdef __x86_64__
427ab21
+       snprintf(srcfile, sizeof(srcfile), "%s/backend/%s", ServerBin_compat,
50551d0
+		 scheme);
427ab21
+	if (access(srcfile, X_OK))
427ab21
+	  {
427ab21
+#endif /* __x86_64__ */
427ab21
 	send_ipp_status(con, IPP_NOT_POSSIBLE, _("Bad device-uri \"%s\"!"),
427ab21
         	        attr->values[0].string.text);
427ab21
 	return;
427ab21
+#ifdef __x86_64__
427ab21
+	  }
427ab21
+#endif /* __x86_64__ */
427ab21
       }
427ab21
     }
427ab21
 
427ab21
--- cups-1.2.1/scheduler/printers.c.serverbin-compat	2006-06-07 12:21:59.000000000 +0100
427ab21
+++ cups-1.2.1/scheduler/printers.c	2006-06-07 12:26:44.000000000 +0100
427ab21
@@ -902,9 +902,19 @@
427ab21
 	    * Backend does not exist, stop printer...
427ab21
 	    */
427ab21
 
427ab21
+#ifdef __x86_64__
427ab21
+	    snprintf(line, sizeof(line), "%s/backend/%s", ServerBin_compat,
427ab21
+		     p->device_uri);
427ab21
+	    if (access(line, F_OK))
427ab21
+	      {
427ab21
+#endif /* __x86_64__ */
427ab21
+
427ab21
 	    p->state = IPP_PRINTER_STOPPED;
427ab21
 	    snprintf(p->state_message, sizeof(p->state_message),
427ab21
 	             "Backend %s does not exist!", line);
427ab21
+#ifdef __x86_64__
427ab21
+	      }
427ab21
+#endif /* __x86_64__ */
427ab21
 	  }
427ab21
         }
427ab21
 
427ab21
@@ -2838,6 +2848,12 @@
427ab21
 
427ab21
     if (access(filename, X_OK))
427ab21
     {
427ab21
+#ifdef __x86_64__
427ab21
+      snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin_compat,
427ab21
+	       program);
427ab21
+      if (access(filename, X_OK))
427ab21
+	{
427ab21
+#endif /* __x86_64__ */
427ab21
       snprintf(p->state_message, sizeof(p->state_message),
427ab21
                "Filter \"%s\" for printer \"%s\" not available: %s",
427ab21
 	       program, p->name, strerror(errno));
427ab21
@@ -2846,6 +2862,9 @@
427ab21
       cupsdAddPrinterHistory(p);
427ab21
 
427ab21
       cupsdLogMessage(CUPSD_LOG_ERROR, "%s", p->state_message);
427ab21
+#ifdef __x86_64__
427ab21
+	}
427ab21
+#endif /* __x86_64__ */
427ab21
     }
427ab21
   }
427ab21
 
427ab21
--- cups-1.2.1/scheduler/conf.h.serverbin-compat	2006-06-07 11:38:05.000000000 +0100
427ab21
+++ cups-1.2.1/scheduler/conf.h	2006-06-07 11:39:41.000000000 +0100
427ab21
@@ -68,6 +68,10 @@
427ab21
 					/* Root directory for scheduler */
427ab21
 			*ServerBin		VALUE(NULL),
427ab21
 					/* Root directory for binaries */
427ab21
+#ifdef __x86_64__
427ab21
+			*ServerBin_compat	VALUE(NULL),
427ab21
+					/* Compat directory for binaries */
427ab21
+#endif /* __x86_64__ */
427ab21
 			*StateDir		VALUE(NULL),
427ab21
 					/* Root directory for state data */
427ab21
 			*RequestRoot		VALUE(NULL),
427ab21
--- cups-1.2.1/scheduler/job.c.serverbin-compat	2006-06-07 11:50:31.000000000 +0100
427ab21
+++ cups-1.2.1/scheduler/job.c	2006-06-07 12:21:48.000000000 +0100
427ab21
@@ -3117,8 +3117,32 @@
427ab21
        i ++, filter = (mime_filter_t *)cupsArrayNext(filters))
427ab21
   {
427ab21
     if (filter->filter[0] != '/')
427ab21
-      snprintf(command, sizeof(command), "%s/filter/%s", ServerBin,
427ab21
-               filter->filter);
427ab21
+      {
427ab21
+	snprintf(command, sizeof(command), "%s/filter/%s", ServerBin,
427ab21
+		 filter->filter);
427ab21
+#ifdef __x86_64__
427ab21
+	if (access(command, F_OK))
427ab21
+	  {
427ab21
+	    snprintf(command, sizeof(command), "%s/filter/%s",
427ab21
+		     ServerBin_compat, filter->filter);
427ab21
+	    if (!access(command, F_OK))
427ab21
+	      {
427ab21
+		/* Not in the correct directory, but found it in the compat
427ab21
+		 * directory.  Issue a warning. */
427ab21
+		cupsdLogMessage(CUPSD_LOG_INFO,
427ab21
+				"Filter '%s' not in %s/filter!",
427ab21
+				filter->filter, ServerBin);
427ab21
+	      }
427ab21
+	    else
427ab21
+	      {
427ab21
+		/* Not in the compat directory either; make any error
427ab21
+		 * messages use the correct directory name then. */
427ab21
+		snprintf(command, sizeof(command), "%s/filter/%s", ServerBin,
427ab21
+			 filter->filter);
427ab21
+	      }
427ab21
+	  }
427ab21
+#endif /* __x86_64__ */
a7da931
+      }
427ab21
     else
427ab21
       strlcpy(command, filter->filter, sizeof(command));
427ab21
 
427ab21
@@ -3259,6 +3283,28 @@
427ab21
     {
427ab21
       sscanf(printer->device_uri, "%254[^:]", method);
427ab21
       snprintf(command, sizeof(command), "%s/backend/%s", ServerBin, method);
427ab21
+#ifdef __x86_64__
427ab21
+      if (access(command, F_OK))
427ab21
+	{
427ab21
+	  snprintf(command, sizeof(command), "%s/backend/%s", ServerBin_compat,
427ab21
+		   method);
427ab21
+	  if (!access(command, F_OK))
427ab21
+	    {
427ab21
+	      /* Not in the correct directory, but we found it in the compat
427ab21
+	       * directory.  Issue a warning. */
427ab21
+	      cupsdLogMessage(CUPSD_LOG_INFO,
427ab21
+			      "Backend '%s' not in %s/backend!", method,
427ab21
+			      ServerBin);
427ab21
+	    }
427ab21
+	  else
427ab21
+	    {
427ab21
+	      /* Not in the compat directory either; make any error
427ab21
+		 messages use the correct directory name then. */
427ab21
+	      snprintf(command, sizeof(command), "%s/backend/%s", ServerBin,
427ab21
+		       method);
427ab21
+	    }
427ab21
+	}
427ab21
+#endif /* __x86_64__ */
427ab21
 
427ab21
      /*
427ab21
       * See if the backend needs to run as root...
427ab21
--- cups-1.2.1/scheduler/env.c.serverbin-compat	2006-06-07 11:45:26.000000000 +0100
427ab21
+++ cups-1.2.1/scheduler/env.c	2006-06-07 11:46:55.000000000 +0100
427ab21
@@ -95,8 +95,13 @@
427ab21
   cupsdSetEnv("LD_LIBRARY_PATH", NULL);
427ab21
   cupsdSetEnv("LD_PRELOAD", NULL);
427ab21
   cupsdSetEnv("NLSPATH", NULL);
427ab21
+#ifdef __x86_64__
427ab21
+  cupsdSetEnvf("PATH", "%s/filter:%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR
427ab21
+                       ":/bin:/usr/bin", ServerBin, ServerBin_compat);
427ab21
+#else /* ! defined(__x86_64__) */
427ab21
   cupsdSetEnvf("PATH", "%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR
427ab21
                        ":/bin:/usr/bin", ServerBin);
427ab21
+#endif
427ab21
   cupsdSetEnv("SERVER_ADMIN", ServerAdmin);
427ab21
   cupsdSetEnv("SHLIB_PATH", NULL);
427ab21
   cupsdSetEnv("SOFTWARE", CUPS_MINIMAL);
427ab21
--- cups-1.2.1/scheduler/conf.c.serverbin-compat	2006-06-07 11:38:24.000000000 +0100
427ab21
+++ cups-1.2.1/scheduler/conf.c	2006-06-07 11:42:49.000000000 +0100
427ab21
@@ -275,6 +275,9 @@
427ab21
   cupsdSetString(&ServerName, httpGetHostname(NULL, temp, sizeof(temp)));
427ab21
   cupsdSetStringf(&ServerAdmin, "root@%s", temp);
427ab21
   cupsdSetString(&ServerBin, CUPS_SERVERBIN);
427ab21
+#ifdef __x86_64__
427ab21
+  cupsdSetString(&ServerBin_compat, "/usr/lib64/cups");
427ab21
+#endif /* __x86_64__ */
427ab21
   cupsdSetString(&RequestRoot, CUPS_REQUESTS);
427ab21
   cupsdSetString(&CacheDir, CUPS_CACHEDIR);
427ab21
   cupsdSetString(&DataDir, CUPS_DATADIR);
427ab21
@@ -954,7 +957,12 @@
427ab21
     * Read the MIME type and conversion database...
427ab21
     */
427ab21
 
427ab21
+#ifdef __x86_64__
427ab21
+    snprintf(temp, sizeof(temp), "%s/filter:%s/filter", ServerBin,
427ab21
+	     ServerBin_compat);
427ab21
+#else /* ! defined(__x86_64__) */
427ab21
     snprintf(temp, sizeof(temp), "%s/filter", ServerBin);
427ab21
+#endif
427ab21
 
427ab21
     MimeDatabase = mimeLoad(ServerRoot, temp);
427ab21