diff -Nru ati.old/check.sh ati/check.sh
--- ati.old/check.sh	2007-10-03 16:05:21.000000000 +0200
+++ ati/check.sh	2007-10-06 06:54:39.000000000 +0200
@@ -117,7 +117,7 @@
         if [ -z "${X_VERSION}" ]
         then
             #XFree86 has not been detected, try to detect Xorg
-            x_ver_num=`${x_bin} -version 2>&1 | grep 'X Window System Version [0-9]\.' | sed -e 's/^.*X Window System Version //' | cut -d' ' -f1`
+            x_ver_num=`${x_bin} -version 2>&1 | grep -E '(X Window System Version|X.Org X Server) [0-9]\.' | sed -e 's/^.*X Window System Version //;s/^.*X.Org X Server //' | cut -d' ' -f1`
 
             if [ "$x_ver_num" ]
             then
diff -Nru ati.old/packages/Debian/dists/etch/rules ati/packages/Debian/dists/etch/rules
--- ati.old/packages/Debian/dists/etch/rules	2007-10-03 16:05:23.000000000 +0200
+++ ati/packages/Debian/dists/etch/rules	2007-10-06 06:54:47.000000000 +0200
@@ -29,7 +29,7 @@
 # If you want to build for a specific implementation, set XTYPE accordingly.
 # Examples: XTYPE=XFree86, XTYPE=X.Org
 ifeq (,$(XTYPE))
-	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f1)
+	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f1)
 endif
 ifeq (,$(XSERVER))
 	ifeq ($(XTYPE),XFree86)
diff -Nru ati.old/packages/Debian/dists/experimental/rules ati/packages/Debian/dists/experimental/rules
--- ati.old/packages/Debian/dists/experimental/rules	2007-10-03 16:05:23.000000000 +0200
+++ ati/packages/Debian/dists/experimental/rules	2007-10-06 06:54:47.000000000 +0200
@@ -29,7 +29,7 @@
 # If you want to build for a specific implementation, set XTYPE accordingly.
 # Examples: XTYPE=XFree86, XTYPE=X.Org
 ifeq (,$(XTYPE))
-	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f1)
+	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f1)
 endif
 ifeq (,$(XSERVER))
 	ifeq ($(XTYPE),XFree86)
diff -Nru ati.old/packages/Debian/dists/lenny/rules ati/packages/Debian/dists/lenny/rules
--- ati.old/packages/Debian/dists/lenny/rules	2007-10-03 16:05:23.000000000 +0200
+++ ati/packages/Debian/dists/lenny/rules	2007-10-06 06:54:47.000000000 +0200
@@ -29,7 +29,7 @@
 # If you want to build for a specific implementation, set XTYPE accordingly.
 # Examples: XTYPE=XFree86, XTYPE=X.Org
 ifeq (,$(XTYPE))
-	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f1)
+	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f1)
 endif
 ifeq (,$(XSERVER))
 	ifeq ($(XTYPE),XFree86)
diff -Nru ati.old/packages/Debian/dists/sarge/rules ati/packages/Debian/dists/sarge/rules
--- ati.old/packages/Debian/dists/sarge/rules	2007-10-03 16:05:23.000000000 +0200
+++ ati/packages/Debian/dists/sarge/rules	2007-10-06 06:54:47.000000000 +0200
@@ -29,7 +29,7 @@
 # If you want to build for a specific implementation, set XTYPE accordingly.
 # Examples: XTYPE=XFree86, XTYPE=X.Org
 ifeq (,$(XTYPE))
-	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f1)
+	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f1)
 endif
 ifeq (,$(XSERVER))
 	ifeq ($(XTYPE),XFree86)
@@ -44,7 +44,7 @@
 # If you want to build for a specific version, set XVERSION accordingly.
 # Example: XVERSION=4.2.0
 ifeq (,$(XVERSION))
-	XVERSION := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f3 | cut -d. -f1-3)
+	XVERSION := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f3 | cut -d. -f1-3)
 	ifeq ($(XVERSION),4.2.1)
 		# There ain't no driver for 4.2.1, set to 4.2.0
 		XVERSION := 4.2.0
diff -Nru ati.old/packages/Debian/dists/sid/rules ati/packages/Debian/dists/sid/rules
--- ati.old/packages/Debian/dists/sid/rules	2007-10-03 16:05:23.000000000 +0200
+++ ati/packages/Debian/dists/sid/rules	2007-10-06 06:54:47.000000000 +0200
@@ -29,7 +29,7 @@
 # If you want to build for a specific implementation, set XTYPE accordingly.
 # Examples: XTYPE=XFree86, XTYPE=X.Org
 ifeq (,$(XTYPE))
