[csw-devel] SF.net SVN: gar:[6315] csw/mgar/pkg/mysql5/branches/mysql-5.0.x

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Wed Sep 16 03:53:44 CEST 2009


Revision: 6315
          http://gar.svn.sourceforge.net/gar/?rev=6315&view=rev
Author:   wahwah
Date:     2009-09-16 01:53:44 +0000 (Wed, 16 Sep 2009)

Log Message:
-----------
mysql5: First iteration of slicing it into separate packages. Things left to do: Creating mysql user and group, pre/post install/remove scripts, a check if MySQL database exists

Modified Paths:
--------------
    csw/mgar/pkg/mysql5/branches/mysql-5.0.x/Makefile
    csw/mgar/pkg/mysql5/branches/mysql-5.0.x/checksums

Added Paths:
-----------
    csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/0001-Use-libc-not-libcrypt.patch
    csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/0002-cast-user_info-pw_gid-to-gid_t.patch
    csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/0003-OpenCSW-perl-for-tests.patch
    csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/0004-basedir-and-datadir-in-the-cnf-files.patch
    csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/README.CSW
    csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/cswmysql5
    csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/quick_start-csw

Modified: csw/mgar/pkg/mysql5/branches/mysql-5.0.x/Makefile
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.0.x/Makefile	2009-09-16 00:58:08 UTC (rev 6314)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.0.x/Makefile	2009-09-16 01:53:44 UTC (rev 6315)
@@ -1,5 +1,5 @@
 GARNAME = mysql5
-GARVERSION = 5.1.33
+GARVERSION = 5.0.84
 CATEGORIES = server
 
 DISTNAME = mysql-$(GARVERSION)
@@ -10,30 +10,70 @@
   (Structured Query Language) database server.
 endef
 
+# Change prefix to /opt/csw/mysql5
+prefix = /opt/csw/mysql5
+sysconfdir = /etc/opt/csw/mysql5
+localstatedir = /var/opt/csw/mysql5
+
+INITSMF = $(sysconfdir)/init\.d/cswmysql5
+
+PATCHFILES  = 0001-Use-libc-not-libcrypt.patch
+PATCHFILES += 0002-cast-user_info-pw_gid-to-gid_t.patch
+PATCHFILES += 0003-OpenCSW-perl-for-tests.patch
+PATCHFILES += 0004-basedir-and-datadir-in-the-cnf-files.patch
+
 PACKAGES  = CSWmysql5 CSWmysql5bench CSWmysql5client CSWmysql5devel
 PACKAGES += CSWmysql5rt CSWmysql5test
 
-CATALOGNAME_CSWmysql5 = $(GARNAME)
-CATALOGNAME_CSWmysql5bench = $(GARNAME)bench
-CATALOGNAME_CSWmysql5clien = $(GARNAME)client
-CATALOGNAME_CSWmysql5devel = $(GARNAME)devel
-CATALOGNAME_CSWmysql5rt = $(GARNAME)rt
-CATALOGNAME_CSWmysql5test = $(GARNAME)test
+CATALOGNAME_CSWmysql5       = $(GARNAME)
+CATALOGNAME_CSWmysql5bench  = $(GARNAME)bench
+CATALOGNAME_CSWmysql5client = $(GARNAME)client
+CATALOGNAME_CSWmysql5devel  = $(GARNAME)devel
+CATALOGNAME_CSWmysql5rt     = $(GARNAME)rt
+CATALOGNAME_CSWmysql5test   = $(GARNAME)test
 
