Date: Fri, 29 Mar 2024 20:13:22 +0100 From: Daniel Engberg <daniel.engberg.lists@pyret.net> To: Ryan Steinmetz <zi@FreeBSD.org> Cc: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: Re: git: e0cf1d89c0ea - main - databases/proxysql: New port! Message-ID: <defbb29d3cb89f180277d9ff7270fe03@mail.infomaniak.com> In-Reply-To: <202403291623.42TGNnSH096167@gitrepo.freebsd.org> References: <202403291623.42TGNnSH096167@gitrepo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2024-03-29T17:23:49.000+01:00, Ryan Steinmetz <zi@FreeBSD.org> wrote: > The branch main has been updated by zi: >=20 > URL: https://cgit.FreeBSD.org/ports/commit/?id=3De0cf1d89c0ea475fdaf82dfc= e2d27c23b743dd3d >=20 > 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 >=20 > databases/proxysql: New port! > =20 > ProxySQL is a high performance, high availability, protocol aware pro= xy for > MySQL and forks (like Percona Server and MariaDB). > =20 > With its ability to intelligently route queries, balance loads, and p= rovide > failover handling, ProxySQL empowers organizations to harness the ful= l > potential of their database infrastructure. Whether grappling with > scalability challenges, striving to enhance performance, or seeking t= o > ensure high availability, ProxySQL emerges as a versatile ally, capab= le of > addressing diverse needs across various database environments. > =20 > 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(+) >=20 > diff --git a/databases/Makefile b/databases/Makefile > index 3a97008d17a3..e196510964d4 100644 > --- a/databases/Makefile > +++ b/databases/Makefile > @@ -696,6 +696,7 @@ > SUBDIR +=3D proftpd-mod_sql_sqlite > SUBDIR +=3D proftpd-mod_sql_tds > SUBDIR +=3D prometheus-postgresql-adapter > + SUBDIR +=3D proxysql > SUBDIR +=3D pspg > SUBDIR +=3D puppetdb-terminus7 > SUBDIR +=3D 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=3D=09proxysql > +PORTVERSION=3D=092.6.1 > +CATEGORIES=3D=09databases > + > +MAINTAINER=3D=09zi@FreeBSD.org > +COMMENT=3D=09High performance, high availability, protocol-aware proxy f= or MySQL > +WWW=3D=09=09https://www.proxysql.com/ > + > +LICENSE=3D=09GPLv3 > +LICENSE_FILE=3D=09${WRKSRC}/LICENSE > + > +BUILD_DEPENDS=3D=09aclocal:devel/automake \ > +=09=09autoreconf:devel/autoconf \ > +=09=09bash:shells/bash \ > +=09=09cmake:devel/cmake-core \ > +=09=09${LOCALBASE}/bin/grep:textproc/gnugrep \ > +=09=09libgcrypt>0:security/libgcrypt \ > +=09=09libtoolize:devel/libtool \ > +=09=09e2fsprogs-libuuid>0:misc/e2fsprogs-libuuid \ > +=09=09gnutls>0:security/gnutls > +RUN_DEPENDS=3D=09libgcrypt>0:security/libgcrypt \ > +=09=09e2fsprogs-libuuid>0:misc/e2fsprogs-libuuid \ > +=09=09gnutls>0:security/gnutls > + > +USES=3D=09=09compiler:gcc-c++11-lib gmake libtool perl5 python:build she= bangfix > +USE_PERL5=3D=09build > +USE_GCC=3D=09yes > +MAKE_ENV=3D=09GIT_VERSION=3D${PORTVERSION} > +USE_GITHUB=3D=09yes > +ALL_TARGET=3D=09build_deps default > +SHEBANG_FILES=3D=09deps/libssl/verify-bio_st-match.sh > +MAKE_JOBS_UNSAFE=3Dyes > +LDFLAGS+=3D=09-L${LOCALBASE}/lib > +CFLAGS+=3D=09-fPIC > +CXXFLAGS+=3D=09-fPIC > +BINARY_ALIAS=3D=09python3=3D${PYTHON_CMD} > +USE_RC_SUBR=3D=09${PORTNAME} > + > +USERS=3D=09=09${PORTNAME} > +GROUPS=3D=09=09${PORTNAME} > + > +GH_ACCOUNT=3D=09sysown > + > +post-patch: > +=09@${REINPLACE_CMD} -e 's,/etc/,${ETCDIR}/,g' ${WRKSRC}/lib/ProxySQL_Gl= oVars.cpp > +=09@${REINPLACE_CMD} \ > +=09=09-e 's|strftime(__buffer, 25, "%Y-%m-%d %H:%M:%S", __tm_info);|snpr= intf(__buffer, 3, "%s", "");|g' \ > +=09=09-e 's,"%s \[,"%s\[,g' \ > +=09=09-e '/__timer/d' \ > +=09=09-e '/__tm_info/d' \ > +=09=09${WRKSRC}/include/proxysql_debug.h > +=09@${REINPLACE_CMD} \ > +=09=09-e 's,/var/lib,/var/db,g' \ > +=09=09-e '7s/^/errorlog=3D"\/var\/log\/proxysql\/proxysql-error.log"\n\n= /g' \ > +=09=09-e '7s/^/pid=3D"\/var\/run\/${PORTNAME}\/${PORTNAME}.pid"\n/g' \ > +=09=09${WRKSRC}/src/proxysql.cfg > +=09@${REINPLACE_CMD} \ > +=09=09-e 's,grep,${LOCALBASE}/bin/grep,g' \ > +=09=09-e 's,ln -fsT,ln -fs,' \ > +=09=09-e 's,PROXYSQLCLICKHOUSE=3D1 ,,g' \ > +=09=09${WRKSRC}/Makefile ${WRKSRC}/deps/Makefile \ > +=09=09${WRKSRC}/lib/Makefile ${WRKSRC}/src/Makefile > + > +do-install: > +=09${INSTALL_PROGRAM} ${WRKSRC}/src/proxysql ${STAGEDIR}${LOCALBASE}/sbi= n > + > +post-install: > +=09${MKDIR} ${STAGEDIR}${ETCDIR} ${STAGEDIR}/var/db/${PORTNAME} \ > +=09=09${STAGEDIR}/var/run/${PORTNAME} \ > +=09=09${STAGEDIR}${LOCALBASE}/etc/syslog.d \ > +=09=09${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d \ > +=09=09${STAGEDIR}/var/log/${PORTNAME} > +=09${INSTALL_DATA} ${FILESDIR}/${PORTNAME}.conf \ > +=09=09${STAGEDIR}${LOCALBASE}/etc/syslog.d > +=09${INSTALL_DATA} ${FILESDIR}/proxysql.conf-newsyslog \ > +=09=09${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d/proxysql.conf.sample > +=09${INSTALL_DATA} ${WRKSRC}/src/proxysql.cfg \ > +=09=09${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 =3D 1711406812 > +SHA256 (sysown-proxysql-2.6.1_GH0.tar.gz) =3D b4021fd4bd27ef2c506da91396= ed995fa1d6ee8f3d421fcb200331716f9a8979 > +SIZE (sysown-proxysql-2.6.1_GH0.tar.gz) =3D 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 > +*.*=09=09=09=09=09=09/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=09root:wheel=09640 10=09 1000=09* JC > diff --git a/databases/proxysql/files/proxysql.in b/databases/proxysql/fi= les/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 unde= r > +# 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 proxys= ql > +# Default is "". > + > +. /etc/rc.subr > + > +name=3Dproxysql > +rcvar=3Dproxysql_enable > + > +load_rc_config $name > + > +: ${proxysql_enable:=3D"NO"} > +: ${proxysql_user:=3D"proxysql"} > +: ${proxysql_group:=3D"proxysql"} > +: ${proxysql_config:=3D"%%ETCDIR%%/proxysql.cfg"} > +: ${proxysql_socket:=3D"/var/run/proxysql/proxysql.sock"} > +: ${proxysql_datadir:=3D"/var/db/proxysql"} > +: ${proxysql_args:=3D""} > +: ${proxysql_restart_delay:=3D"10"} > + > + > +pidfile=3D"/var/run/proxysql/proxysql.pid" > +command=3D"/usr/sbin/daemon" > +proxysql_command=3D"%%PREFIX%%/sbin/proxysql" > +command_args=3D"-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=3D"${proxysql_config}" > +extra_commands=3D"reload initialize" > +reload_cmd=3Dproxysql_reload > +initialize_cmd=3Dproxysql_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 prov= ide > +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-mess= age > 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 Hi, Back this out and rework the port due to multiple issues, * It fails to build * it bundles a bunch of libraries that are already in tree, a few are neede= d to be ported properly and some are subject to security issues https://github.com/sysown/proxysql/tree/v2.6.1/deps https://docs.freebsd.org/en/books/porters-handbook/book/#bundled-libs-pract= ices https://src.fedoraproject.org/rpms/proxysql/tree/rawhide * Bundled libraries overrides C/CXXFLAGS set by framework * Portlint warns about not using helpers * Portclippy/portfmt could also be useful https://pdr2.bofh.network/data/140-diizzy/2024-03-29_12h59m04s/logs/errors/= proxysql-2.6.1.log Best regards, Daniel
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?defbb29d3cb89f180277d9ff7270fe03>