-	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f1)
+	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f1)
 endif
 ifeq (,$(XSERVER))
 	ifeq ($(XTYPE),XFree86)
diff -Nru ati.old/packages/Ubuntu/dists/breezy/rules ati/packages/Ubuntu/dists/breezy/rules
--- ati.old/packages/Ubuntu/dists/breezy/rules	2007-10-03 16:05:23.000000000 +0200
+++ ati/packages/Ubuntu/dists/breezy/rules	2007-10-06 06:54:39.000000000 +0200
@@ -29,7 +29,7 @@
 # If you want to build for a specific implementation, set XTYPE accordingly.
 # Examples: XTYPE=XFree86, XTYPE=X.Org
 ifeq (,$(XTYPE))
-	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f1)
+	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f1)
 endif
 ifeq (,$(XSERVER))
 	ifeq ($(XTYPE),XFree86)
@@ -44,7 +44,7 @@
 # If you want to build for a specific version, set XVERSION accordingly.
 # Example: XVERSION=4.2.0
 ifeq (,$(XVERSION))
-	XVERSION := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f3 | cut -d. -f1-3)
+	XVERSION := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f3 | cut -d. -f1-3)
 	ifeq ($(XVERSION),4.2.1)
 		# There ain't no driver for 4.2.1, set to 4.2.0
 		XVERSION := 4.2.0
diff -Nru ati.old/packages/Ubuntu/dists/dapper/rules ati/packages/Ubuntu/dists/dapper/rules
--- ati.old/packages/Ubuntu/dists/dapper/rules	2007-10-03 16:05:23.000000000 +0200
+++ ati/packages/Ubuntu/dists/dapper/rules	2007-10-06 06:54:39.000000000 +0200
@@ -29,7 +29,7 @@
 # If you want to build for a specific implementation, set XTYPE accordingly.
 # Examples: XTYPE=XFree86, XTYPE=X.Org
 ifeq (,$(XTYPE))
-	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f1)
+	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f1)
 endif
 ifeq (,$(XSERVER))
 	ifeq ($(XTYPE),XFree86)
@@ -44,7 +44,7 @@
 # If you want to build for a specific version, set XVERSION accordingly.
 # Example: XVERSION=4.2.0
 ifeq (,$(XVERSION))
-	XVERSION := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f3 | cut -d. -f1-3)
+	XVERSION := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f3 | cut -d. -f1-3)
 	ifeq ($(XVERSION),4.2.1)
 		# There ain't no driver for 4.2.1, set to 4.2.0
 		XVERSION := 4.2.0
diff -Nru ati.old/packages/Ubuntu/dists/edgy/rules ati/packages/Ubuntu/dists/edgy/rules
--- ati.old/packages/Ubuntu/dists/edgy/rules	2007-10-03 16:05:23.000000000 +0200
+++ ati/packages/Ubuntu/dists/edgy/rules	2007-10-06 06:54:39.000000000 +0200
@@ -29,7 +29,7 @@
 # If you want to build for a specific implementation, set XTYPE accordingly.
 # Examples: XTYPE=XFree86, XTYPE=X.Org
 ifeq (,$(XTYPE))
-	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f1)
+	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f1)
 endif
 ifeq (,$(XSERVER))
 	ifeq ($(XTYPE),XFree86)
@@ -44,7 +44,7 @@
 # If you want to build for a specific version, set XVERSION accordingly.
 # Example: XVERSION=4.2.0
 ifeq (,$(XVERSION))
-	XVERSION := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f3 | cut -d. -f1-3)
+	XVERSION := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f3 | cut -d. -f1-3)
 	ifeq ($(XVERSION),4.2.1)
 		# There ain't no driver for 4.2.1, set to 4.2.0
 		XVERSION := 4.2.0
diff -Nru ati.old/packages/Ubuntu/dists/feisty/rules ati/packages/Ubuntu/dists/feisty/rules
--- ati.old/packages/Ubuntu/dists/feisty/rules	2007-10-03 16:05:23.000000000 +0200
+++ ati/packages/Ubuntu/dists/feisty/rules	2007-10-06 06:54:39.000000000 +0200
@@ -29,7 +29,7 @@
 # If you want to build for a specific implementation, set XTYPE accordingly.
 # Examples: XTYPE=XFree86, XTYPE=X.Org
 ifeq (,$(XTYPE))
-	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f1)
+	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f1)
 endif
 ifeq (,$(XSERVER))
 	ifeq ($(XTYPE),XFree86)
@@ -44,7 +44,7 @@
 # If you want to build for a specific version, set XVERSION accordingly.
 # Example: XVERSION=4.2.0
 ifeq (,$(XVERSION))