-MASTER_SITES = ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-5.1/
+SPKG_DESC_CSWmysql5       = Multithreaded SQL database
+SPKG_DESC_CSWmysql5bench  = MySQL 5 benchmarking
+SPKG_DESC_CSWmysql5client = MySQL 5 client binaries
+SPKG_DESC_CSWmysql5devel  = MySQL 5 header files
+SPKG_DESC_CSWmysql5rt     = MySQL 5 runtime files
+SPKG_DESC_CSWmysql5test   = MySQL 5 testing files
+
+support64 = (/(amd64|i386))?
+PKGFILES_CSWmysql5client  = $(bindir)
+PKGFILES_CSWmysql5client += $(bindir)$(support64)/myisam(log|pack)
+PKGFILES_CSWmysql5client += $(bindir)$(support64)/mysql
+PKGFILES_CSWmysql5client += $(bindir)$(support64)/mysql_client_test
+PKGFILES_CSWmysql5client += $(bindir)$(support64)/mysql(_zap|access|admin|binlog|check)
+PKGFILES_CSWmysql5client += $(bindir)$(support64)/mysql(dump|hotcopy|import|show)
+PKGFILES_CSWmysql5client += $(bindir)$(support64)/(perror|replace)
+PKGFILES_CSWmysql5client += $(mandir)/man1/mysql(|\_zap|access|admin|dump|show)\.1
+PKGFILES_CSWmysql5client += $(mandir)/man1/(perror|replace)\.1
+PKGFILES_CSWmysql5devel   = $(prefix)/include.*
+PKGFILES_CSWmysql5devel  += $(bindir)$(support64)/mysql_config
+PKGFILES_CSWmysql5devel  += $(mandir)/man1/mysql_config\.1
+PKGFILES_CSWmysql5rt      = $(prefix)/lib/.*\.so.*
+PKGFILES_CSWmysql5bench   = $(prefix)/sql-bench.*
+PKGFILES_CSWmysql5test    = $(prefix)/mysql-test.*
+
+REQUIRED_PKGS_CSWmysql5client = CSWmysql5rt
+
+MASTER_SITES = ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-5.0/
 DISTFILES  = mysql-$(GARVERSION).tar.gz
+DISTFILES += cswmysql5 quick_start-csw README.CSW
 
+
 # We define upstream file regex so we can be notifed of new upstream software release
 UFILES_REGEX = $(GARNAME)-(\d+(?:\.\d+)*).tar.gz
 
-# Change prefix to /opt/csw/mysql5
-prefix = /opt/csw/mysql5
+REQUIRED_PKGS = CSWncurses CSWzlib
+PREREQUISITE_PKGS = $(REQUIRED_PKGS)
 
 # because we alter the prefix.  this gets us proper linking as well as
 # LD_OPTIONS (RPATH)
 EXTRA_LIB = /opt/csw/lib
 EXTRA_INC = /opt/csw/include
-EXTRA_CFLAGS = -mt -D_POSIX_C_SOURCE=199506L -D__EXTENSIONS__ 
+EXTRA_CFLAGS = -mt -D_POSIX_C_SOURCE=199506L -D__EXTENSIONS__
 EXTRA_CXXFLAGS = -mt -D_POSIX_C_SOURCE=199506L -D__EXTENSIONS__
 
 # Set ./configure options
@@ -49,9 +89,21 @@
 CONFIGURE_ARGS += --with-ssl=/opt/csw
 CONFIGURE_ARGS += --with-plugins=max-no-ndb
 
-#TEST_ARGS = test-force
+TEST_SCRIPTS =
 
 # Enable 64 bits build
 BUILD64 = 1
 
 include gar/category.mk
+
+post-install-modulated:
+	ginstall -m 755 -d $(DESTDIR)$(localstatedir)
+	ginstall -m 755 -d $(DESTDIR)$(datadir)/mysql5/doc
+	ginstall -m 644 $(FILEDIR)/README.CSW $(DESTDIR)$(datadir)/mysql5/doc
+	ginstall -m 755 -d $(DESTDIR)/opt/csw/share/mysql5/doc
+	ln -s ../../../mysql5/share/mysql5/doc/README.CSW \
+		$(DESTDIR)/opt/csw/share/mysql5/doc/README.CSW
+	ginstall -m 755 -d $(DESTDIR)/etc/opt/csw/init.d
+	ginstall -m 755 $(FILEDIR)/cswmysql5 $(DESTDIR)/etc/opt/csw/init.d
+	ginstall -m 755 $(FILEDIR)/quick_start-csw $(DESTDIR)$(datadir)/mysql5
+	@$(MAKECOOKIE)

Modified: csw/mgar/pkg/mysql5/branches/mysql-5.0.x/checksums
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.0.x/checksums	2009-09-16 00:58:08 UTC (rev 6314)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.0.x/checksums	2009-09-16 01:53:44 UTC (rev 6315)
@@ -1 +1,8 @@
-9c5711e9bea4514df6f2659f283f0aa0  download/mysql-5.1.33.tar.gz
+a0b98a7320bce2da3e1f90da704d3c85  download/0001-Use-libc-not-libcrypt.patch
+1414d06fab1530484a508927a0de4154  download/0002-cast-user_info-pw_gid-to-gid_t.patch
+5415f365f1b0f7a179d1efc25f45bbee  download/0003-OpenCSW-perl-for-tests.patch
+8ab232cd4d232b3cda3bbced93f80237  download/0004-basedir-and-datadir-in-the-cnf-files.patch
+70d7860bfa776dfc5510fc11d7c14203  download/README.CSW
+815a50011c356cd29758ca2195804952  download/cswmysql5
+671348f1a5b078da9ca76f97e1fda325  download/mysql-5.0.84.tar.gz
+1d79b3cfc4f91db05952bf71f0181fe7  download/quick_start-csw

