Date: Tue, 10 Jan 2017 23:50:23 +0000 (UTC) From: Mark Felder <feld@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r431144 - in head/databases/percona57-server: . files Message-ID: <201701102350.v0ANoNke049054@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: feld Date: Tue Jan 10 23:50:22 2017 New Revision: 431144 URL: https://svnweb.freebsd.org/changeset/ports/431144 Log: databases/percona57-server: port improvements Fetch rc script and a few other improvements from the mysql80-server port. Modified: head/databases/percona57-server/Makefile head/databases/percona57-server/files/mysql-server.in head/databases/percona57-server/pkg-plist Modified: head/databases/percona57-server/Makefile ============================================================================== --- head/databases/percona57-server/Makefile Tue Jan 10 23:46:51 2017 (r431143) +++ head/databases/percona57-server/Makefile Tue Jan 10 23:50:22 2017 (r431144) @@ -3,7 +3,7 @@ PORTNAME?= percona DISTVERSION= 5.7.16-10 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= databases ipv6 MASTER_SITES= http://www.percona.com/downloads/Percona-Server-5.7/Percona-Server-${DISTVERSION}/source/tarball/:percona \ SF/boost/boost/1.59.0:boost @@ -27,6 +27,10 @@ SLAVEDIRS= databases/percona57-client \ USES= bison:build cmake compiler:c11 compiler:c++11-lib \ cpe libedit localbase perl5 shebangfix +MY_DBDIR= /var/db/mysql +MY_SECDIR= /var/db/mysql_secure +MY_TMPDIR= /var/db/mysql_tmpdir + DATADIR= ${LOCALBASE}/share/mysql DOCSDIR= ${LOCALBASE}/share/doc/mysql @@ -40,6 +44,7 @@ CMAKE_ARGS+= -DINSTALL_LAYOUT=FREEBSD \ -DINSTALL_LIBDIR="lib/mysql" \ -DINSTALL_MANDIR="man" \ -DINSTALL_MYSQLDATADIR="/var/db/mysql" \ + -DINSTALL_SECURE_FILE_PRIVDIR="${MY_SECDIR}" \ -DINSTALL_MYSQLSHAREDIR="share/mysql" \ -DINSTALL_MYSQLTESTDIR="share/mysql/tests" \ -DINSTALL_PLUGINDIR="lib/mysql/plugin" \ @@ -62,6 +67,14 @@ SHEBANG_FILES= scripts/*.pl* scripts/*.s .error You have `USE_MYSQL' variable defined either in environment or in make(1) arguments. Please undefine and try again. .endif +SUB_LIST= MY_DBDIR=${MY_DBDIR} \ + MY_SECDIR=${MY_SECDIR} \ + MY_TMPDIR=${MY_TMPDIR} + +PLIST_SUB= MY_DBDIR=${MY_DBDIR} \ + MY_SECDIR=${MY_SECDIR} \ + MY_TMPDIR=${MY_TMPDIR} + .ifdef CLIENT_ONLY # Client part USES+= libedit @@ -110,7 +123,10 @@ MANPAGES= my_print_defaults.1 myisam_ftd CMAKE_ARGS+= -DWITH_EMBEDDED_SERVER="ON" post-install: - @${MKDIR} ${STAGEDIR}/var/db/mysql + ${MKDIR} ${STAGEDIR}/var/db/mysql + ${MKDIR} ${STAGEDIR}${ETCDIR}/keyring + ${MKDIR} ${STAGEDIR}${MY_SECDIR} + ${MKDIR} ${STAGEDIR}${MY_TMPDIR} .endif post-patch: Modified: head/databases/percona57-server/files/mysql-server.in ============================================================================== --- head/databases/percona57-server/files/mysql-server.in Tue Jan 10 23:46:51 2017 (r431143) +++ head/databases/percona57-server/files/mysql-server.in Tue Jan 10 23:50:22 2017 (r431144) @@ -14,10 +14,12 @@ # mysql_limits (bool): Set to "NO" by default. # Set it to yes to run `limits -e -U mysql` # just before mysql starts. -# mysql_dbdir (str): Default to "/var/db/mysql" +# mysql_dbdir (str): Default to "%%MY_DBDIR%%" # Base database directory. +# mysql_confdir (str): Default to "%%ETCDIR%%" +# Base configuration directory. # mysql_optfile (str): Server-specific option file. -# Default to "${mysql_dbdir}/my.cnf". +# Default to "${mysql_confdir}/my.cnf". # mysql_pidfile (str): Custum PID file path and name. # Default to "${mysql_dbdir}/${hostname}.pid". # mysql_args (str): Custom additional arguments to be passed @@ -33,30 +35,45 @@ load_rc_config $name : ${mysql_enable="NO"} : ${mysql_limits="NO"} -: ${mysql_dbdir="/var/db/mysql"} +: ${mysql_dbdir="%%MY_DBDIR%%"} +: ${mysql_confdir="%%ETCDIR%%"} +if [ -f "${mysql_dbdir}/my.cnf" ]; then : ${mysql_optfile="${mysql_dbdir}/my.cnf"} +else +: ${mysql_optfile="${mysql_confdir}/my.cnf"} +fi mysql_user="mysql" mysql_limits_args="-e -U ${mysql_user}" : ${hostname:=`/bin/hostname`} pidfile=${mysql_pidfile:-"${mysql_dbdir}/${hostname}.pid"} command="/usr/sbin/daemon" -command_args="-c -f %%PREFIX%%/bin/mysqld_safe --defaults-extra-file=${mysql_optfile} --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args}" +command_args="-c -f %%PREFIX%%/bin/mysqld_safe --defaults-extra-file=${mysql_optfile} --basedir=%%PREFIX%% --datadir=${mysql_dbdir} --pid-file=${pidfile} --user=${mysql_user} ${mysql_args}" procname="%%PREFIX%%/libexec/mysqld" start_precmd="${name}_prestart" start_postcmd="${name}_poststart" mysql_install_db="%%PREFIX%%/bin/mysql_install_db" -mysql_install_db_args="--basedir=%%PREFIX%% --datadir=${mysql_dbdir} --defaults-extra-file=${mysql_optfile} --force" +mysql_install_db_args="--defaults-extra-file=${mysql_optfile} --basedir=%%PREFIX%% --datadir=${mysql_dbdir} --mysqld-file=${procname} --user=${mysql_user}" mysql_create_auth_tables() { eval $mysql_install_db $mysql_install_db_args >/dev/null 2>/dev/null - [ $? -eq 0 ] && chown -R ${mysql_user}:${mysql_user} ${mysql_dbdir} } mysql_prestart() { - if [ ! -d "${mysql_dbdir}/mysql/." ]; then + if [ -f "${mysql_dbdir}/my.cnf" ]; then + echo "" + echo "Please keep in mind that the default location for my.cnf has changed" + echo "from \"%%MY_DBDIR%%/my.cnf\" to \"%%ETCDIR%%/my.cnf\". " + echo "Please merge your existing my.cnf with the new default and move" + echo "it to \"%%ETCDIR%%/my.cnf\"." + echo "If you do not want to move your my.cnf to the new location then" + echo "you must set \"mysql_optfile\" in /etc/rc.conf to \"/var/db/mysql/my.cnf\"." + echo "" + fi + + if [ ! -d "${mysql_dbdir}/mysql" ]; then mysql_create_auth_tables || return 1 fi if checkyesno mysql_limits; then Modified: head/databases/percona57-server/pkg-plist ============================================================================== --- head/databases/percona57-server/pkg-plist Tue Jan 10 23:46:51 2017 (r431143) +++ head/databases/percona57-server/pkg-plist Tue Jan 10 23:50:22 2017 (r431144) @@ -177,3 +177,6 @@ man/man8/mysqld.8.gz %%TOKUDB%%share/doc/mysql/PATENTS %%TOKUDB%%share/doc/mysql/README.md %%TOKUDB%%share/doc/mysql/README_tokudb_backup +@dir(mysql,mysql,0750) %%ETCDIR%%/keyring +@dir(mysql,mysql,0750) %%MY_SECDIR%% +@dir(mysql,mysql,0750) %%MY_TMPDIR%%
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701102350.v0ANoNke049054>