-	XVERSION := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f3 | cut -d. -f1-3)
+	XVERSION := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f3 | cut -d. -f1-3)
 	ifeq ($(XVERSION),4.2.1)
 		# There ain't no driver for 4.2.1, set to 4.2.0
 		XVERSION := 4.2.0
diff -Nru ati.old/packages/Ubuntu/dists/gutsy/rules ati/packages/Ubuntu/dists/gutsy/rules
--- ati.old/packages/Ubuntu/dists/gutsy/rules	2007-10-03 16:05:23.000000000 +0200
+++ ati/packages/Ubuntu/dists/gutsy/rules	2007-10-06 06:54:39.000000000 +0200
@@ -29,7 +29,7 @@
 # If you want to build for a specific implementation, set XTYPE accordingly.
 # Examples: XTYPE=XFree86, XTYPE=X.Org
 ifeq (,$(XTYPE))
-	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f1)
+	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f1)
 endif
 ifeq (,$(XSERVER))
 	ifeq ($(XTYPE),XFree86)
@@ -44,7 +44,7 @@
 # If you want to build for a specific version, set XVERSION accordingly.
 # Example: XVERSION=4.2.0
 ifeq (,$(XVERSION))
-	XVERSION := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f3 | cut -d. -f1-3)
+	XVERSION := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f3 | cut -d. -f1-3)
 	ifeq ($(XVERSION),4.2.1)
 		# There ain't no driver for 4.2.1, set to 4.2.0
 		XVERSION := 4.2.0
diff -Nru ati.old/packages/Ubuntu/dists/hoary/rules ati/packages/Ubuntu/dists/hoary/rules
--- ati.old/packages/Ubuntu/dists/hoary/rules	2007-10-03 16:05:23.000000000 +0200
+++ ati/packages/Ubuntu/dists/hoary/rules	2007-10-06 06:54:39.000000000 +0200
@@ -29,7 +29,7 @@
 # If you want to build for a specific implementation, set XTYPE accordingly.
 # Examples: XTYPE=XFree86, XTYPE=X.Org
 ifeq (,$(XTYPE))
-	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f1)
+	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f1)
 endif
 ifeq (,$(XSERVER))
 	ifeq ($(XTYPE),XFree86)
@@ -44,7 +44,7 @@
 # If you want to build for a specific version, set XVERSION accordingly.
 # Example: XVERSION=4.2.0
 ifeq (,$(XVERSION))
-	XVERSION := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f3 | cut -d. -f1-3)
+	XVERSION := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f3 | cut -d. -f1-3)
 	ifeq ($(XVERSION),4.2.1)
 		# There ain't no driver for 4.2.1, set to 4.2.0
 		XVERSION := 4.2.0
diff -Nru ati.old/packages/Ubuntu/dists/warty/rules ati/packages/Ubuntu/dists/warty/rules
--- ati.old/packages/Ubuntu/dists/warty/rules	2007-10-03 16:05:23.000000000 +0200
+++ ati/packages/Ubuntu/dists/warty/rules	2007-10-06 06:54:39.000000000 +0200
@@ -29,7 +29,7 @@
 # If you want to build for a specific implementation, set XTYPE accordingly.
 # Examples: XTYPE=XFree86, XTYPE=X.Org
 ifeq (,$(XTYPE))
-	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f1)
+	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f1)
 endif
 ifeq (,$(XSERVER))
 	ifeq ($(XTYPE),XFree86)
@@ -44,7 +44,7 @@
 # If you want to build for a specific version, set XVERSION accordingly.
 # Example: XVERSION=4.2.0
 ifeq (,$(XVERSION))
-	XVERSION := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f3 | cut -d. -f1-3)
+	XVERSION := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f3 | cut -d. -f1-3)
 	ifeq ($(XVERSION),4.2.1)
 		# There ain't no driver for 4.2.1, set to 4.2.0
 		XVERSION := 4.2.0
diff -Nru ati.old/packages/Ubuntu/module/rules ati/packages/Ubuntu/module/rules
--- ati.old/packages/Ubuntu/module/rules	2007-10-03 16:05:23.000000000 +0200
+++ ati/packages/Ubuntu/module/rules	2007-10-06 06:54:39.000000000 +0200
@@ -9,7 +9,7 @@
 # If you want to build for a specific implementation, set XTYPE accordingly.
 # Examples: XTYPE=XFree86, XTYPE=X.Org
 ifeq (,$(XTYPE))
-	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System) Version " | sed -e "s/^X Window System /X.Org /" | cut -d' ' -f1)
+	XTYPE := $(shell X -version 2>&1 | grep -E "^(XFree86|X Window System|X.Org X) (Version|Server) " | sed -e "s/^X Window System /X.Org /;s/Server //" | cut -d' ' -f1)
 endif
 ifeq (,$(XSERVER))
 	ifeq ($(XTYPE),XFree86)
