pkgsrc/databases/mysql57-client/Makefile.common
adam 45a161ed03 Changes 5.7.17:
Compilation Notes
-----------------
For GCC versions higher than 4.4, -fno-expensive-optimizations was replaced with -ffp-contract=off, which has the effect of enabling more optimizations.

Security Notes
--------------
Incompatible Change: These changes were made to mysqld_safe:
* Unsafe use of rm and chown in mysqld_safe could result in privilege escalation. chown now can be used only when the target directory is /var/log. An incompatible change is that if the directory for the Unix socket file is missing, it is no longer created; instead, an error occurs. Due to these changes, /bin/bash is required to run mysqld_safe on Solaris. /bin/sh is still used on other Unix/Linux platforms.
* The --ledir option now is accepted only on the command line, not in option files.
* mysqld_safe ignores the current working directory.

Other related changes:
* Initialization scripts that invoke mysqld_safe pass --basedir explicitly.
* Initialization scripts create the error log file only if the base directory is /var/log or /var/lib.
* Unused systemd files for SLES were removed.

* MySQL Server now includes a plugin library that enables administrators to introduce an increasing delay in server response to clients after a certain number of consecutive failed connection attempts. This capability provides a deterrent that slows down brute force attacks that attempt to access MySQL user accounts. For more information, see The Connection-Control Plugin.

* OpenSSL is ending support for version 1.0.1 in December 2016; see https://www.openssl.org/policies/releasestrat.html. Consequently, MySQL Commercial Server builds now use version 1.0.2 rather than version 1.0.1, and the linked OpenSSL library for the MySQL Commercial Server has been updated from version 1.0.1 to version 1.0.2j. For a description of issues fixed in this version, see https://www.openssl.org/news/vulnerabilities.html.

This change does not affect the Oracle-produced MySQL Community build of MySQL Server, which uses the yaSSL library instead.
2016-12-12 19:18:40 +00:00

129 lines
4 KiB
Text

