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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Thu Oct 6 23:53:50 CEST 2011


Revision: 15884
          http://gar.svn.sourceforge.net/gar/?rev=15884&view=rev
Author:   wahwah
Date:     2011-10-06 21:53:50 +0000 (Thu, 06 Oct 2011)
Log Message:
-----------
pkg/mysql5/branches/mysql-5.5.x: partial progress

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

Added Paths:
-----------
    csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/0004-looking-for-ps-use-basename-0.patch
    csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql55.postinstall
    csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql55.preinstall
    csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/cswmysql55.tpl

Removed Paths:
-------------
    csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql51.postinstall
    csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql51.preinstall
    csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/cswmysql51

Modified: csw/mgar/pkg/mysql5/branches/mysql-5.5.x/Makefile
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.5.x/Makefile	2011-10-06 19:04:57 UTC (rev 15883)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.5.x/Makefile	2011-10-06 21:53:50 UTC (rev 15884)
@@ -5,10 +5,13 @@
 PROJ_NAME = mysql
 NAME = $(PROJ_NAME)55
 BASE_VERSION = 5.5
-PATCHLEVEL = 9
+PATCHLEVEL = 16
+ALTS_PRIO = 55
 VERSION = $(BASE_VERSION).$(PATCHLEVEL)
 CATEGORIES = server
 
+# PACKAGING_PLATFORMS = solaris9-sparc solaris10-sparc
+
 # Useful when making a series of builds on the same day
 # GARFLAVOR ?= DBG
 
@@ -21,150 +24,141 @@
   (Structured Query Language) database server.
 endef
 
-prefix = /opt/csw/$(NAME)
-localstatedir = /var$(prefix)
-sysconfdir = /etc$(prefix)
+INITSMF = $(sysconfdir)/init\.d/csw$(NAME)
 
-# Where to put the init script
-global_sysconfdir = $(sysconfdir)
-# Where to link the binaries
-global_bindir = /opt/csw/bin
+# Existing databases are in this location
+localstatedir = /var$(BUILD_PREFIX)/$(NAME)
+# To avoid file conflicts
+datadir = $(prefix)/share/mysql/$(BASE_VERSION)
 
-INITSMF = $(global_sysconfdir)/init\.d/csw$(NAME)
+MYSQL_LIB_VER = 17
 
-PACKAGES  = CSW$(NAME)
-PACKAGES += CSW$(NAME)bench
-PACKAGES += CSW$(NAME)client
-PACKAGES += CSW$(NAME)devel
-PACKAGES += CSW$(NAME)rt
-PACKAGES += CSW$(NAME)test
+PACKAGES += CSWmysql-dev
+SPKG_DESC_CSWmysql-dev = MySQL development files
+PKGFILES_CSWmysql-dev = $(PKGFILES_DEVEL)
+RUNTIME_DEP_PKGS_CSWmysql-dev += CSWlibmysqlclient-r$(MYSQL_LIB_VER)
+RUNTIME_DEP_PKGS_CSWmysql-dev += CSWlibmysqlclient$(MYSQL_LIB_VER)
+CSWmysql-dev_programs += mysql_config
+PKGFILES_CSWmysql-dev  += $(foreach bin_name,$(CSWmysql-dev_programs),$(call baseisadirs,$(bindir),$(bin_name)-$(BASE_VERSION)))
+PKGFILES_CSWmysql-dev  += $(foreach bin_name,$(CSWmysql-dev_programs),$(mandir)/man1/$(bin_name)\.1-$(BASE_VERSION))
+PKGFILES_CSWmysql-dev  += $(foreach bin_name,$(CSWmysql-dev_programs),/opt/csw/bin/$(bin_name)-$(BASE_VERSION))
+PKGFILES_CSWmysql-dev  += $(foreach bin_name,$(CSWmysql-dev_programs),/opt/csw/sbin/$(bin_name)-$(BASE_VERSION))
+PKGFILES_CSWmysql-dev  += $(mandir)/man1/mysql_config.*
+PKGFILES_CSWmysql-dev  += $(prefix)/include.*
+PKGFILES_CSWmysql-dev  += /opt/csw/include/mysql
+OBSOLETED_BY_CSWmysql-dev = CSWmysql5devel
+CHECKPKG_OVERRIDES_CSWmysql-dev += file-with-bad-content|/usr/local|root$(mandir)/man1/mysql_config-$(BASE_VERSION).1
+ALTERNATIVES_CSWmysql-dev = mysql_dev
+ALTERNATIVE_mysql_dev = $(bindir)/$(firstword $(CSWmysql-dev_programs)) mysql_dev $(bindir)/$(firstword $(CSWmysql-dev_programs)) $(ALTS_PRIO)
+ALTERNATIVE_mysql_dev += $(foreach C,$(wordlist 2,$(words $(CSWmysql-dev_programs)),$(CSWmysql-dev_programs)),\
+	$(bindir)/$C $C $(bindir)/$C-$(BASE_VERSION))
+ALTERNATIVE_mysql_dev += $(foreach C,$(wordlist 2,$(words $(CSWmysql-dev_programs)),$(CSWmysql-dev_programs)),\
+	$(mandir)/man1/$(C).1 $C $(mandir)/man1/$(C)-$(BASE_VERSION).1)
 
-#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-var-opt-csw-mysql51-for-datadir-in-my-.cnf.patch
+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-var-opt-csw-mysql51-for-datadir-in-my-.cnf.patch
 
