summaryrefslogtreecommitdiff
path: root/support-files/MacOSX/preflight.sh
diff options
context:
space:
mode:
Diffstat (limited to 'support-files/MacOSX/preflight.sh')
-rw-r--r--support-files/MacOSX/preflight.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/support-files/MacOSX/preflight.sh b/support-files/MacOSX/preflight.sh
new file mode 100644
index 00000000000..700d0640a9e
--- /dev/null
+++ b/support-files/MacOSX/preflight.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# preflight - this script will be executed before the MySQL PKG
+# installation will be performed.
+#
+# If this package has been compiled with a prefix ending with "mysql" (e.g.
+# /usr/local/mysql or /opt/mysql), it will rename any previously existing
+# directory with this name before installing the new package (which includes
+# a symlink named "mysql", pointing to the newly installed directory, which
+# is named mysql-<version>)
+#
+
+PREFIX="@prefix@"
+BASENAME=`basename $PREFIX`
+
+if [ -d $PREFIX -a ! -L $PREFIX -a $BASENAME = "mysql" ] ; then
+ mv $PREFIX $PREFIX.bak
+fi