From ee6e95e539a07d7b34c07bcd8c4eb24380f05c20 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 19 Oct 2016 15:28:46 +0000 Subject: [PATCH] Add new port databases/percona-pam-for-mysql Percona PAM authentication plugin for MySQL. WWW: https://www.percona.com/ Differential Revision: https://reviews.freebsd.org/D8193 --- databases/Makefile | 1 + databases/percona-pam-for-mysql/Makefile | 27 +++++++++++++++++++ .../percona-pam-for-mysql/files/pam.conf | 12 +++++++++ databases/percona-pam-for-mysql/pkg-descr | 3 +++ databases/percona-pam-for-mysql/pkg-message | 7 +++++ databases/percona-pam-for-mysql/pkg-plist | 4 +++ databases/percona56-server/Makefile | 18 +++++++------ 7 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 databases/percona-pam-for-mysql/Makefile create mode 100644 databases/percona-pam-for-mysql/files/pam.conf create mode 100644 databases/percona-pam-for-mysql/pkg-descr create mode 100644 databases/percona-pam-for-mysql/pkg-message create mode 100644 databases/percona-pam-for-mysql/pkg-plist diff --git a/databases/Makefile b/databases/Makefile index 004153db644e..be47acb38d90 100644 --- a/databases/Makefile +++ b/databases/Makefile @@ -551,6 +551,7 @@ SUBDIR += pecl-pdo_user SUBDIR += pecl-rrd SUBDIR += pecl-tokyo_tyrant + SUBDIR += percona-pam-for-mysql SUBDIR += percona-toolkit SUBDIR += percona55-client SUBDIR += percona55-server diff --git a/databases/percona-pam-for-mysql/Makefile b/databases/percona-pam-for-mysql/Makefile new file mode 100644 index 000000000000..fb43d1d9f92c --- /dev/null +++ b/databases/percona-pam-for-mysql/Makefile @@ -0,0 +1,27 @@ +# Created by: Mark Felder +# $FreeBSD$ + +PORTNAME= percona +PKGNAMESUFFIX= -pam-for-mysql + +COMMENT= PAM plugin for MySQL + +MASTERDIR= ${.CURDIR}/../percona56-server + +PKGMESSAGE= ${.CURDIR}/pkg-message +PATCHDIR= ${MASTERDIR}/files +FILESDIR= ${.CURDIR}/files +PLIST= ${.CURDIR}/pkg-plist +DESCR= ${.CURDIR}/pkg-descr + +CMAKE_ARGS+= -DWITH_PAM=1 + +PLUGIN_ONLY= yes + +do-install: + (cd ${WRKSRC}/plugin/percona-pam-for-mysql && ${MAKE} ${MAKE_ARGS} install) + ${INSTALL_DATA} ${FILESDIR}/pam.conf ${STAGEDIR}${PREFIX}/etc/pam.d/mysqld.sample + +.include "${MASTERDIR}/Makefile" + +RUN_DEPENDS= # This plugin has no run dependencies. It should work with any desired mysql client/server. diff --git a/databases/percona-pam-for-mysql/files/pam.conf b/databases/percona-pam-for-mysql/files/pam.conf new file mode 100644 index 000000000000..0e75199574ba --- /dev/null +++ b/databases/percona-pam-for-mysql/files/pam.conf @@ -0,0 +1,12 @@ +# +# PAM configuration for the "mysqld" service +# + +# auth +auth include system + +# account +account include system + +# password +password include system diff --git a/databases/percona-pam-for-mysql/pkg-descr b/databases/percona-pam-for-mysql/pkg-descr new file mode 100644 index 000000000000..b6160274578a --- /dev/null +++ b/databases/percona-pam-for-mysql/pkg-descr @@ -0,0 +1,3 @@ +Percona PAM authentication plugin for MySQL. + +WWW: https://www.percona.com/ diff --git a/databases/percona-pam-for-mysql/pkg-message b/databases/percona-pam-for-mysql/pkg-message new file mode 100644 index 000000000000..74250b42fd4c --- /dev/null +++ b/databases/percona-pam-for-mysql/pkg-message @@ -0,0 +1,7 @@ +Documentation for using percona-pam-for-mysql authentication plugin can +be found at: + +https://www.percona.com/doc/percona-pam-for-mysql/index.html + +Please note that you need this plugin installed on both the client and +server for authentication to be successful. diff --git a/databases/percona-pam-for-mysql/pkg-plist b/databases/percona-pam-for-mysql/pkg-plist new file mode 100644 index 000000000000..45350d3e7caf --- /dev/null +++ b/databases/percona-pam-for-mysql/pkg-plist @@ -0,0 +1,4 @@ +@sample etc/pam.d/mysqld.sample +lib/mysql/plugin/auth_pam.so +lib/mysql/plugin/auth_pam_compat.so +lib/mysql/plugin/dialog.so diff --git a/databases/percona56-server/Makefile b/databases/percona56-server/Makefile index d6d363bf8671..e863a6a6e927 100644 --- a/databases/percona56-server/Makefile +++ b/databases/percona56-server/Makefile @@ -14,7 +14,8 @@ COMMENT?= Multithreaded SQL database (server) BROKEN_powerpc64= Does not build -SLAVEDIRS= databases/percona56-client +SLAVEDIRS= databases/percona56-client \ + databases/percona-pam-for-mysql USES= bison cmake perl5 shebangfix OPTIONS_DEFINE= OPENSSL FASTMTX INNODBMEMCACHED TOKUDB @@ -48,8 +49,7 @@ CMAKE_ARGS+= -DINSTALL_DOCDIR="share/doc/mysql" \ -DINSTALL_SQLBENCHDIR="share/mysql" \ -DINSTALL_SUPPORTFILESDIR="share/mysql" \ -DWITH_EDITLINE=system \ - -DWITH_LIBWRAP=1 \ - -DHAVE_PAM=0 + -DWITH_LIBWRAP=1 SHEBANG_FILES= scripts/*.pl* scripts/*.sh @@ -57,8 +57,14 @@ SHEBANG_FILES= scripts/*.pl* scripts/*.sh .error You have `USE_MYSQL' variable defined either in environment or in make(1) arguments. Please undefine and try again. .endif +.ifdef CLIENT_ONLY +# Client part +USES+= libedit +.elifdef PLUGIN_ONLY +# For building plugins (percona-pam-for-mysql, etc) +# Currently do nothing special +.else # MySQL-Server part -.if !defined(CLIENT_ONLY) USES+=mysql:56p CONFLICTS_INSTALL= mysql*-server-* \ @@ -83,9 +89,6 @@ CMAKE_ARGS+= -DWITH_EMBEDDED_SERVER="ON" post-install: @${MKDIR} ${STAGEDIR}/var/db/mysql - -.else -USES+= libedit .endif post-patch: @@ -108,5 +111,4 @@ IGNORE= unsupported on FreeBSD 9 or older .endif - .include