Added: csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/0001-Use-libc-not-libcrypt.patch
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/0001-Use-libc-not-libcrypt.patch	                        (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/0001-Use-libc-not-libcrypt.patch	2009-09-16 01:53:44 UTC (rev 6315)
@@ -0,0 +1,28 @@
+From a527f284ef5646dbdd731af007aace3daee3e946 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Maciej=20Blizi=C5=84ski?= <blizinski at google.com>
+Date: Wed, 16 Sep 2009 01:27:38 +0100
+Subject: [PATCH 1/4] Use libc, not libcrypt
+
+---
+ configure.in |    5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index ec432e1..577cfe3 100644
+--- a/configure.in
++++ b/configure.in
+@@ -891,7 +891,10 @@ AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open))
+ # This may get things to compile even if bind-8 is installed
+ AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind))
+ # Check if crypt() exists in libc or libcrypt, sets LIBS if needed
+-AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
++## AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
++# For crypt() on Solaris use libc, not libcrypt
++AC_CHECK_LIB(c, crypt)
++AC_CHECK_FUNC(crypt, AC_DEFINE([HAVE_CRYPT], [1], [crypt]))
+ # See if we need a library for address lookup.
+ AC_SEARCH_LIBS(inet_aton, [socket nsl resolv])
+ 
+-- 
+1.6.3.2
+