-SPKG_DESC_CSW$(NAME)       = Multithreaded SQL database
-SPKG_DESC_CSW$(NAME)bench  = MySQL $(BASE_VERSION) benchmarking
-SPKG_DESC_CSW$(NAME)client = MySQL $(BASE_VERSION) client binaries
-SPKG_DESC_CSW$(NAME)devel  = MySQL $(BASE_VERSION) header files
-SPKG_DESC_CSW$(NAME)rt     = MySQL $(BASE_VERSION) runtime files
-SPKG_DESC_CSW$(NAME)test   = MySQL $(BASE_VERSION) testing files
+PACKAGES += CSWlibmysqlclient$(MYSQL_LIB_VER)
+PKGFILES_CSWlibmysqlclient$(MYSQL_LIB_VER) += $(call baseisadirs,$(libdir),libmysqlclient\.so\.$(MYSQL_LIB_VER)(\.\d+)*)
+SPKG_DESC_CSWlibmysqlclient$(MYSQL_LIB_VER) += MySQL $(BASE_VERSION) client library, libmysqlclient.so.$(MYSQL_LIB_VER)
+RUNTIME_DEP_PKGS_CSWlibmysqlclient$(MYSQL_LIB_VER) += CSWlibz1
+RUNTIME_DEP_PKGS_CSWlibmysqlclient$(MYSQL_LIB_VER) += CSWosslrt
+OBSOLETED_BY_CSWlibmysqlclient$(MYSQL_LIB_VER) += CSW$(NAME)rt
 
-CATALOGNAME_CSW$(NAME)       = $(NAME)
-CATALOGNAME_CSW$(NAME)bench  = $(NAME)bench
-CATALOGNAME_CSW$(NAME)client = $(NAME)client
-CATALOGNAME_CSW$(NAME)devel  = $(NAME)devel
-CATALOGNAME_CSW$(NAME)rt     = $(NAME)rt
-CATALOGNAME_CSW$(NAME)test   = $(NAME)test
+PACKAGES += CSWlibmysqlclient-r$(MYSQL_LIB_VER)
+PKGFILES_CSWlibmysqlclient-r$(MYSQL_LIB_VER) += $(call baseisadirs,$(libdir),libmysqlclient_r\.so\.$(MYSQL_LIB_VER)(\.\d+)*)
+SPKG_DESC_CSWlibmysqlclient-r$(MYSQL_LIB_VER) += MySQL $(BASE_VERSION) client library, libmysqlclient_r.so.$(MYSQL_LIB_VER)
+RUNTIME_DEP_PKGS_CSWlibmysqlclient-r$(MYSQL_LIB_VER) += CSWlibz1
+RUNTIME_DEP_PKGS_CSWlibmysqlclient-r$(MYSQL_LIB_VER) += CSWosslrt
+OBSOLETED_BY_CSWlibmysqlclient-r$(MYSQL_LIB_VER) += CSW$(NAME)rt
 
-
-ARCHALL_CSW$(NAME)bench = 1
-
 # Defining the client programs, which are going to pick up the 32- and 64-bit
 # binaries, symbolic links, isaexec stuff and man pages.
-CSW$(NAME)client_programs  = myisamlog
-CSW$(NAME)client_programs += myisampack
-CSW$(NAME)client_programs += mysql
-CSW$(NAME)client_programs += mysqlaccess
-CSW$(NAME)client_programs += mysqladmin
-CSW$(NAME)client_programs += mysqlbin
-CSW$(NAME)client_programs += mysqlbinlog
-CSW$(NAME)client_programs += mysqlcheck
-CSW$(NAME)client_programs += mysql_client_test
-CSW$(NAME)client_programs += mysqldump
-CSW$(NAME)client_programs += mysqlhotcopy
-CSW$(NAME)client_programs += mysqlimport
-CSW$(NAME)client_programs += mysqlshow
-CSW$(NAME)client_programs += mysql_zap
-CSW$(NAME)client_programs += perror
-CSW$(NAME)client_programs += replace
+client_programs += myisamlog
+client_programs += myisampack
+client_programs += mysql
+client_programs += mysqlaccess
+client_programs += mysqladmin
+client_programs += mysqlbin
+client_programs += mysqlbinlog
+client_programs += mysqlcheck
+client_programs += mysql_client_test
+client_programs += mysqldump
+client_programs += mysqlhotcopy
+client_programs += mysqlimport
+client_programs += mysqlshow
+client_programs += mysql_zap
+client_programs += perror
+client_programs += replace
 
-# Without this EXTRA_LD_OPTIONS setting, /opt/csw/bin/mysql fails with a shared
-# library not found.  EXTRA_LIB was tried too, but did not work, as the -R path
-# ended up with having two $ISALIST tokens.
-#
-# Without this setting it looks for:
-# /opt/csw/$(NAME)/lib/amd64/libmysqlclient.so.15
-# The library is at:
-# /opt/csw/$(NAME)/lib/amd64/mysql/libmysqlclient.so.15
-EXTRA_LD_OPTIONS  = -R$(libdir)/\$$ISALIST/mysql
+PACKAGES += CSW$(NAME)client
+SPKG_DESC_CSW$(NAME)client = MySQL $(BASE_VERSION) client binaries
+PKGFILES_CSW$(NAME)client  = $(bindir)
+PKGFILES_CSW$(NAME)client += $(foreach bin_name,$(client_programs),$(call baseisadirs,$(bindir),$(bin_name)-$(BASE_VERSION)))
+PKGFILES_CSW$(NAME)client += $(foreach bin_name,$(client_programs),$(mandir)/man1/$(bin_name)-$(BASE_VERSION)\.1)
+PKGFILES_CSW$(NAME)client += $(foreach bin_name,$(client_programs),/opt/csw/bin/$(bin_name)-$(BASE_VERSION))
+PKGFILES_CSW$(NAME)client += $(foreach bin_name,$(client_programs),/opt/csw/sbin/$(bin_name)-$(BASE_VERSION))
+RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWlibmysqlclient$(MYSQL_LIB_VER)
+RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWlibmysqlclient-r$(MYSQL_LIB_VER)
+RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWlibncursesw5
+RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWlibz1
+RUNTIME_DEP_PKGS_CSW$(NAME)client += CSWosslrt
+CHECKPKG_OVERRIDES_CSW$(NAME)client += bad-rpath-entry
 