# $NetBSD: Makefile.common,v 1.3 2016/12/12 19:19:42 adam Exp $
#
# used by databases/mysql57-client/Makefile
# used by databases/mysql57-server/Makefile
DISTNAME= mysql-5.7.17
CATEGORIES= databases
MASTER_SITES= ${MASTER_SITE_MYSQL:=MySQL-5.7/}
MAINTAINER?= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.mysql.com/
LICENSE= gnu-gpl-v2
DISTINFO_FILE?= ${.CURDIR}/../../databases/mysql57-client/distinfo
PATCHDIR?= ${.CURDIR}/../../databases/mysql57-client/patches
USE_CMAKE= yes
USE_LANGUAGES= c c++
USE_TOOLS+= bash bison gmake perl:run
.include "../../mk/bsd.prefs.mk"
.include "options.mk"
# MYSQL_USER username of the database administrator
# MYSQL_GROUP group of the database administrator
# MYSQL_DATADIR home directory (location of the databases)
# MYSQL_PIDFILE process ID file
# MYSQL_CHARSET default character set
# MYSQL_EXTRA_CHARSET additional character set to be compiled in
MYSQL_USER?= mysql
MYSQL_GROUP?= mysql
MYSQL_DATADIR?= ${VARBASE}/mysql
MYSQL_PIDFILE?= ${MYSQL_DATADIR}/${HOST}.pid
MYSQL_CHARSET?= latin1
MYSQL_COLLATION?= latin1_swedish_ci
MYSQL_EXTRA_CHARSET?= all
PKG_USERS_VARS+= MYSQL_USER
PKG_GROUPS_VARS+= MYSQL_GROUP
CONFIG_SHELL= ${TOOLS_PATH.bash}
CFLAGS.IRIX+= -DIRIX5 -DNEEDS_BSTRING_H
BUILD_DEFS+= VARBASE
# paths
CMAKE_ARGS+= -DINSTALL_DOCDIR="share/doc/mysql"
CMAKE_ARGS+= -DINSTALL_DOCREADMEDIR="share/doc/mysql"
CMAKE_ARGS+= -DINSTALL_INCLUDEDIR="include/mysql"
CMAKE_ARGS+= -DINSTALL_INFODIR="info"
CMAKE_ARGS+= -DINSTALL_MANDIR="${PKGMANDIR}"
CMAKE_ARGS+= -DINSTALL_MYSQLSHAREDIR="share/mysql"
CMAKE_ARGS+= -DINSTALL_MYSQLTESTDIR="share/mysql/test"
CMAKE_ARGS+= -DINSTALL_PLUGINDIR="lib/mysql/plugin"
CMAKE_ARGS+= -DINSTALL_SBINDIR="sbin"
CMAKE_ARGS+= -DINSTALL_SCRIPTDIR="bin"
CMAKE_ARGS+= -DINSTALL_SQLBENCHDIR="share/mysql/sql-bench"
CMAKE_ARGS+= -DINSTALL_SUPPORTFILESDIR="share/mysql"
CMAKE_ARGS+= -DMYSQL_DATADIR=${MYSQL_DATADIR}
CMAKE_ARGS+= -DCMAKE_BUILD_TYPE=Release
CMAKE_ARGS+= -DWITH_BOOST="system"
CMAKE_ARGS+= -DWITH_LZ4="system"
CMAKE_ARGS+= -DWITH_SSL="system"
CMAKE_ARGS+= -DWITH_ZLIB="system"
CMAKE_ARGS+= -DDEFAULT_CHARSET=${MYSQL_CHARSET:Q}
CMAKE_ARGS+= -DDEFAULT_COLLATION=${MYSQL_COLLATION:Q}
CMAKE_ARGS+= -DWITH_EXTRA_CHARSETS=${MYSQL_EXTRA_CHARSET:Q}
# MySQL 5 depends on builtin functions enabled with i486 and later with GCC.
.if ${OPSYS} == "NetBSD" && !empty(MACHINE_ARCH:Mi386)
GNU_ARCH.i386= i486
CFLAGS+= -march=i486
.endif
CPPFLAGS+= -Dunix
CFLAGS+= -DUSE_OLD_FUNCTIONS # 3.23.x compat
#CFLAGS+= -D__STDC_FORMAT_MACROS=1 # always defined too late
.if ${OPSYS} != "Interix"
CFLAGS+= -fPIC -DPIC
CXXFLAGS+= -fPIC -DPIC
.endif
# Force HAVE_CURSES_H on Solaris since the configure script is broken
# and does not properly detect this, breaking the build later on. Also
# explicitly disable epoll support as it is Linux-specific.
CMAKE_ARGS.SunOS+= -DHAVE_SYS_EPOLL_H=NO
CFLAGS.SunOS+= -DHAVE_CURSES_H
CXXFLAGS.SunOS+= -DHAVE_CURSES_H
.include "../../mk/pthread.buildlink3.mk"
.if defined(PTHREAD_TYPE) && (${PTHREAD_TYPE} == "pth")
CFLAGS+= -DSIGNALS_DONT_BREAK_READ
CXXFLAGS+= -DSIGNALS_DONT_BREAK_READ
.endif
LDFLAGS+= ${COMPILER_RPATH_FLAG}${PREFIX}/lib/mysql
SUBST_CLASSES+= scr
SUBST_STAGE.scr= pre-configure
SUBST_FILES.scr= scripts/mysqld_safe.sh \
support-files/mysql.server.sh
SUBST_SED.scr= -e "s,chown,${CHOWN},g"
SUBST_SED.scr+= -e "s,/bin/sh,${RCD_SCRIPTS_SHELL},g"
SUBST_MESSAGE.scr= Fixing scripts.
# Don't use the base system "libedit" under NetBSD because MySQL expects
# an incompatible prototype for "rl_completion_entry_function".
.if ${OPSYS} == "NetBSD"
USE_BUILTIN.editline= no
.endif
.include "../../mk/readline.buildlink3.mk"
.if ${READLINE_TYPE} == "readline"
CMAKE_ARGS+= -DWITH_READLINE="system"
.else
CMAKE_ARGS+= -DWITH_EDITLINE="system"
.endif
.include "../../archivers/lz4/buildlink3.mk"
.include "../../devel/boost-libs/buildlink3.mk"
.include "../../devel/libevent/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../security/openssl/buildlink3.mk"