Index: Portfile
===================================================================
--- Portfile	(revision 28490)
+++ Portfile	(working copy)
@@ -2,7 +2,7 @@
 
 PortSystem          1.0
 
-name                mysql5
+name                mysql5-client
 version             5.0.45
 homepage            http://www.mysql.com/
 categories          databases
@@ -11,11 +11,13 @@
 distname            mysql-${version}
 
 description \
-	Multithreaded SQL database server
+	The world's most popular open-source database
 
 long_description \
-	MySQL is an open-source, multi-threaded SQL database \
-	with a command syntax very similar to mSQL.
+	MySQL is the world's most popular open-source database. This port \
+	installs the client libraries and binaries for connecting to an \
+	existing MySQL server. If you want to run your own server, see \
+	mysql5-server.
 
 master_sites \
 	http://mysql.mirrors.pair.com/Downloads/MySQL-5.0/ \
@@ -38,22 +40,26 @@
 patchfiles \
 	patch-mysys-base64.c.diff
 
-set dbdir           ${prefix}/var/db/${name}
+set major_version   5
+set mysql           mysql${major_version}
+set dbdir           ${prefix}/var/db/${mysql}
 set mysqluser       mysql
 
+dist_subdir         ${mysql}
+
 configure.args \
 	--mandir=${prefix}/share/man \
 	--infodir=${prefix}/share/info \
 	--localstatedir=${dbdir} \
-	--libdir=${prefix}/lib/${name} \
-	--bindir=${prefix}/lib/${name}/bin \
-	--includedir=${prefix}/include/${name} \
-	--datadir=${prefix}/share/${name} \
-	--sysconfdir=${prefix}/etc/${name} \
+	--libdir=${prefix}/lib/${mysql} \
+	--bindir=${prefix}/lib/${mysql}/bin \
+	--includedir=${prefix}/include/${mysql} \
+	--datadir=${prefix}/share/${mysql} \
+	--sysconfdir=${prefix}/etc/${mysql} \
 	--with-zlib-dir=${prefix} \
 	--with-openssl=${prefix} \
 	--with-extra-charsets=complex \
-	--with-unix-socket-path=${prefix}/var/run/${name}/mysqld.sock \
+	--with-unix-socket-path=${prefix}/var/run/${mysql}/mysqld.sock \
 	--with-mysqld-user=${mysqluser} \
 	--without-bench \
 	--enable-thread-safe-client
@@ -62,56 +68,29 @@
 	configure.compiler	gcc-4.0
 }
 
-variant server {
-	# Create a startupitem to start/stop the server
-	startupitem.create	yes
-	startupitem.start	"${prefix}/share/mysql5/mysql/mysql.server start"
-	startupitem.stop	"${prefix}/share/mysql5/mysql/mysql.server stop"
-}
-
 pre-destroot {
-	# Some directories we must have in all cases
-	xinstall -m 755 -d ${destroot}${prefix}/etc/${name}
-	destroot.keepdirs-append ${destroot}${prefix}/etc/${name}
-	
-	# Setup only for server
-	if { [variant_isset server] } {
-		addgroup ${mysqluser}
-		set gid [existsgroup ${mysqluser}]
-		adduser ${mysqluser} gid=${gid} realname=MySQL\ Server
-		
-		# Some directories we must have only if we're running as a server
-		xinstall -m 755 -o root -d ${destroot}${prefix}/var/run
-		
-		xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \
-			${destroot}${dbdir} \
-			${destroot}${prefix}/var/run/${name}
-		destroot.keepdirs-append  \
-			${destroot}${dbdir} \
-			${destroot}${prefix}/var/run/${name}
-	}
+	xinstall -m 755 -d ${destroot}${prefix}/etc/${mysql}
+	destroot.keepdirs-append ${destroot}${prefix}/etc/${mysql}
 }
 
 post-destroot {
 	delete ${destroot}${prefix}/mysql-test
 	
-	# Symlink mysql binaries into bin directory, with a 5 appended to the name
+	# Symlink mysql binaries into bin directory, with ${major_version} appended to the name
 	cd ${destroot}${prefix}/bin
-	foreach f [glob -tails -directory ${destroot}${prefix}/lib/${name}/bin my*] {
-		ln -sf ../lib/${name}/bin/${f} ${f}5
+	foreach f [glob -tails -directory ${destroot}${prefix}/lib/${mysql}/bin my*] {
+		ln -sf ../lib/${mysql}/bin/${f} ${f}${major_version}
 	}
 }
 
 post-install {
-	if { [variant_isset server] } {
-		ui_msg "******************************************************"
-		ui_msg "* In order to setup the database, you might want to run"
-		ui_msg "* sudo -u ${mysqluser} mysql_install_db5"
-		ui_msg "* if this is a new install" 
-		ui_msg "******************************************************"
-	}
+	ui_msg "****************************************************************"
+	ui_msg "${name} installs only the client libraries to connect to"
+	ui_msg "an existing MySQL server. If you want to run a MySQL server of"
+	ui_msg "your own on this machine, you should also install ${mysql}-server."
+	ui_msg "****************************************************************"
 }
 
 livecheck.check     regex
 livecheck.url       http://dev.mysql.com/
-livecheck.regex     "Generally Available (\[0-9\.\]+)"
+livecheck.regex     "Generally Available (${major_version}\\.\[0-9.\]+)"