-COMMON_CFLAGS = -mt -fsimple=1 -ftrap=%none -xbuiltin=%all -xlibmil -xlibmopt
+PACKAGES += CSW$(NAME)
+RUNTIME_DEP_PKGS_CSW$(NAME) += CSWlibmysqlclient-r$(MYSQL_LIB_VER)
+RUNTIME_DEP_PKGS_CSW$(NAME) += CSWlibmysqlclient$(MYSQL_LIB_VER)
+SPKG_DESC_CSW$(NAME) = Multithreaded SQL database
+RUNTIME_DEP_PKGS_CSW$(NAME) += CSW$(NAME)client
+RUNTIME_DEP_PKGS_CSW$(NAME) += CSWlibwrap1
+RUNTIME_DEP_PKGS_CSW$(NAME) += CSWlibz1
+RUNTIME_DEP_PKGS_CSW$(NAME) += CSWosslrt
+CHECKPKG_OVERRIDES_CSW$(NAME) += bad-rpath-entry
+CHECKPKG_OVERRIDES_CSW$(NAME) += file-with-bad-content
 
-EXTRA_CFLAGS = $(EXTRA_CFLAGS_$(GARCH))
-EXTRA_CFLAGS_sparc = -xO4 -xstrconst $(COMMON_CFLAGS)
-EXTRA_CFLAGS_i386 = -xO3 -nofstore -xregs=no%frameptr $(COMMON_CFLAGS)
+EXTRA_MERGE_EXCLUDE_FILES += $(prefix)/mysql-test.*
+EXTRA_MERGE_EXCLUDE_FILES += $(prefix)/sql-bench.*
 
-EXTRA_CXXFLAGS = $(EXTRA_CXXFLAGS_$(GARCH))
-EXTRA_CXXFLAGS_sparc = -xO4 $(COMMON_CFLAGS)
-EXTRA_CXXFLAGS_i386 = -xO3 -nofstore -xregs=no%frameptr $(COMMON_CFLAGS)
+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
+# PATCHFILES += 0004-looking-for-ps-use-basename-0.patch
+# Perhaps using sed would be better, but we have a patch for now.
+# PATCHFILES += 0006-Use-my_print_defaults-$(BASE_VERSION).patch
+# PATCHFILES += 0007-versioned-mysqld-during-db-init-5.1.patch
+# PATCHFILES += 0008-versioned-datadir-in-mysql_install_db-5.1.patch
 
-
-CSW$(NAME)devel_programs += mysql_config
-
 # Enable 64 bits build
 BUILD64 = 1
 
-PKGFILES_CSW$(NAME)bench   = $(prefix)/sql-bench.*
-PKGFILES_CSW$(NAME)client  = $(bindir)
-PKGFILES_CSW$(NAME)client += $(foreach bin_name,$(CSW$(NAME)client_programs),$(call baseisadirs,$(bindir),$(bin_name)))
-PKGFILES_CSW$(NAME)client += $(foreach bin_name,$(CSW$(NAME)client_programs),$(mandir)/man1/$(bin_name)\.1)
-PKGFILES_CSW$(NAME)client += $(foreach bin_name,$(CSW$(NAME)client_programs),/opt/csw/bin/$(bin_name))
-PKGFILES_CSW$(NAME)client += $(foreach bin_name,$(CSW$(NAME)client_programs),/opt/csw/sbin/$(bin_name))
-PKGFILES_CSW$(NAME)devel  += $(foreach bin_name,$(CSW$(NAME)devel_programs),$(call baseisadirs,$(bindir),$(bin_name)))
-PKGFILES_CSW$(NAME)devel  += $(foreach bin_name,$(CSW$(NAME)devel_programs),$(mandir)/man1/$(bin_name)\.1)
-PKGFILES_CSW$(NAME)devel  += $(foreach bin_name,$(CSW$(NAME)devel_programs),/opt/csw/bin/$(bin_name))
-PKGFILES_CSW$(NAME)devel  += $(foreach bin_name,$(CSW$(NAME)devel_programs),/opt/csw/sbin/$(bin_name))
-PKGFILES_CSW$(NAME)devel  += $(mandir)/man1/mysql_config\.1
-PKGFILES_CSW$(NAME)devel  += $(prefix)/include.*
-PKGFILES_CSW$(NAME)devel  += /opt/csw/include/mysql
+# EXTRA_CFLAGS = $(EXTRA_CFLAGS_$(GARCH))
+# EXTRA_CFLAGS_sparc = -xO4 -xstrconst $(COMMON_CFLAGS)
+# EXTRA_CFLAGS_i386 = -xO3 -nofstore -xregs=no%frameptr $(COMMON_CFLAGS)
+# EXTRA_CXXFLAGS = $(EXTRA_CXXFLAGS_$(GARCH))
+# EXTRA_CXXFLAGS_sparc = -xO4 $(COMMON_CFLAGS)
+# EXTRA_CXXFLAGS_i386 = -xO3 -nofstore -xregs=no%frameptr $(COMMON_CFLAGS)
+# COMMON_CFLAGS = -mt -fsimple=1 -ftrap=%none -xbuiltin=%all -xlibmil -xlibmopt
+# 
+EXTRA_CFLAGS = -mt -D_POSIX_C_SOURCE=199506L -D__EXTENSIONS__
+EXTRA_CXXFLAGS = -mt -D_POSIX_C_SOURCE=199506L -D__EXTENSIONS__
 
