Date: Fri, 29 Mar 2024 16:23:49 GMT From: Ryan Steinmetz <zi@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: e0cf1d89c0ea - main - databases/proxysql: New port! Message-ID: <202403291623.42TGNnSH096167@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by zi: URL: https://cgit.FreeBSD.org/ports/commit/?id=e0cf1d89c0ea475fdaf82dfce2d27c23b743dd3d commit e0cf1d89c0ea475fdaf82dfce2d27c23b743dd3d Author: Ryan Steinmetz <zi@FreeBSD.org> AuthorDate: 2024-03-29 16:23:00 +0000 Commit: Ryan Steinmetz <zi@FreeBSD.org> CommitDate: 2024-03-29 16:23:00 +0000 databases/proxysql: New port! ProxySQL is a high performance, high availability, protocol aware proxy for MySQL and forks (like Percona Server and MariaDB). With its ability to intelligently route queries, balance loads, and provide failover handling, ProxySQL empowers organizations to harness the full potential of their database infrastructure. Whether grappling with scalability challenges, striving to enhance performance, or seeking to ensure high availability, ProxySQL emerges as a versatile ally, capable of addressing diverse needs across various database environments. WWW: https://www.proxysql.com/ --- databases/Makefile | 1 + databases/proxysql/Makefile | 80 ++++++++++++++++++++++++ databases/proxysql/distinfo | 3 + databases/proxysql/files/proxysql.conf | 2 + databases/proxysql/files/proxysql.conf-newsyslog | 1 + databases/proxysql/files/proxysql.in | 62 ++++++++++++++++++ databases/proxysql/pkg-descr | 9 +++ databases/proxysql/pkg-message | 9 +++ databases/proxysql/pkg-plist | 10 +++ 9 files changed, 177 insertions(+) diff --git a/databases/Makefile b/databases/Makefile index 3a97008d17a3..e196510964d4 100644 --- a/databases/Makefile +++ b/databases/Makefile @@ -696,6 +696,7 @@ SUBDIR += proftpd-mod_sql_sqlite SUBDIR += proftpd-mod_sql_tds SUBDIR += prometheus-postgresql-adapter + SUBDIR += proxysql SUBDIR += pspg SUBDIR += puppetdb-terminus7 SUBDIR += puppetdb-terminus8 diff --git a/databases/proxysql/Makefile b/databases/proxysql/Makefile new file mode 100644 index 000000000000..b611737d97d8 --- /dev/null +++ b/databases/proxysql/Makefile @@ -0,0 +1,80 @@ +PORTNAME= proxysql +PORTVERSION= 2.6.1 +CATEGORIES= databases + +MAINTAINER= zi@FreeBSD.org +COMMENT= High performance, high availability, protocol-aware proxy for MySQL +WWW= https://www.proxysql.com/ + +LICENSE= GPLv3 +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= aclocal:devel/automake \ + autoreconf:devel/autoconf \ + bash:shells/bash \ + cmake:devel/cmake-core \ + ${LOCALBASE}/bin/grep:textproc/gnugrep \ + libgcrypt>0:security/libgcrypt \ + libtoolize:devel/libtool \ + e2fsprogs-libuuid>0:misc/e2fsprogs-libuuid \ + gnutls>0:security/gnutls +RUN_DEPENDS= libgcrypt>0:security/libgcrypt \ + e2fsprogs-libuuid>0:misc/e2fsprogs-libuuid \ + gnutls>0:security/gnutls + +USES= compiler:gcc-c++11-lib gmake libtool perl5 python:build shebangfix +USE_PERL5= build +USE_GCC= yes +MAKE_ENV= GIT_VERSION=${PORTVERSION} +USE_GITHUB= yes +ALL_TARGET= build_deps default +SHEBANG_FILES= deps/libssl/verify-bio_st-match.sh +MAKE_JOBS_UNSAFE=yes +LDFLAGS+= -L${LOCALBASE}/lib +CFLAGS+= -fPIC +CXXFLAGS+= -fPIC +BINARY_ALIAS= python3=${PYTHON_CMD} +USE_RC_SUBR= ${PORTNAME} + +USERS= ${PORTNAME} +GROUPS= ${PORTNAME} + +GH_ACCOUNT= sysown + +post-patch: + @${REINPLACE_CMD} -e 's,/etc/,${ETCDIR}/,g' ${WRKSRC}/lib/ProxySQL_GloVars.cpp + @${REINPLACE_CMD} \ + -e 's|strftime(__buffer, 25, "%Y-%m-%d %H:%M:%S", __tm_info);|snprintf(__buffer, 3, "%s", "");|g' \ + -e 's,"%s \[,"%s\[,g' \ + -e '/__timer/d' \ + -e '/__tm_info/d' \ + ${WRKSRC}/include/proxysql_debug.h + @${REINPLACE_CMD} \ + -e 's,/var/lib,/var/db,g' \ + -e '7s/^/errorlog="\/var\/log\/proxysql\/proxysql-error.log"\n\n/g' \ + -e '7s/^/pid="\/var\/run\/${PORTNAME}\/${PORTNAME}.pid"\n/g' \ + ${WRKSRC}/src/proxysql.cfg + @${REINPLACE_CMD} \ + -e 's,grep,${LOCALBASE}/bin/grep,g' \ + -e 's,ln -fsT,ln -fs,' \ + -e 's,PROXYSQLCLICKHOUSE=1 ,,g' \ + ${WRKSRC}/Makefile ${WRKSRC}/deps/Makefile \ + ${WRKSRC}/lib/Makefile ${WRKSRC}/src/Makefile + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/src/proxysql ${STAGEDIR}${LOCALBASE}/sbin + +post-install: + ${MKDIR} ${STAGEDIR}${ETCDIR} ${STAGEDIR}/var/db/${PORTNAME} \ + ${STAGEDIR}/var/run/${PORTNAME} \ + ${STAGEDIR}${LOCALBASE}/etc/syslog.d \ + ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d \ + ${STAGEDIR}/var/log/${PORTNAME} + ${INSTALL_DATA} ${FILESDIR}/${PORTNAME}.conf \ + ${STAGEDIR}${LOCALBASE}/etc/syslog.d + ${INSTALL_DATA} ${FILESDIR}/proxysql.conf-newsyslog \ + ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d/proxysql.conf.sample + ${INSTALL_DATA} ${WRKSRC}/src/proxysql.cfg \ + ${STAGEDIR}${ETCDIR}/proxysql.cfg.sample + +.include <bsd.port.mk> diff --git a/databases/proxysql/distinfo b/databases/proxysql/distinfo new file mode 100644 index 000000000000..663665b2cd2a --- /dev/null +++ b/databases/proxysql/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1711406812 +SHA256 (sysown-proxysql-2.6.1_GH0.tar.gz) = b4021fd4bd27ef2c506da91396ed995fa1d6ee8f3d421fcb200331716f9a8979 +SIZE (sysown-proxysql-2.6.1_GH0.tar.gz) = 50028685 diff --git a/databases/proxysql/files/proxysql.conf b/databases/proxysql/files/proxysql.conf new file mode 100644 index 000000000000..68fbfbcf23e8 --- /dev/null +++ b/databases/proxysql/files/proxysql.conf @@ -0,0 +1,2 @@ +!proxysql +*.* /var/log/proxysql.log diff --git a/databases/proxysql/files/proxysql.conf-newsyslog b/databases/proxysql/files/proxysql.conf-newsyslog new file mode 100644 index 000000000000..8a51ca3a6927 --- /dev/null +++ b/databases/proxysql/files/proxysql.conf-newsyslog @@ -0,0 +1 @@ +/var/log/proxysql.log root:wheel 640 10 1000 * JC diff --git a/databases/proxysql/files/proxysql.in b/databases/proxysql/files/proxysql.in new file mode 100644 index 000000000000..781d5b4bdf1f --- /dev/null +++ b/databases/proxysql/files/proxysql.in @@ -0,0 +1,62 @@ +#!/bin/sh + +# PROVIDE: proxysql +# REQUIRE: LOGIN mysql +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# proxysql_enable (bool): Set to NO by default. +# Set it to YES to enable proxysql. +# proxysql_user (string): Set user that proxysql will run under +# Default is "proxysql". +# proxysql_group (string): Set group that proxysql will run under +# Default is "proxysql". +# proxysql_config (string): Set path to config file +# Default is "%%ETCDIR%%/proxysql.cfg". +# proxysql_args (string): Set extra arguments to pass to proxysql +# Default is "". + +. /etc/rc.subr + +name=proxysql +rcvar=proxysql_enable + +load_rc_config $name + +: ${proxysql_enable:="NO"} +: ${proxysql_user:="proxysql"} +: ${proxysql_group:="proxysql"} +: ${proxysql_config:="%%ETCDIR%%/proxysql.cfg"} +: ${proxysql_socket:="/var/run/proxysql/proxysql.sock"} +: ${proxysql_datadir:="/var/db/proxysql"} +: ${proxysql_args:=""} +: ${proxysql_restart_delay:="10"} + + +pidfile="/var/run/proxysql/proxysql.pid" +command="/usr/sbin/daemon" +proxysql_command="%%PREFIX%%/sbin/proxysql" +command_args="-rP ${pidfile} -S -R ${proxysql_restart_delay} \ + -T ${name} ${proxysql_command} \ + -f -c ${proxysql_config} -S ${proxysql_socket} \ + -D ${proxysql_datadir} \ + --no-version-check ${proxysql_args}" +required_files="${proxysql_config}" +extra_commands="reload initialize" +reload_cmd=proxysql_reload +initialize_cmd=proxysql_initialize + +proxysql_initialize() +{ + su -m ${proxysql_user} -c "${proxysql_command} --initial" +} + +proxysql_reload() +{ + su -m ${proxysql_user} -c "${proxysql_command} --reload" +} + +load_rc_config $name +run_rc_command "$1" diff --git a/databases/proxysql/pkg-descr b/databases/proxysql/pkg-descr new file mode 100644 index 000000000000..265692c0bee4 --- /dev/null +++ b/databases/proxysql/pkg-descr @@ -0,0 +1,9 @@ +ProxySQL is a high performance, high availability, protocol aware proxy for +MySQL and forks (like Percona Server and MariaDB). + +With its ability to intelligently route queries, balance loads, and provide +failover handling, ProxySQL empowers organizations to harness the full +potential of their database infrastructure. Whether grappling with +scalability challenges, striving to enhance performance, or seeking to +ensure high availability, ProxySQL emerges as a versatile ally, capable of +addressing diverse needs across various database environments. diff --git a/databases/proxysql/pkg-message b/databases/proxysql/pkg-message new file mode 100644 index 000000000000..f8af81593652 --- /dev/null +++ b/databases/proxysql/pkg-message @@ -0,0 +1,9 @@ +[ +{ type: install + message: <<EOM +In order for logging to function, you must restart syslogd: + +# service syslogd restart +EOM +} +] diff --git a/databases/proxysql/pkg-plist b/databases/proxysql/pkg-plist new file mode 100644 index 000000000000..f49b893c5a16 --- /dev/null +++ b/databases/proxysql/pkg-plist @@ -0,0 +1,10 @@ +etc/syslog.d/proxysql.conf +sbin/proxysql +@dir(,proxysql,0750) %%ETCDIR%% +@sample(,proxysql,0640) %%ETCDIR%%/proxysql.cfg.sample +@sample %%LOCALBASE%%/etc/newsyslog.conf.d/proxysql.conf.sample +@dir(proxysql,proxysql,0750) /var/db/proxysql +@dir(proxysql,proxysql,0750) /var/run/proxysql +@dir(proxysql,proxysql,0750) /var/log/proxysql +@postexec test -f /var/log/proxysql.log || touch /var/log/proxysql.log +@postexec chmod 600 /var/log/proxysql.log
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202403291623.42TGNnSH096167>