{
groupadd -f mysql
hv_useradd -c mysql -d /dev/null -g mysql -s /bin/false mysql
+}
+
+hvconfig()
+{
+ cd ${LFS_TMP}/${PACKAGE}
+
+ mkdir build
+ cd build
- CONFIGURE_OPTS="\
- ${CONFIGURE_OPTS} \
- --libexecdir=/usr/sbin \
- --localstatedir=/srv/mysql \
- --enable-thread-safe-client \
- --enable-assembler \
- --enable-local-infile \
- --with-unix-socket-path=/var/run/mysql/mysql.sock \
- --without-debug \
- --without-readline \
- --with-plugins=innobase,myisam \
- --with-extra-charsets=all \
- --with-ssl"
+ cmake -DCMAKE_INSTALL_PREFIX=/usr \
+ -DINSTALL_DOCDIR=share/doc/mysql \
+ -DINSTALL_DOCREADMEDIR=share/doc/mysql \
+ -DINSTALL_INCLUDEDIR=include/mysql \
+ -DINSTALL_INFODIR=share/info \
+ -DINSTALL_MANDIR=share/man \
+ -DINSTALL_MYSQLDATADIR=/srv/mysql \
+ -DINSTALL_MYSQLSHAREDIR=share/mysql \
+ -DINSTALL_MYSQLTESTDIR=share/mysql/test \
+ -DINSTALL_PLUGINDIR=lib/mysql \
+ -DINSTALL_SBINDIR=sbin \
+ -DINSTALL_SCRIPTDIR=bin \
+ -DINSTALL_SQLBENCHDIR=share/mysql/bench \
+ -DINSTALL_SUPPORTFILESDIR=share/mysql/support \
+ -DMYSQL_DATADIR=/srv/mysql \
+ -DMYSQL_UNIX_ADDR=/var/run/mysql/mysql.sock \
+ -DSYSCONFDIR=/etc \
+ -DWITH_PARTITION_STORAGE_ENGINE=OFF \
+ -DWITH_PERFSCHEMA_STORAGE_ENGINE=OFF \
+ -DWITH_READLINE=system \
+ -DWITH_SSL=system \
+ ..
}
hvbuild()
{
make
- make benchdir_root=/tmp/mysql-bench install
+
+ SEGMENTS="Client Server IniFiles ManPages SharedLibraries"
+ SEGMENTS="$SEGMENTS Development Documentation Info Readme"
+
+ for segment in $SEGMENTS; do
+ cmake -DCMAKE_INSTALL_COMPONENT=$segment -P cmake_install.cmake
+ done
+
+ unset SEGMENTS
}
hvbuild_post()
{
- rm -rf /tmp/mysql
- cd /usr/lib
- ln -v -sf mysql/libmysqlclient{,_r}.so* .
+ # Copying default configuration file:
+ install -v -m644 /usr/share/mysql/support/my-medium.cnf /etc/my.cnf
- # Copying default configuration file.
- install -v -m644 /usr/share/mysql/my-medium.cnf /etc/my.cnf
- sed -i -e s/^skip-federated/#skip-federated/ /etc/my.cnf
+ # Ensure binary logs are disabled:
+ sed -i 's/^log-bin/#log-bin/' /etc/my.cnf
- mysql_install_db --user=mysql
+ mysql_install_db --basedir=/usr --datadir=/srv/mysql --user=mysql
chgrp mysql /srv/mysql{,/test,/mysql}
- install -v -m750 -o mysql -g mysql -d /var/run/mysql
+ install -v -m755 -o mysql -g mysql -d /var/run/mysql
# Further configuration requires that the MySQL server be running
# (see cis-postinstall)