-PKGFILES_CSW$(NAME)rt      = $(libdir)
-PKGFILES_CSW$(NAME)rt     += $(libdir)/.*
-PKGFILES_CSW$(NAME)test    = $(prefix)/mysql-test.*
-
-RUNTIME_DEP_PKGS_CSW$(NAME)           += CSW$(NAME)client
-RUNTIME_DEP_PKGS_CSW$(NAME)           += CSW$(NAME)rt
-RUNTIME_DEP_PKGS_CSW$(NAME)           += CSWosslrt
-RUNTIME_DEP_PKGS_CSW$(NAME)           += CSWtcpwrap
-RUNTIME_DEP_PKGS_CSW$(NAME)           += CSWzlib
-RUNTIME_DEP_PKGS_CSW$(NAME)rt         += CSWosslrt
-RUNTIME_DEP_PKGS_CSW$(NAME)rt         += CSWzlib
-RUNTIME_DEP_PKGS_CSW$(NAME)bench      += CSWperl
-RUNTIME_DEP_PKGS_CSW$(NAME)client     += CSW$(NAME)rt
-RUNTIME_DEP_PKGS_CSW$(NAME)client     += CSWosslrt
-RUNTIME_DEP_PKGS_CSW$(NAME)client     += CSWncurses
-RUNTIME_DEP_PKGS_CSW$(NAME)client     += CSWzlib
-RUNTIME_DEP_PKGS_CSW$(NAME)test       += CSWperl
-
-MASTER_SITES = ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-$(BASE_VERSION)/
+MASTER_SITES = http://ftp.heanet.ie/mirrors/www.mysql.com/Downloads/MySQL-$(BASE_VERSION)/
 DISTFILES  = mysql-$(VERSION).tar.gz
-DISTFILES += csw$(NAME) quick_start-csw README.CSW ChangeLog
+DISTFILES += csw$(NAME).tpl
+DISTFILES += quick_start-csw
+DISTFILES += README.CSW
+DISTFILES += ChangeLog
 DISTFILES += CSW$(NAME).preinstall
 DISTFILES += CSW$(NAME).postinstall
 DISTFILES += cswusergroup
 
-UFILES_REGEX = mysql-(\d+(?:\.\d+)*).tar.gz
-
 # TODO: Do the proper prerequsite pkgs.
 BUILD_DEP_PKGS = $(RUNTIME_DEP_PKGS)
 
-# MySQL-5.1.40 doesn't compile without setting EXTRA_INC.
-EXTRA_INC = /opt/csw/include
-EXTRA_LIB = /opt/csw/lib
 
-# We're building on Solaris 9 now.
-# # The following EXTRA_CFLAGS are necessary to compile on Solaris 8. Otherwise
-# # the following problem occurs:
-# #
-# # "handler/i_s.cc", line 159: Error: The function "localtime_r" must have a
-# # prototype.
-# EXTRA_CFLAGS = -mt -D_POSIX_C_SOURCE=199506L -D__EXTENSIONS__
-# EXTRA_CXXFLAGS = -mt -D_POSIX_C_SOURCE=199506L -D__EXTENSIONS__
-
-# TBD: MySQL 5.5 uses CMake :-(
-
 # Set ./configure options
 CONFIGURE_ARGS  = $(DIRPATHS)
 CONFIGURE_ARGS += --disable-assembler
@@ -176,8 +170,8 @@
 CONFIGURE_ARGS += --with-low-memory
 CONFIGURE_ARGS += --with-pthread
 CONFIGURE_ARGS += --with-readline
-CONFIGURE_ARGS += --with-zlib-dir=/opt/csw
-CONFIGURE_ARGS += --with-ssl=/opt/csw
+CONFIGURE_ARGS += --with-zlib-dir=$(BUILD_PREFIX)
+CONFIGURE_ARGS += --with-ssl=$(BUILD_PREFIX)
 CONFIGURE_ARGS += --with-plugins=max-no-ndb
 CONFIGURE_ARGS += --with-comment="(OpenCSW)"
 CONFIGURE_ARGS += --with-mysqld-user=mysql
@@ -188,13 +182,13 @@
 CONFIGURE_ARGS += --enable-thread-safe-client
 CONFIGURE_ARGS_DBG = --with-debug
 CONFIGURE_ARGS += $(CONFIGURE_ARGS_$(GARFLAVOR))
+CONFIGURE_ARGS += --program-suffix=-$(BASE_VERSION)
 
 # TODO: Make the tests pass. They don't at the moment.
 SKIPTEST ?= 1
 TEST_SCRIPTS = custom
 TEST_TARGETS = check
 
-
 USERGROUP = /etc/opt/csw/pkg/CSW$(NAME)/cswusergroup
 
 PROTOTYPE_MODIFIERS = dbdir
@@ -204,19 +198,87 @@
 PROTOTYPE_PERMS_dbdir = 0700
 PROTOTYPE_CLASS_dbdir = ugfiles
 
-CHECKPKG_OVERRIDES_CSWmysql51 += surplus-dependency|CSWmysql51client
-CHECKPKG_OVERRIDES_CSWmysql51rt += bad-rpath-entry
+CHECKPKG_OVERRIDES_CSW$(NAME) += surplus-dependency|CSW$(NAME)client
+CHECKPKG_OVERRIDES_CSW$(NAME)bench += file-with-bad-content
+CHECKPKG_OVERRIDES_CSW$(NAME)bench += surplus-dependency|CSW$(NAME)
+CHECKPKG_OVERRIDES_CSW$(NAME)test += file-with-bad-content
+CHECKPKG_OVERRIDES_CSW$(NAME)test += surplus-dependency|CSW$(NAME)
 
-# CHECKPKG_OVERRIDES_CSWmysql51 += init-file-missing-cswinitsmf-class|/etc/opt/csw/init.d/cswmysql51|class=none
-# CHECKPKG_OVERRIDES_CSWmysql51 += surplus-dependency|CSWmysql51client
+CHECKPKG_OVERRIDES_CSW$(NAME)client += file-with-bad-content|/usr/local|root$(prefix)/share/man/man1/mysqlaccess-$(BASE_VERSION).1
+# This could be reviewed.
+CHECKPKG_OVERRIDES_CSW$(NAME) += file-with-bad-content
 