Added: csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/0002-cast-user_info-pw_gid-to-gid_t.patch
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/0002-cast-user_info-pw_gid-to-gid_t.patch	                        (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/0002-cast-user_info-pw_gid-to-gid_t.patch	2009-09-16 01:53:44 UTC (rev 6315)
@@ -0,0 +1,27 @@
+From 8536f5925a96634950decd8779b2c6a60d183134 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Maciej=20Blizi=C5=84ski?= <blizinski at google.com>
+Date: Wed, 16 Sep 2009 01:29:57 +0100
+Subject: [PATCH 2/4] cast user_info->pw_gid to gid_t
+
+---
+ sql/mysqld.cc |    4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/sql/mysqld.cc b/sql/mysqld.cc
+index 592ae3e..695fbb9 100644
+--- a/sql/mysqld.cc
++++ b/sql/mysqld.cc
+@@ -1436,7 +1436,9 @@ static void set_user(const char *user, struct passwd *user_info_arg)
+     output a specific message to help the user resolve this problem.
+   */
+   calling_initgroups= TRUE;
+-  initgroups((char*) user, user_info_arg->pw_gid);
++/* Solaris patch */
++/*  initgroups((char*) user, user_info->pw_gid); */
++  initgroups((char*) user,(gid_t) user_info->pw_gid);
+   calling_initgroups= FALSE;
+ #endif
+   if (setgid(user_info_arg->pw_gid) == -1)
+-- 
+1.6.3.2
+

Added: csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/0003-OpenCSW-perl-for-tests.patch
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/0003-OpenCSW-perl-for-tests.patch	                        (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/0003-OpenCSW-perl-for-tests.patch	2009-09-16 01:53:44 UTC (rev 6315)
@@ -0,0 +1,22 @@
+From bd9a3ff419f5a614d584aa6156a512e69f470e0f Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Maciej=20Blizi=C5=84ski?= <blizinski at google.com>
+Date: Wed, 16 Sep 2009 01:36:09 +0100
+Subject: [PATCH 3/4] OpenCSW perl for tests
+
+---
+ mysql-test/mysql-test-run.pl |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
+index f60701b..cd9f843 100755
+--- a/mysql-test/mysql-test-run.pl
++++ b/mysql-test/mysql-test-run.pl
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!/opt/csw/bin/perl
+ # -*- cperl -*-
+ 
+ #
+-- 
+1.6.3.2
+

Added: csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/0004-basedir-and-datadir-in-the-cnf-files.patch
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/0004-basedir-and-datadir-in-the-cnf-files.patch	                        (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/0004-basedir-and-datadir-in-the-cnf-files.patch	2009-09-16 01:53:44 UTC (rev 6315)
@@ -0,0 +1,81 @@
+From 194dbf9ff230f747bb093970831fbdf4cb0f0674 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Maciej=20Blizi=C5=84ski?= <blizinski at google.com>
+Date: Wed, 16 Sep 2009 01:38:35 +0100
+Subject: [PATCH 4/4] basedir and datadir in the cnf files
+
+---
+ support-files/my-huge.cnf.sh            |    2 ++
+ support-files/my-innodb-heavy-4G.cnf.sh |    2 ++
+ support-files/my-large.cnf.sh           |    2 ++
+ support-files/my-medium.cnf.sh          |    2 ++
+ support-files/my-small.cnf.sh           |    2 ++
+ 5 files changed, 10 insertions(+), 0 deletions(-)
+
+diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh
+index e4747ac..907b41d 100644
+--- a/support-files/my-huge.cnf.sh
++++ b/support-files/my-huge.cnf.sh
+@@ -23,6 +23,8 @@ socket		= @MYSQL_UNIX_ADDR@
+ 
+ # The MySQL server
+ [mysqld]
++basedir         = /opt/csw/mysql5
++datadir         = /var/opt/csw/mysql5
+ port		= @MYSQL_TCP_PORT@
+ socket		= @MYSQL_UNIX_ADDR@
+ skip-locking
+diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh
+index cda11d6..a9d5514 100644
+--- a/support-files/my-innodb-heavy-4G.cnf.sh
++++ b/support-files/my-innodb-heavy-4G.cnf.sh
+@@ -39,6 +39,8 @@ socket		= @MYSQL_UNIX_ADDR@
+ # The MySQL server
+ #
+ [mysqld]
++basedir         = /opt/csw/mysql5
++datadir         = /var/opt/csw/mysql5
+ 
+ # generic configuration options
+ port		= @MYSQL_TCP_PORT@
+diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh
+index 981b137..8b890fb 100644
+--- a/support-files/my-large.cnf.sh
++++ b/support-files/my-large.cnf.sh
+@@ -23,6 +23,8 @@ socket		= @MYSQL_UNIX_ADDR@
+ 
+ # The MySQL server
+ [mysqld]
++basedir         = /opt/csw/mysql5
++datadir         = /var/opt/csw/mysql5
+ port		= @MYSQL_TCP_PORT@
+ socket		= @MYSQL_UNIX_ADDR@
+ skip-locking
+diff --git a/support-files/my-medium.cnf.sh b/support-files/my-medium.cnf.sh
+index c3135ea..ef841db 100644
+--- a/support-files/my-medium.cnf.sh
++++ b/support-files/my-medium.cnf.sh
+@@ -24,6 +24,8 @@ socket		= @MYSQL_UNIX_ADDR@
+ 
+ # The MySQL server
+ [mysqld]
++basedir         = /opt/csw/mysql5
++datadir         = /var/opt/csw/mysql5
+ port		= @MYSQL_TCP_PORT@
+ socket		= @MYSQL_UNIX_ADDR@
+ skip-locking
+diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh
+index 24c0840..89299dd 100644
+--- a/support-files/my-small.cnf.sh
++++ b/support-files/my-small.cnf.sh
+@@ -24,6 +24,8 @@ socket		= @MYSQL_UNIX_ADDR@
+ 
+ # The MySQL server
+ [mysqld]
++basedir         = /opt/csw/mysql5
++datadir         = /var/opt/csw/mysql5
+ port		= @MYSQL_TCP_PORT@
+ socket		= @MYSQL_UNIX_ADDR@
+ skip-locking
+-- 
+1.6.3.2
+

Copied: csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/README.CSW (from rev 6058, csw/mgar/pkg/mysql5/branches/legacy/README.CSW)
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/README.CSW	                        (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/README.CSW	2009-09-16 01:53:44 UTC (rev 6315)
@@ -0,0 +1,62 @@
+2007-06-17
+MySQL 5.1 is still in beta.  This package is released for your testing
+only.
+
+2007-06-03
+This update fixes a startup script problem that caused the script to not
+work when --datadir is not the default.
+
+This update also adds amd64 mysqld and client libraries.
+
+2006-12-29
+This update adds support for csw.conf.  See the following url for details.
+http://www.blastwave.org/standards/csw.conf.html
+The daemon specific name for this package is mysql5.
+
+*** IMPORTANT ***
+If you are using mysql5rc; please move your options to my.cnf and eliminate
+  mysql5rc.  A future release will remove mysql5rc.
+my.cnf is more flexible and any new or missing options will not be added to
+  mysql5rc.
+quick_start-csw is changed with this release to Not write mysql5rc.  Options
+  for --basedir and --datadir are included in the default my.cnf files.
+*** END OF IMPORTANT ***
+
+2006-04-16
+This update fixes some problems with quick_start-csw and svc-mysql5.
+I have also corrected some issues when using a database directory that
+  is not /opt/csw/mysql5/var
+
+If you are not using the default location for --datadir, package installation
+  will NOT start CSWmysql5.  More code is needed for that.  I welcome patches.
+
+If you are not using the default location for --datadir, you will find
+  that CSWmysql5 works much better when you create /etc/my.cnf with at
+  least the entries that follow.  You may also want some entries in this
+  global options file for client programs that you use.
+  For example: --datadir is /db/mysql5/var
+  Create /etc/my.cnf with the following entries:
+    # Global MySQL options file.
+    [mysqld]
+    datadir         = /db/mysql5/var
+    basedir         = /opt/csw/mysql5
+
+I also changed the option for --defaults-file to --defaults-extra-file
+  in the startup script.
+  This allows your options file to be read after the global options file
+  /etc/my.cnf.
+
+Note that if you are using the default location for --datadir, you do not
+  really need /etc/opt/csw/mysql5rc.  In this case, you should put any options
+  in the appropriate group in my.cnf.  See the MySQL documentation for 
+  details.
+If you are not using the default location for --datadir, you only need
+  /etc/opt/csw/mysql5rc for the startup script options for
+  --defaults-extra-file and possibly --pid-file.  All other options may be
+  put in the appropriate group in my.cnf
+
+Click 'Views and info' on the package page at
+  http://www.blastwave.org/packages.php/mysql5
+for the latest information.
+
+Alex Moore

Copied: csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/cswmysql5 (from rev 6058, csw/mgar/pkg/mysql5/branches/legacy/cswmysql5)
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/cswmysql5	                        (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/cswmysql5	2009-09-16 01:53:44 UTC (rev 6315)
@@ -0,0 +1,180 @@
+#!/bin/sh
+# Start script for CSW www.blastwave.org package of MySQL database.
+#
+# NOTE: Make sure DB_DIR is owned BY the mysql user and group and chmod 
+# 700.
+#
+# First time installation can use quick_start-csw in
+#   /opt/csw/mysql5/share/mysql to build the mysql database for the
+#   grant tables.  Or create the initial database yourself.
+#
+# Use my.cnf for startup options.  See MySQL documention 
+#   for 'Using Option Files'.
+# Support for mysql5rc still remains in this startup script.
+#
+
+RETVAL=0
+MYSQLHOME=/opt/csw/mysql5
+MYSQLD_DATADIR=$MYSQLHOME/var
+MYSQLD_PID_FILE=$MYSQLHOME/var/mysql.pid
+CONFFILE=$MYSQLHOME/my.cnf
+
+#
+# Source configuration
+[ -r /opt/csw/mysql5/etc/mysql5rc ] && . /opt/csw/mysql5/etc/mysql5rc
+[ -r /etc/opt/csw/mysql5rc ] && . /etc/opt/csw/mysql5rc
+
+# To get started quickly, copy a sample configuration file from 
+#   $MYSQLHOME/share/mysql
+# For example,
+#  cp /opt/csw/mysql5/share/mysql/my-medium.cnf /opt/csw/mysql5/var/my.cnf
+#
+# Or, manually follow the database creation steps below, and have
+# mysql just use defaults for everything.
+
+# 2006-03-11 Changed to only look for the grant tables database
+# 2006-04-16 Changed again.  Look for either the grant tables database
+#            or the options file.
+# 2006-12-28 Fix problem.  Look for either the grant tables database in
+#            the default location or the default options file.
+if [ ! -d "$MYSQLD_DATADIR/mysql" -a ! -f "$CONFFILE" ] ; then
+    exit 0
+fi
+
+# If CONFFILE is the server default file, unset CONFFILE
+if [ x"$CONFFILE" = x"$MYSQLHOME/my.cnf" ]; then
+    CONFFILE=
+fi
+
+# If MYSQLD_DATADIR does not contain a mysql directory, unset MYSQLD_DATADIR
+# Also, check that MYSQLD_DATADIR contains a mysql directory
+if [ ! -d "$MYSQLHOME/var/mysql" -a ! -d "$MYSQLD_DATADIR/mysql" ] ; then
+    MYSQLD_DATADIR=
+fi
+
+# Make sure required vars are set
+MYSQLD_PID_FILE=${MYSQLD_PID_FILE:=$MYSQLHOME/var/mysql.pid}
+
+# If a database already exists, start whether or not there is a conf file.
+# If no conf file, the database will just use internal defaults for everything.
+
+start_it() {
+    if test -r $MYSQLD_PID_FILE ; then
+	if kill -0 `cat $MYSQLD_PID_FILE` > /dev/null 2>&1 ; then
+	    echo "mysqld (`cat $MYSQLD_PID_FILE`) seems to be running."
+	    return 1
+	fi
+    fi
+
+    printf "%-60s" "Starting mysqld: "
+# 2006-03-11
+# This script no longer creates the default database. You may create the 
+# default database manually or use /opt/csw/mysql5/share/mysql/quick_start-csw
+#    if [ ! -d "$MYSQLHOME/var/mysql" ] ; then
+#        echo MySQL core database has not been created.
+#         echo Creating it now...
+#	$MYSQLHOME/bin/mysql_install_db
+#	chown -R mysql:mysql $MYSQLHOME/var
+#    fi
+
+# 2006-04-16  --defaults-file is changed to --defaults-extra-file    
+    $MYSQLHOME/bin/mysqld_safe \
+        `[ -n "$CONFFILE" ] && echo "--defaults-extra-file=$CONFFILE"` \
+	--pid-file=$MYSQLD_PID_FILE \
+	`[ -n "$MYSQLD_PROG" ] && echo "--mysqld=$MYSQLD_PROG"` \
+	`[ -n "$MYSQLD_ANSI" ] && echo "--ansi"` \
+	`[ -n "$MYSQLD_BASEDIR" ] && echo "--basedir=$MYSQLD_BASEDIR"` \
+	`[ -n "$MYSQLD_BIG_TABLES" ] && echo "--big-tables"` \
+	`[ -n "$MYSQLD_BIND_ADDRESS" ] && echo "--bind-address=$MYSQLD_BIND_ADDRESS"` \
+	`[ -n "$MYSQLD_CHARACTER_SETS" ] && echo "--character-sets-dir=$MYSQLD_CHARACTER_SETS"` \
+	`[ -n "$MYSQLD_CHROOT" ] && echo "--chroot=$MYSQLD_CHROOT"` \
+	`[ -n "$MYSQLD_DATADIR" ] && echo "--datadir=$MYSQLD_DATADIR"` \
+	`[ -n "$MYSQLD_DEFAULT_CHARSET" ] && echo "--default-character-set=$MYSQLD_DEFAULT_CHARSET"` \
+	`[ -n "$MYSQLD_DEFAULT_TABLE_TYPE" ] && echo "--default-table-type=$MYSQLD_DEFAULT_TABLE_TYPE"` \
+	`[ -n "$MYSQLD_DELAY_KEY_WRITE_TABLES" ] && echo "--delay-key-write-for-all-tables"` \
+	`[ -n "$MYSQLD_ENABLE_LOCKING" ] && echo "--enable-locking"` \
+	`[ -n "$MYSQLD_EXIT_INFO" ] && echo "--exit-info"` \
+	`[ -n "$MYSQLD_FLUSH" ] && echo "--flush"` \
+	`[ -n "$MYSQLD_INIT_FILE" ] && echo "--init-file=$MYSQLD_INIT_FILE"` \
+	`[ -n "$MYSQLD_LANGUAGE" ] && echo "--language=$MYSQLD_LANGUAGE"` \
+	`[ -n "$MYSQLD_LOG" ] && echo "--log=$MYSQLD_LOG"` \
+	`[ -n "$MYSQLD_LOG_ISAM" ] && echo "--log-isam=$MYSQLD_LOG_ISAM"` \
+	`[ -n "$MYSQLD_LOG_SLOW_QUERIES" ] && echo "--log-slow-queries=$MYSQLD_LOG_SLOW_QUERIES` \
+	`[ -n "$MYSQLD_LOG_UPDATE" ] && echo "--log-update=$MYSQLD_LOG_UPDATE"` \
+	`[ -n "$MYSQLD_LOG_LONG_FORMAT" ] && echo "--log-long-format"` \
+	`[ -n "$MYSQLD_LOW_PRIORITY_UPDATES" ] && echo "--low-priority-updates"` \
+	`[ -n "$MYSQLD_MEMLOCK" ] && echo "--memlock"` \
+	`[ -n "$MYSQLD_MYISAM_RECOVER" ] && echo "--myisam-recover=$MYSQLD_MYISAM_RECOVER"` \
+	`[ -n "$MYSQLD_PORT" ] && echo "--port=$MYSQLD_PORT"` \
+	`[ -n "$MYSQLD_OLD_PROTOCOL" ] && echo "--old-protocol"` \
+	`[ -n "$MYSQLD_ONE_THREAD" ] && echo "--one-thread"` \
+	`[ -n "$MYSQLD_SET_VARIABLE" ] && echo "--set-variablevar=$MYSQLD_SET_VARIABLE"` \
+	`[ -n "$MYSQLD_SKIP_GRANT_TABLES" ] && echo "--skip-grant-tables"` \
+	`[ -n "$MYSQLD_SAFE_MODE" ] && echo "--safe-mode"` \
+	`[ -n "$MYSQLD_SECURE" ] && echo "--secure"` \
+	`[ -n "$MYSQLD_SKIP_CONCURRENT_INSERT" ] && echo "--skip-concurrent-insert"` \
+	`[ -n "$MYSQLD_SKIP_DELAY_KEY_WRITE" ] && echo "--skip-delay-key-write"` \
+	`[ -n "$MYSQLD_SKIP_LOCKING" ] && echo "--skip-locking"` \
+	`[ -n "$MYSQLD_SKIP_NAME_RESOLVE" ] && echo "--skip-name-resolve"` \
+	`[ -n "$MYSQLD_SKIP_NETWORKING" ] && echo "--skip-networking"` \
+	`[ -n "$MYSQLD_SKIP_NEW" ] && echo "--skip-new"` \
+	`[ -n "$MYSQLD_SKIP_HOST_CACHE" ] && echo "--skip-host-cache"` \
+	`[ -n "$MYSQLD_SKIP_SHOW_DATABASE" ] && echo "--skip-show-database"` \
+	`[ -n "$MYSQLD_SKIP_THREAD_PRIORITY" ] && echo "--skip-thread-priority"` \
+	`[ -n "$MYSQLD_SOCKET" ] && echo "--socket=$MYSQLD_SOCKET"` \
+	`[ -n "$MYSQLD_TMPDIR" ] && echo "--tmpdir=$MYSQLD_TMPDIR"` \
+	`[ -n "$MYSQLD_USER" ] && echo "--user=$MYSQLD_USER"` \
+	& >/dev/null 2>&1
+    RETVAL=$?
+    if [ $RETVAL = 0 ] ; then
+	echo "[  OK  ]"
+    else
+	echo "[FAILED]"
+	return 1
+    fi
+    return 0
+}
+
+stop_it() {
+
+    printf "%-60s" "Shutting down mysqld: "
+    if test -f "$MYSQLD_PID_FILE" ; then
+	pkill mysqld_safe >/dev/null 2>&1
+	kill `cat $MYSQLD_PID_FILE` >/dev/null 2>&1
+	RETVAL=$?
+    else
+	RETVAL=1
+    fi
+    if [ $RETVAL = 0 ] ; then
+	echo "[  OK  ]"
+    else
+	echo "[FAILED]"
+    fi
+    echo ""
+    return 0
+}
+
+case $1 in
+    start)
+    start_it
+    ;;
+
+    stop)
+    stop_it
+    ;;
+
+    restart)
+    stop_it
+    while pgrep mysqld > /dev/null
+      do
+      sleep 1
+    done
+    start_it
+    ;;
+
+    *)
+    echo "Usage: $0  { start | stop | restart } "
+    ;;
+esac
+
+exit $RETVAL

Copied: csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/quick_start-csw (from rev 6058, csw/mgar/pkg/mysql5/branches/legacy/quick_start-csw)
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/quick_start-csw	                        (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/quick_start-csw	2009-09-16 01:53:44 UTC (rev 6315)
@@ -0,0 +1,132 @@
+#!/bin/ksh -p
+# initial version for blastwave.org by Alex Moore 2006.02.25
+# Revised 2006.03.25 - see bug report 0001542
+#
+# This script creates a default database with the small-memory footprint.
+# Input may be provided for DATADIR and DEFAULTS_FILE
+# 
+#
+BASEDIR=/opt/csw/mysql5
+DEFAULTS_FILE=$BASEDIR/my.cnf
+SAVE_DEFAULTS_FILE=$BASEDIR/my.cnf
+MYSQLD_USER=mysql
+#
+# Provide a default data directory
+MYSQLD_DATADIR=/opt/csw/mysql5/var
+#
+echo
+echo  "This is the blastwave quick start script to setup a MySQL5 database"
+echo  "  directory."
+echo
+echo  "  The base directory is $BASEDIR."
+echo  "  The default database directory is $MYSQLD_DATADIR."
+echo
+echo  "  If you have not setup a partition for the database and"
+echo  "  you want one; now is a good time to exit this script and"
+echo  "  create and mount the partition."
+echo
+echo  "  If you have not setup a my.cnf file and you do not want"
+echo  "  one of the sample files; now is a good time to exit and"
+echo  "  create the file $DEFAULTS_FILE."
+echo
+echo  "Data directory: The default is $MYSQLD_DATADIR."
+unset usrin
+usrin=`/usr/bin/ckpath -ay -d [default] \
+    -p "Accept the default or enter a directory"
+    ` || exit $?
+if [ ! "$usrin" = "[default]" ]; then
+    MYSQLD_DATADIR=$usrin
+fi
+echo
+echo  "my.cnf pathname: The default is either to use the supplied file in"
+echo  "  the base directory or to create one in the base directory from"
+echo  "  the small memory footprint sample.  If your enter a pathname,"
+echo  "  it will be used to create the options file in the base directory."
+unset usrin
+usrin=`/usr/bin/ckpath -f -d [default] \
+    -p "Accept the default or enter a pathname"
+    ` || exit $?
+if [ $usrin = "[default]" ]; then
+    if [ ! -f "$DEFAULTS_FILE" ]; then
+	IN_DEFAULTS_FILE=$BASEDIR/share/mysql/my-small.cnf
+	echo "Using $IN_DEFAULTS_FILE to create the options file."
+    else
+	IN_DEFAULTS_FILE=$DEFAULTS_FILE
+	echo "Using $DEFAULTS_FILE as the options file."
+    fi
+else
+    IN_DEFAULTS_FILE=$usrin
+    echo "Using $IN_DEFAULTS_FILE to create the options file."
+fi
+
+echo "data directory is $MYSQLD_DATADIR"
+if [ ! -d "$MYSQLD_DATADIR" ]; then
+    echo "data directory will be created."
+fi
+
+unset usrin
+usrin=`/usr/bin/ckyorn -d y \
+    -p "Continue with installation or quit"
+                ` || exit $?
+if [ "$usrin" = "n" ] ; then
+    echo  "Leaving script without doing anything."
+    exit 0
+fi
+
+if [ -d "$MYSQLD_DATADIR/mysql" ]; then
+    echo  "mysql database already exists.  Leaving script without doing anything."
+    exit 0
+fi
+
+echo  "Setting up the database"
+# Create the database directory and set the permissions if needed
+if [ ! -d "$MYSQLD_DATADIR" ] ; then
+    mkdir -p $MYSQLD_DATADIR
+    chown -R root:bin $MYSQLD_DATADIR
+    chmod -R 0755 $MYSQLD_DATADIR
+    chown mysql:mysql $MYSQLD_DATADIR
+    chmod 0700 $MYSQLD_DATADIR
+fi
+#
+# copy the configuration file if not exists.
+CNFCOPIED=no
+if [ ! -f "$DEFAULTS_FILE" ] ; then
+    cp -p $IN_DEFAULTS_FILE $DEFAULTS_FILE
+    CNFCOPIED=yes
+fi
+#
+# Run the mysql script to create the database
+echo "Creating MySQL core database in $MYSQLD_DATADIR"
+echo
+echo "###  The following messages are from mysql_install_db."
+$BASEDIR/bin/mysql_install_db --defaults-extra-file=$DEFAULTS_FILE --user=$MYSQLD_USER --basedir=$BASEDIR --datadir=$MYSQLD_DATADIR
+
+#
+# Fix permissions on the data directory
+chown -R mysql:mysql $MYSQLD_DATADIR
+
+#
+# Update --datadir in the cnf file with the correct value if file was copied
+if [ x"$CNFCOPIED" = xyes ]; then
+    sed -e "s|/opt/csw/mysql5/var|$MYSQLD_DATADIR|g" $DEFAULTS_FILE >$DEFAULTS_FILE.new
+    mv $DEFAULTS_FILE.new $DEFAULTS_FILE
+fi
+
+#
+# Ending message
+echo
+echo "###  The following messages are from quick_start-csw."
+echo "See /opt/csw/mysql5/share/mysql/doc/README.CSW for packaging changes."
+echo "Please ignore references to starting mysqld_safe in the messages above."
+echo "  These messages are from mysql_install_db.  See the following"
+echo "  for starting CSWmysql5."
+smf=no
+if [ -f /usr/sbin/svccfg -a -f /usr/sbin/svcadm ] ; then smf=yes ; fi
+if [ $smf = yes ] 
+then
+    echo "To start mysqld; run \`svcadm enable cswmysql5\` on Solaris 10 or later"
+else
+    echo "To start mysqld; run \`/etc/init.d/cswmysql start\` on Solaris 9 or earlier"
+fi
+
+exit 0


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list