openbsd-ports/databases/mysql/pkg/INSTALL-server
brad 1f15fd42e7 upgrade to MySQL 3.23.38
- Also split the package into client and a server sub-package which
depends on the client portion. This allows for adding/removing the server
without needing to remove ports that might be dependent on the client
portion.
- innodb FLAVOR goes away and is replaced with the max FLAVOR like the
real MySQL distribution which gives us both Berkeley DB and InnoDB tables
for transaction support.
2001-06-02 20:18:43 +00:00

72 lines
1.5 KiB
Bash

#!/bin/sh
# $OpenBSD: INSTALL-server,v 1.1 2001/06/02 20:18:45 brad Exp $
#
# Pre/post-installation setup of MySQL
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
DB_DIR=${DB_DIR}
do_notice_pre_install()
{
echo
echo "+---------------"
echo "| You appear to already have a MySQL database directory in $DB_DIR"
echo "|"
echo "| The database directory has been preserved. If you want to start"
echo "| from the default database setup, you should perform these steps"
echo "| as root:"
echo "|"
echo "| rm -rf $DB_DIR"
echo "| $PREFIX/bin/mysql_install_db"
echo "|"
echo "+---------------"
echo
}
do_pre_install()
{
# Create mysql user and group
groupinfo -e mysql
if [ $? -eq 0 ]; then
echo "===> Using mysql group for MySQL"
else
echo "===> Creating mysql group"
groupadd mysql
fi
userinfo -e mysql
if [ $? -eq 0 ]; then
echo "===> Using mysql user for MySQL"
else
echo "===> Creating mysql user"
useradd -g mysql -d /nonexistent -c 'MySQL Account' -s /sbin/nologin mysql
fi
}
do_post_install()
{
$PREFIX/bin/mysql_install_db
}
# Verify/process the command
#
case $2 in
PRE-INSTALL)
if [ -d $DB_DIR ]; then
do_notice_pre_install $1
fi
do_pre_install
;;
POST-INSTALL)
if [ ! -d $DB_DIR ]; then
do_post_install
fi
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
;;
esac
exit 0