+EXECUTABLES += comp_err
+EXECUTABLES += innochecksum
+EXECUTABLES += msql2mysql
+EXECUTABLES += my_print_defaults
+EXECUTABLES += myisam_ftdump
+EXECUTABLES += myisamchk
+EXECUTABLES += myisamlog
+EXECUTABLES += myisampack
+EXECUTABLES += mysql
+EXECUTABLES += mysql_client_test
+EXECUTABLES += mysql_convert_table_format
+EXECUTABLES += mysql_explain_log
+EXECUTABLES += mysql_find_rows
+EXECUTABLES += mysql_fix_extensions
+EXECUTABLES += mysql_fix_privilege_tables
+EXECUTABLES += mysql_install_db
+EXECUTABLES += mysql_secure_installation
+EXECUTABLES += mysql_setpermission
+EXECUTABLES += mysql_tableinfo
+EXECUTABLES += mysql_tzinfo_to_sql
+EXECUTABLES += mysql_upgrade
+EXECUTABLES += mysql_upgrade_shell
+EXECUTABLES += mysql_waitpid
+EXECUTABLES += mysql_zap
+EXECUTABLES += mysqlaccess
+EXECUTABLES += mysqladmin
+EXECUTABLES += mysqlbinlog
+EXECUTABLES += mysqlbug
+EXECUTABLES += mysqlcheck
+EXECUTABLES += mysqld_multi
+EXECUTABLES += mysqld_safe
+EXECUTABLES += mysqldump
+EXECUTABLES += mysqldumpslow
+EXECUTABLES += mysqlhotcopy
+EXECUTABLES += mysqlimport
+EXECUTABLES += mysqlshow
+EXECUTABLES += mysqltest
+EXECUTABLES += mysqltestmanager
+EXECUTABLES += mysqltestmanager-pwgen
+EXECUTABLES += mysqltestmanagerc
+EXECUTABLES += perror
+EXECUTABLES += replace
+EXECUTABLES += resolve_stack_dump
+EXECUTABLES += resolveip
 
+ALTERNATIVES_CSW$(NAME) = mysql$(BASE_VERSION)_main
+ALTERNATIVE_mysql$(BASE_VERSION)_main = $(bindir)/$(firstword $(EXECUTABLES)) mysql_main $(bindir)/$(firstword $(EXECUTABLES))-$(BASE_VERSION) $(ALTS_PRIO)
+ALTERNATIVE_mysql$(BASE_VERSION)_main += $(foreach C,$(wordlist 2,$(words $(EXECUTABLES)),$(EXECUTABLES)),\
+	$(bindir)/$C $C $(bindir)/$C-$(BASE_VERSION))
+
+ALTERNATIVES_CSW$(NAME)client = mysql$(BASE_VERSION)_client
+ALTERNATIVE_mysql$(BASE_VERSION)_client = $(bindir)/$(firstword $(client_programs)) mysql_client $(bindir)/$(firstword $(client_programs)) $(ALTS_PRIO)
+ALTERNATIVE_mysql$(BASE_VERSION)_client += $(foreach C,$(wordlist 2,$(words $(client_programs)),$(client_programs)),\
+	$(bindir)/$C $C $(bindir)/$C-$(BASE_VERSION))
+ALTERNATIVE_mysql$(BASE_VERSION)_client += $(foreach C,$(wordlist 2,$(words $(client_programs)),$(client_programs)),\
+	$(mandir)/man1/$(C).1 $C $(mandir)/man1/$(C)-$(BASE_VERSION).1)
+
+# These are harmless, although it would be nice to clean them up eventually.
+# Help appreciated?
+CHECKPKG_OVERRIDES_CSWmysql51 += file-collision|/opt/csw/share/doc/mysql5devel_stub/README.CSW|CSWmysql5|CSWmysql51
+CHECKPKG_OVERRIDES_CSWmysql51 += file-collision|/opt/csw/share/doc/mysql_dev/README.CSW|CSWmysql5|CSWmysql51
+CHECKPKG_OVERRIDES_CSWmysql51 += file-collision|/opt/csw/share/info/mysql.info|CSWmysql5|CSWmysql51
+
+CONFIGURE_SCRIPTS = custom
+
 include gar/category.mk
 
 CFLAGS := $(filter-out -I%,$(CFLAGS))
 
 test-custom:
-	alias sh=/usr/bin/bash;                                 \
+	alias sh=/usr/bin/bash;                           \
 		cd $(WORKSRC)/mysql-test;                       \
 		perl mysql-test-run.pl --mem --big-test --force \
 		--skip-test=archive-big --skip-test=/gis/
@@ -227,40 +289,54 @@
 	# libtool: definition of this LT_INIT comes from libtool 2.2.6b.
 	# libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6
 	# http://lists.opencsw.org/pipermail/maintainers/2009-December/005066.html
-	cd $(WORKSRC) && autoreconf --force --install --symlink
+	# cd $(WORKSRC) && autoreconf --force --install --symlink
 	@$(MAKECOOKIE)
 
