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