diff options
author | lenz@mysql.com <> | 2003-08-15 14:55:05 +0200 |
---|---|---|
committer | lenz@mysql.com <> | 2003-08-15 14:55:05 +0200 |
commit | 927dff6c47646adf6662a8adf6e8d95ad741ec46 (patch) | |
tree | 1a27cd05184cdda2d24bf39a49fe23aa23160992 /support-files/MacOSX | |
parent | ced77791a95424842281dad680aae08bd70cd7da (diff) | |
download | mariadb-git-927dff6c47646adf6662a8adf6e8d95ad741ec46.tar.gz |
- Added some files to support-files/MacOSX to enable building the Mac OS X
startup item: MySQL (the startup script), StartupItem.Description.plist,
StartupItem.Info.plist (PKGMaker control files), StartupItem.postinstall
(post-installation script for the Startup Item package)
- modified support-files/MacOSX/Makefile.am to include the newly added files
in the source distribution
Diffstat (limited to 'support-files/MacOSX')
-rw-r--r-- | support-files/MacOSX/Makefile.am | 6 | ||||
-rwxr-xr-x | support-files/MacOSX/MySQL | 46 | ||||
-rw-r--r-- | support-files/MacOSX/StartupItem.Description.plist | 15 | ||||
-rw-r--r-- | support-files/MacOSX/StartupItem.Info.plist | 42 | ||||
-rwxr-xr-x | support-files/MacOSX/StartupItem.postinstall | 36 |
5 files changed, 144 insertions, 1 deletions
diff --git a/support-files/MacOSX/Makefile.am b/support-files/MacOSX/Makefile.am index b8047942190..ff16fa3235a 100644 --- a/support-files/MacOSX/Makefile.am +++ b/support-files/MacOSX/Makefile.am @@ -22,7 +22,11 @@ EXTRA_DIST = Info.plist.sh \ StartupParameters.plist.sh \ postinstall.sh \ preinstall.sh \ - ReadMe.txt + ReadMe.txt \ + MySQL \ + StartupItem.Description.plist \ + StartupItem.Info.plist \ + StartupItem.postinstall pkgdata_DATA = Info.plist \ Description.plist \ diff --git a/support-files/MacOSX/MySQL b/support-files/MacOSX/MySQL new file mode 100755 index 00000000000..dfba5f8f982 --- /dev/null +++ b/support-files/MacOSX/MySQL @@ -0,0 +1,46 @@ +#!/bin/sh +# +# /Library/StartupItems/MySQL/MySQL +# +# A script to automatically start up MySQL on system bootup +# for Mac OS X. This is actually just a wrapper script around +# the standard mysql.server init script, which is included in +# the binary distribution. +# +# (c) 2003 MySQL AB +# Written by Lenz Grimmer <lenz@mysql.com> +# + +# Source the common setup functions for startup scripts +test -r /etc/rc.common || exit 1 +. /etc/rc.common + +# The path to the mysql.server init script. The official MySQL +# Mac OS X packages are being installed into /usr/local/mysql. +SCRIPT="/usr/local/mysql/support-files/mysql.server" + +StartService () +{ + if [ "${MYSQLCOM:=-NO-}" = "-YES-" ] ; then + ConsoleMessage "Starting MySQL database server" + $SCRIPT start > /dev/null 2>&1 + fi +} + +StopService () +{ + ConsoleMessage "Stopping MySQL database server" + $SCRIPT stop > /dev/null 2>&1 +} + +RestartService () +{ + ConsoleMessage "Restarting MySQL database server" + $SCRIPT restart > /dev/null 2>&1 +} + +if test -x $SCRIPT ; then + RunService "$1" +else + ConsoleMessage "Could not find MySQL startup script!" +fi diff --git a/support-files/MacOSX/StartupItem.Description.plist b/support-files/MacOSX/StartupItem.Description.plist new file mode 100644 index 00000000000..1f0023bde0d --- /dev/null +++ b/support-files/MacOSX/StartupItem.Description.plist @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IFPkgDescriptionDeleteWarning</key> + <string></string> + <key>IFPkgDescriptionDescription</key> + <string>This package enables MySQL to be started up automatically + on system bootup.</string> + <key>IFPkgDescriptionTitle</key> + <string>MySQL Startup Item</string> + <key>IFPkgDescriptionVersion</key> + <string>1.0</string> +</dict> +</plist> diff --git a/support-files/MacOSX/StartupItem.Info.plist b/support-files/MacOSX/StartupItem.Info.plist new file mode 100644 index 00000000000..6bcae9397e5 --- /dev/null +++ b/support-files/MacOSX/StartupItem.Info.plist @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleGetInfoString</key> + <string>MySQL Startup Item</string> + <key>CFBundleIdentifier</key> + <string>com.mysql.mysqlstartup</string> + <key>CFBundleName</key> + <string>MySQL Startup Item</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>IFMajorVersion</key> + <integer>1</integer> + <key>IFMinorVersion</key> + <integer>0</integer> + <key>IFPkgFlagAllowBackRev</key> + <false/> + <key>IFPkgFlagAuthorizationAction</key> + <string>RootAuthorization</string> + <key>IFPkgFlagDefaultLocation</key> + <string>/Library/StartupItems/</string> + <key>IFPkgFlagInstallFat</key> + <false/> + <key>IFPkgFlagIsRequired</key> + <false/> + <key>IFPkgFlagOverwritePermissions</key> + <true/> + <key>IFPkgFlagRelocatable</key> + <false/> + <key>IFPkgFlagRestartAction</key> + <string>NoRestart</string> + <key>IFPkgFlagRootVolumeOnly</key> + <true/> + <key>IFPkgFlagUpdateInstalledLanguages</key> + <false/> + <key>IFPkgFlagUseUserMask</key> + <false/> + <key>IFPkgFormatVersion</key> + <real>0.10000000149011612</real> +</dict> +</plist> diff --git a/support-files/MacOSX/StartupItem.postinstall b/support-files/MacOSX/StartupItem.postinstall new file mode 100755 index 00000000000..f6f6f46f211 --- /dev/null +++ b/support-files/MacOSX/StartupItem.postinstall @@ -0,0 +1,36 @@ +#!/bin/sh +# +# postinstall script for the MySQL Startup Item Installation package +# +# This script modifies /etc/hostconfig in the following ways: +# +# - On Mac OS X Server, it disables the startup of the default MySQL +# installation by changing the "MYSQL" start variable to "-NO-". +# - If not existent already, it adds a "MYSQLCOM" start variable, which +# defaults to "-YES-". An already existing MYSQLCOM variable will remain +# untouched. +# +# (c) 2003 MySQL AB +# Author: Lenz Grimmer <lenz@mysql.com> +# + +CONFFILE="/etc/hostconfig" +TMPFILE=`basename $CONFFILE` || exit 1 +TMPFILE=`mktemp -t $TMPFILE.tmp` || exit 1 + +test -e $CONFFILE || exit 1 + +# Disable the startup of the default MySQL installation that ships with +# Mac OS X Server to avoid conflicts with our installation on bootup +sed -e s/^MYSQL=-YES-/MYSQL=-NO-/g < $CONFFILE > $TMPFILE + +# Add our MYSQLCOM startup variable (enabled by default) +grep -q "^MYSQLCOM" $CONFFILE > /dev/null 2>&1 +if [ $? -ne 0 ] ; then + echo "MYSQLCOM=-YES-" >> $TMPFILE +fi + +# Install the modified file into the default location +cp -f $CONFFILE $CONFFILE~ || exit 1 +mv -f $TMPFILE $CONFFILE || echo "Error while installing new $CONFFILE!" +chmod 644 $CONFFILE |