+configure-custom:
+	(cd $(WORKSRC); cmake . -DCMAKE_INSTALL_PREFIX=$(prefix))
+	@$(MAKECOOKIE)
+
+post-configure-modulated:
+	gsed \
+		-e 's+ at prefix@+$(prefix)+' \
+		-e 's+ at localstatedir@+$(localstatedir)+' \
+		-e 's+ at sysconfdir@+$(sysconfdir)+' \
+		-e 's+ at bindir@+$(bindir)+' \
+		-e 's+ at BASE_VERSION@+$(BASE_VERSION)+' \
+		< $(WORKDIR)/csw$(NAME).tpl \
+		> $(WORKDIR)/csw$(NAME)
+	@$(MAKECOOKIE)
+
+post-install-modulated:
+	(cd $(DESTDIR)$(libdir); gmv -v mysql/* .)
+	(cd $(DESTDIR)$(libdir); grmdir -v mysql)
+	ginstall -m 755 -d $(DESTDIR)$(sysconfdir)/init.d
+	ginstall -m 755 $(WORKDIR)/csw$(NAME) $(DESTDIR)$(sysconfdir)/init.d
+	@$(MAKECOOKIE)
+
 post-merge:
 	ginstall -m 755 -d $(PKGROOT)$(localstatedir)
-	ginstall -m 755 -d $(PKGROOT)$(datadir)/mysql/doc
-	ginstall -m 644 $(FILEDIR)/ChangeLog $(PKGROOT)$(datadir)/mysql/doc
-	ginstall -m 644 $(FILEDIR)/README.CSW $(PKGROOT)$(datadir)/mysql/doc
-	ginstall -m 755 -d $(PKGROOT)/opt/csw/share/mysql/doc
-	ln -sf ../../../$(NAME)/share/mysql/doc/README.CSW \
-		$(PKGROOT)/opt/csw/share/mysql/doc/README.CSW
-	ginstall -m 755 -d $(PKGROOT)$(global_sysconfdir)/init.d
-	ginstall -m 755 $(FILEDIR)/csw$(NAME) $(PKGROOT)$(global_sysconfdir)/init.d
+	ginstall -m 755 -d $(PKGROOT)$(datadir)/$(NAME)/doc
+	ginstall -m 644 $(FILEDIR)/ChangeLog $(PKGROOT)$(datadir)/$(NAME)/doc
+	ginstall -m 644 $(FILEDIR)/README.CSW $(PKGROOT)$(datadir)/$(NAME)/doc
+	ginstall -m 755 -d $(PKGROOT)/opt/csw/share/$(NAME)/doc
+	gln -sf ../../../$(NAME)/share/$(NAME)/doc/README.CSW \
+		$(PKGROOT)/opt/csw/share/$(NAME)/doc/README.CSW
 	ginstall -m 755 $(FILEDIR)/quick_start-csw $(PKGROOT)$(datadir)/mysql
-	ginstall -m 755 -d $(PKGROOT)$(global_sysconfdir)/pkg/CSW$(NAME)
+	ginstall -m 755 -d $(PKGROOT)$(sysconfdir)/pkg/CSW$(NAME)
 	ginstall -m 644 $(FILEDIR)/cswusergroup \
-						$(PKGROOT)$(global_sysconfdir)/pkg/CSW$(NAME)
-	# A symlink for mysql5 include files
-	ginstall -m 755 -d $(PKGROOT)/opt/csw/include
-	ln -s ../$(NAME)/include/mysql $(PKGROOT)/opt/csw/include/mysql
+		        $(PKGROOT)$(sysconfdir)/pkg/CSW$(NAME)
 	# Create symlinks to binaries
-	ginstall -m 755 -d $(PKGROOT)$(global_bindir)
-	for f in $(PKGROOT)$(bindir)/*; do \
-		if echo $$f | grep amd64$$; then continue; fi; \
-		if echo $$f | grep sparcv9$$; then continue; fi; \
-		ln -s ../$(NAME)/bin/`basename $$f` \
-		      $(PKGROOT)$(global_bindir)/`basename $$f`; \
-	done
-	# /opt/csw/$(NAME)/lib/sparc9/mysql -- by GAR, it's logical
-	# /opt/csw/$(NAME)/lib/mysql/sparcv9 -- expected by other packages
-	gln -s ../$(ISA_DEFAULT64)/mysql $(PKGROOT)$(libdir)/mysql/$(ISA_DEFAULT64)
-	# For other applications to link against
-	gln -s $(ISA_DEFAULT64) $(PKGROOT)$(libdir)/64
-	gln -s $(ISA_DEFAULT64) $(PKGROOT)$(libdir)/mysql/64
-	gln -s . $(PKGROOT)$(libdir)/$(ISA_DEFAULT)
-	gln -s . $(PKGROOT)$(libdir)/mysql/$(ISA_DEFAULT)
+	# ginstall -m 755 -d $(PKGROOT)$(bindir)
+	#for f in $(PKGROOT)$(bindir)/*; do \
+	#	if echo $$f | grep amd64$$; then continue; fi; \
+	#	if echo $$f | grep sparcv9$$; then continue; fi; \
+	#	ln -s ../$(NAME)/bin/`basename $$f` \
+	#	      $(PKGROOT)$(bindir)/`basename $$f`; \
+	#done
+	# http://www.opencsw.org/bugtrack/view.php?id=4149
+	ginstall -m 755 -d $(PKGROOT)$(sysconfdir)
 	@$(MAKECOOKIE)
+
+# We need the GNU userland (nobody knows why)
+PATH := /opt/csw/gnu:$(PATH)

Modified: csw/mgar/pkg/mysql5/branches/mysql-5.5.x/checksums
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.5.x/checksums	2011-10-06 19:04:57 UTC (rev 15883)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.5.x/checksums	2011-10-06 21:53:50 UTC (rev 15884)
@@ -1 +1 @@
-701c0c44b7f1c2300adc0dc45729f903  mysql-5.5.9.tar.gz
+462ab3752dd666ec06ca32f92673b59e  mysql-5.5.16.tar.gz

Copied: csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/0004-looking-for-ps-use-basename-0.patch (from rev 15860, csw/mgar/pkg/mysql5/branches/mysql-5.1.x-optcsw/files/0004-looking-for-ps-use-basename-0.patch)
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/0004-looking-for-ps-use-basename-0.patch	                        (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/0004-looking-for-ps-use-basename-0.patch	2011-10-06 21:53:50 UTC (rev 15884)
@@ -0,0 +1,48 @@
+From 111c7574ea02e17df8b2aff8e1b94d6118024f7b Mon Sep 17 00:00:00 2001
+From: Maciej Blizinski <maciej at opencsw.org>
+Date: Wed, 28 Sep 2011 23:26:47 +0200
+Subject: [PATCH] looking for ps, use `basename $0`
+
+Upstream bug filed:
+http://bugs.mysql.com/bug.php?id=62567
+
+---
+ configure.in |   10 +++++-----
+ 1 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index cfae77d..8e6dd43 100644
+--- a/configure.in
++++ b/configure.in
+@@ -518,23 +518,23 @@ AC_PATH_PROG(PS, ps, ps)
+ AC_MSG_CHECKING("how to check if pid exists")
+ PS=$ac_cv_path_PS
+ # Linux style
+-if $PS wwwp $$ 2> /dev/null | grep -- "$0" > /dev/null
++if $PS wwwp $$ 2> /dev/null | grep -- "`basename $0`" > /dev/null
+ then
+   FIND_PROC="$PS wwwp \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
+ # Solaris
+-elif $PS -fp $$ 2> /dev/null | grep -- $0 > /dev/null
++elif $PS -fp $$ 2> /dev/null | grep -- `basename $0` > /dev/null
+ then
+   FIND_PROC="$PS -p \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
+ # BSD style
+-elif $PS -uaxww 2> /dev/null | grep -- $0 > /dev/null
++elif $PS -uaxww 2> /dev/null | grep -- `basename $0` > /dev/null
+ then
+   FIND_PROC="$PS -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
+ # SysV style
+-elif $PS -ef 2> /dev/null | grep -- $0 > /dev/null
++elif $PS -ef 2> /dev/null | grep -- `basename $0` > /dev/null
+ then
+   FIND_PROC="$PS -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
+ # Do anybody use this?
+-elif $PS $$ 2> /dev/null | grep -- $0 > /dev/null
++elif $PS $$ 2> /dev/null | grep -- `basename $0` > /dev/null
+ then
+   FIND_PROC="$PS \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
+ else
+-- 
+1.7.6.1
+

Deleted: csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql51.postinstall
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql51.postinstall	2011-10-06 19:04:57 UTC (rev 15883)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql51.postinstall	2011-10-06 21:53:50 UTC (rev 15884)
@@ -1,15 +0,0 @@
-#!/bin/sh
-#
-# $Id$
-#
-
-MYSQLDATADIR=/var/opt/csw/mysql51
-if [ ! -d "${MYSQLDATADIR}/mysql" ] ; then
-  echo "No database directory found in the default location:"
-  echo "${MYSQLDATADIR}/mysql"
-  echo "If you need to build the initial database directory,"
-  echo "  see /opt/csw/mysql5/share/mysql/quick_start-csw"
-  echo "If you are using a non-default database directory location,"
-  echo "  please start mysql manually."
-  exit 0
-fi

Deleted: csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql51.preinstall
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql51.preinstall	2011-10-06 19:04:57 UTC (rev 15883)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql51.preinstall	2011-10-06 21:53:50 UTC (rev 15884)
@@ -1,40 +0,0 @@
-#!/bin/sh
-# vim:set sw=2 ts=2 sts=2 expandtab:
-#
-# $Id$
-#
-
-obsolete_directories="/opt/csw/mysql51/var:/var/opt/csw/mysql51"
-
-obsolete_dir_information="
-This directory is obsolete.  Files in this directory are going to be ignored.
-Please move your data to the new location.
-
-Feel free to remove this file afterwards.
-"
-obsolete_dir_file_name="README.THIS_DIRECTORY_IS_OBSOLETE"
-
-for dirpair in ${obsolete_directories}; do
-  obsolete_dir=`echo ${dirpair} | cut -d: -f1`
-  new_dir=`echo ${dirpair} | cut -d: -f2`
-  if [ -d "${PKG_INSTALL_ROOT}${obsolete_dir}" ]; then
-    echo
-    echo "*******************************************************************"
-    echo "* The old configuration directory ${obsolete_dir} still exists.    "
-    echo "* Please move your configuration to ${new_dir}.                    "
-    echo "*                                                                  "
-    echo "*       Installation will continue in 10 seconds.                  "
-    echo "*         Press CTRL+C if you want to stop now.                    "
-    echo "*******************************************************************"
-    echo
-    sleep 10
-
-    # Leaving a note for the sysadmin if the they proceed with the installation.
-    fn="${PKG_INSTALL_ROOT}${obsolete_dir}/${obsolete_dir_file_name}"
-    if touch "${fn}" 2>/dev/null; then
-      echo "${obsolete_dir_information}" > "${fn}"
-    fi
-  fi
-done
-
-exit 0

Copied: csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql55.postinstall (from rev 11033, csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql51.postinstall)
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql55.postinstall	                        (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql55.postinstall	2011-10-06 21:53:50 UTC (rev 15884)
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# $Id$
+#
+
+MYSQLDATADIR=/var/opt/csw/mysql51
+if [ ! -d "${MYSQLDATADIR}/mysql" ] ; then
+  echo "No database directory found in the default location:"
+  echo "${MYSQLDATADIR}/mysql"
+  echo "If you need to build the initial database directory,"
+  echo "  see /opt/csw/mysql5/share/mysql/quick_start-csw"
+  echo "If you are using a non-default database directory location,"
+  echo "  please start mysql manually."
+  exit 0
+fi

Copied: csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql55.preinstall (from rev 11033, csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql51.preinstall)
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql55.preinstall	                        (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/CSWmysql55.preinstall	2011-10-06 21:53:50 UTC (rev 15884)
@@ -0,0 +1,40 @@
+#!/bin/sh
+# vim:set sw=2 ts=2 sts=2 expandtab:
+#
+# $Id$
+#
+
+obsolete_directories="/opt/csw/mysql51/var:/var/opt/csw/mysql51"
+
+obsolete_dir_information="
+This directory is obsolete.  Files in this directory are going to be ignored.
+Please move your data to the new location.
+
+Feel free to remove this file afterwards.
+"
+obsolete_dir_file_name="README.THIS_DIRECTORY_IS_OBSOLETE"
+
+for dirpair in ${obsolete_directories}; do
+  obsolete_dir=`echo ${dirpair} | cut -d: -f1`
+  new_dir=`echo ${dirpair} | cut -d: -f2`
+  if [ -d "${PKG_INSTALL_ROOT}${obsolete_dir}" ]; then
+    echo
+    echo "*******************************************************************"
+    echo "* The old configuration directory ${obsolete_dir} still exists.    "
+    echo "* Please move your configuration to ${new_dir}.                    "
+    echo "*                                                                  "
+    echo "*       Installation will continue in 10 seconds.                  "
+    echo "*         Press CTRL+C if you want to stop now.                    "
+    echo "*******************************************************************"
+    echo
+    sleep 10
+
+    # Leaving a note for the sysadmin if the they proceed with the installation.
+    fn="${PKG_INSTALL_ROOT}${obsolete_dir}/${obsolete_dir_file_name}"
+    if touch "${fn}" 2>/dev/null; then
+      echo "${obsolete_dir_information}" > "${fn}"
+    fi
+  fi
+done
+
+exit 0

Deleted: csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/cswmysql51
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/cswmysql51	2011-10-06 19:04:57 UTC (rev 15883)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/cswmysql51	2011-10-06 21:53:50 UTC (rev 15884)
@@ -1,183 +0,0 @@
-#!/bin/sh
-#
-# $Id$
-# Start script for 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/mysql51/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 mysql51rc still remains in this startup script.
-#
-
-RETVAL=0
-MYSQLHOME=/opt/csw/mysql51
-MYSQL_VAR=/var/opt/csw/mysql51
-MYSQLD_DATADIR=$MYSQL_VAR
-MYSQLD_PID_FILE=$MYSQL_VAR/mysql.pid
-CONFFILE=$MYSQL_VAR/my.cnf
-
-#
-# Source configuration
-[ -r /opt/csw/mysql51/etc/mysql51rc ] && . /opt/csw/mysql51/etc/mysql51rc
-[ -r /etc/opt/csw/mysql51rc ] && . /etc/opt/csw/mysql51rc
-
-# To get started quickly, copy a sample configuration file from
-#   $MYSQLHOME/share/mysql
-# For example,
-#  cp /opt/csw/mysql51/share/mysql/my-medium.cnf /opt/csw/mysql51/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"$MYSQL_VAR/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 "$MYSQL_VAR/mysql" -a ! -d "$MYSQLD_DATADIR/mysql" ] ; then
-    MYSQLD_DATADIR=
-fi
-
-# Make sure required vars are set
-MYSQLD_PID_FILE=${MYSQLD_PID_FILE:=$MYSQL_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/mysql51/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.5.x/files/cswmysql55.tpl (from rev 11033, csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/cswmysql51)
===================================================================
--- csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/cswmysql55.tpl	                        (rev 0)
+++ csw/mgar/pkg/mysql5/branches/mysql-5.5.x/files/cswmysql55.tpl	2011-10-06 21:53:50 UTC (rev 15884)
@@ -0,0 +1,207 @@
+#!/bin/sh
+# vim:ft=sh:
+#
+# $Id$
+# Start script for 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/mysql55/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 mysql55rc still remains in this startup script.
+#
+
+RETVAL=0
+prefix="@prefix@"
+BASEDIR="${prefix}"
+BINDIR="@bindir@"
+MYSQL_VAR="@localstatedir@"
+sysconfdir="@sysconfdir@"
+BASE_VERSION="@BASE_VERSION@"
+MYSQLD_DATADIR=$MYSQL_VAR
+MYSQLD_PID_FILE=$MYSQL_VAR/mysql.pid
+CONFFILE=${sysconfdir}/my.cnf
+
+# Source the configuration
+[ -r /opt/csw/mysql5/etc/mysql5rc ] && . /opt/csw/mysql5/etc/mysql5rc
+[ -r @prefix@/etc/mysql5rc ] && . @prefix@/etc/mysql5rc
+[ -r /etc/opt/csw/mysql5rc ] && . /etc/opt/csw/mysql5rc
+
+if [ -r "${sysconfdir}/my.cnf" ]; then
+  MYSQL_HOME="${MYSQL_VAR}"
+elif [ -r "${BASEDIR}/my.cnf" ]; then
+  MYSQL_HOME="${BASEDIR}"
+fi
+export MYSQL_HOME
+
+# To get started quickly, copy a sample configuration file from
+#   $BASEDIR/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 [ "${CONFFILE}" = "${MYSQL_HOME}/my.cnf" \
+      -o \
+     "${CONFFILE}" = "${sysconfdir}/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 "$MYSQL_HOME/mysql" -a ! -d "$MYSQLD_DATADIR/mysql" ] ; then
+    MYSQLD_DATADIR=
+fi
+
+# Make sure required vars are set
+MYSQLD_PID_FILE=${MYSQLD_PID_FILE:=$MYSQL_HOME/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 "$BASEDIR/var/mysql" ] ; then
+    #        echo MySQL core database has not been created.
+    #         echo Creating it now...
+    #       $BASEDIR/bin/mysql_install_db
+    #       chown -R mysql:mysql $BASEDIR/var
+    #    fi
+
+    # 2006-04-16  --defaults-file is changed to --defaults-extra-file
+    ${BINDIR}/mysqld_safe-${BASE_VERSION} \
+        --mysqld-version=${BASE_VERSION} \
+        `[ -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 `pgrep_opts` 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
+}
+
+pgrep_opts() {
+  if [ -x /bin/zonename ]
+  then
+    echo "-z `/bin/zonename`"
+  fi
+}
+
+case $1 in
+    start)
+    start_it
+    ;;
+
+    stop)
+    stop_it
+    ;;
+
+    restart)
+    stop_it
+    while pgrep `pgrep_opts` mysqld > /dev/null
+      do
+      sleep 1
+    done
+    start_it
+    ;;
+
+    *)
+    echo "Usage: $0  { start | stop | restart } "
+    ;;
+esac
+
+exit $RETVAL

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