Index: databases/proxysql/Makefile =================================================================== --- databases/proxysql/Makefile (nonexistent) +++ databases/proxysql/Makefile (working copy) @@ -0,0 +1,108 @@ +# Created by: Admins +# $FreeBSD$ + +PORTNAME= proxysql +DISTVERSION= 2.0.14 +DISTVERSIONSUFFIX= -${GH_TAGNAME} +PORTREVISION= 1 +CATEGORIES= databases + +MAINTAINER= admins@perceptyx.com +COMMENT= ProxySQL is a high performance proxy for MySQL and forks + +LICENSE= GPLv3 +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= cmake:devel/cmake \ + gawk:lang/gawk \ + libtool:devel/libtool \ + automake:devel/automake + + +LIB_DEPENDS+=libgnutls.so:security/gnutls + +USES= gmake libtool localbase pathfix shebangfix tar:bzip2 python:2.7,build iconv perl5 + +USE_GITHUB= yes +GH_ACCOUNT= sysown +GH_PROJECT= proxysql +GH_TAGNAME= 7b02b19 + +USE_AUTOTOOLS= automake +USE_GCC= 9+ +USE_PERL5= build +USE_RC_SUBR= proxysql + +GID_FILES= ${PATCHDIR}/GIDs +UID_FILES= ${PATCHDIR}/UIDs + +CPPFLAGS+= -D_GLIBCXX_USE_C99 -fPIC +MAKE_ENV+= GIT_VERSION=${GH_TAGNAME} NOJEMALLOC=1 + +ETCDIR= ${PREFIX}/etc +MAKE_JOBS_UNSAFE= yes + +SUB_FILES= pkg-message pkg-deinstall proxysql +SUB_LIST= PROXYSQL_DATADIR=${PROXYSQL_DATADIR} \ + PORTNAME=${PORTNAME} \ + PROXYSQL_LOGDIR=${PROXYSQL_LOGDIR} \ + PROXYSQL_USER=${PROXYSQL_USER} \ + PROXYSQL_GROUP=${PROXYSQL_GROUP} + +PLIST_SUB+= PROXYSQL_DATADIR=${PROXYSQL_DATADIR} \ + PORTNAME=${PORTNAME} \ + PROXYSQL_LOGDIR=${PROXYSQL_LOGDIR} \ + PROXYSQL_USER=${PROXYSQL_USER} \ + PROXYSQL_GROUP=${PROXYSQL_GROUP} + +PROXYSQL_USER= proxysql +PROXYSQL_GROUP= proxysql + +USERS= ${PROXYSQL_USER} +GROUPS= ${PROXYSQL_GROUP} + +PROXYSQL_DATADIR=/var/db/${PORTNAME} +PROXYSQL_LOGDIR=/var/log/${PORTNAME} + +PROXYSQL_DOCS= README.md INSTALL.md CHANGELOG.md RUNNING.md + +OPTIONS_DEFINE= DOCS + +PROXYSQL_BINS= src/proxysql + +SHEBANG_FILES= ${WRKSRC}/tools/*.pl ${WRKSRC}/tools/*.sh + +PROXYSQL_CONF= etc/proxysql.cnf +PROXYSQL_SCRIPTS= tools/proxysql_galera_checker.sh tools/proxysql_galera_writer.pl + +PKGMESSAGE= ${.CURDIR}/pkg-message + +# Really ugly hack to support python2 +# This is needed because of libinjection and the embedded dependencies in proxysql +# An issue is being created upstream to properly switch to py3 +pre-build: + ${LN} -sf /usr/local/bin/python2.7 /usr/local/bin/python2 + +do-build: + @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} O=.o ${MAKE_CMD}) + +do-install: +.for i in ${PROXYSQL_BINS} + ${INSTALL_PROGRAM} ${WRKSRC}/${i} ${STAGEDIR}${PREFIX}/bin +.endfor + ${MKDIR} ${STAGEDIR}${DATADIR} +.for i in ${PROXYSQL_SCRIPTS} + ${INSTALL_SCRIPT} ${WRKSRC}/${i} ${STAGEDIR}${DATADIR} +.endfor + ${MKDIR} ${STAGEDIR}${ETCDIR} + ${INSTALL_DATA} ${WRKSRC}/${PROXYSQL_CONF} ${STAGEDIR}${ETCDIR}/proxysql.cnf.sample + ${MKDIR} ${STAGEDIR}${PROXYSQL_DATADIR} + ${MKDIR} ${STAGEDIR}${PROXYSQL_LOGDIR} + +post-install-DOCS-on: + ${MKDIR} ${STAGEDIR}${DOCSDIR} +.for i in ${PROXYSQL_DOCS} + ${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR}/ +.endfor + +.include Property changes on: databases/proxysql/Makefile ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: databases/proxysql/distinfo =================================================================== --- databases/proxysql/distinfo (nonexistent) +++ databases/proxysql/distinfo (working copy) @@ -0,0 +1,3 @@ +TIMESTAMP = 1602770029 +SHA256 (sysown-proxysql-2.0.14-7b02b19-7b02b19_GH0.tar.gz) = ac24bc82ca177ce0311c6650c69d5a9790451e9ced9d983d6d1065986cc11c13 +SIZE (sysown-proxysql-2.0.14-7b02b19-7b02b19_GH0.tar.gz) = 35533591 Property changes on: databases/proxysql/distinfo ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: databases/proxysql/files/GIDs =================================================================== --- databases/proxysql/files/GIDs (nonexistent) +++ databases/proxysql/files/GIDs (working copy) @@ -0,0 +1 @@ +proxysql:*:484: Property changes on: databases/proxysql/files/GIDs ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: databases/proxysql/files/UIDs =================================================================== --- databases/proxysql/files/UIDs (nonexistent) +++ databases/proxysql/files/UIDs (working copy) @@ -0,0 +1 @@ +proxysql:*:484:484::0:0:ProxySQL User:/var/db/proxysql:/usr/sbin/nologin Property changes on: databases/proxysql/files/UIDs ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: databases/proxysql/files/patch-CMakeLists.txt =================================================================== --- databases/proxysql/files/patch-CMakeLists.txt (nonexistent) +++ databases/proxysql/files/patch-CMakeLists.txt (working copy) @@ -0,0 +1,14 @@ +--- CMakeLists.txt.orig 2020-04-20 20:44:18 UTC ++++ CMakeLists.txt +@@ -180,8 +180,8 @@ set(LIBINJECTION_PATCH_COMMAND "") + + if (Python_VERSION_MAJOR EQUAL "3") + message(STATUS "Will patch libinjection for python3 support") +- set(LIBINJECTION_PATCH_COMMAND 2to3 -w src/fingerprints2sqli.py src/make_parens.py src/sqlparse2c.py src/sqlparse_map.py) +- set(LIBINJECTION_PATCH_SHEBANG sed -i.bak -e "s:python:python3:g" src/make_parens.py src/sqlparse2c.py src/sqlparse_map.py) ++ set(LIBINJECTION_PATCH_COMMAND 2to3-3.7 -w src/fingerprints2sqli.py src/make_parens.py src/sqlparse2c.py src/sqlparse_map.py) ++ set(LIBINJECTION_PATCH_SHEBANG sed -i.bak -e "s:python:python3.7:g" src/make_parens.py src/sqlparse2c.py src/sqlparse_map.py) + else() + set(LIBINJECTION_PATCH_COMMAND "echo applying https://patch-diff.githubusercontent.com/raw/client9/libinjection/pull/144.patch") + set(LIBINJECTION_PATCH_SHEBANG sed -i.bak -e "s:python:python2:g" src/make_parens.py src/sqlparse2c.py src/sqlparse_map.py) + Property changes on: databases/proxysql/files/patch-CMakeLists.txt ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: databases/proxysql/files/patch-deps_Makefile =================================================================== --- databases/proxysql/files/patch-deps_Makefile (nonexistent) +++ databases/proxysql/files/patch-deps_Makefile (working copy) @@ -0,0 +1,15 @@ +--- deps/Makefile.orig 2020-10-16 15:24:40 UTC ++++ deps/Makefile +@@ -4,10 +4,10 @@ UNAME_S := $(shell uname -s) + PROXYDEBUG := $(shell echo $(PROXYDEBUG)) + ifeq ($(PROXYDEBUG),1) + MYCFLAGS=-O0 +-MYJEOPT=--enable-xmalloc --enable-prof --enable-fill --enable-debug ++MYJEOPT=--enable-xmalloc --enable-prof --enable-prof-libunwind --enable-fill --enable-debug + else + MYCFLAGS=-O2 +-MYJEOPT=--enable-xmalloc --enable-prof ++MYJEOPT=--enable-xmalloc --enable-prof --enable-prof-libunwind + endif + + ifneq (,$(wildcard /etc/system-release)) Property changes on: databases/proxysql/files/patch-deps_Makefile ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: databases/proxysql/files/patch-src_Makefile =================================================================== --- databases/proxysql/files/patch-src_Makefile (nonexistent) +++ databases/proxysql/files/patch-src_Makefile (working copy) @@ -0,0 +1,11 @@ +--- src/Makefile.orig 2020-10-16 16:17:33 UTC ++++ src/Makefile +@@ -94,7 +94,7 @@ MYCXXFLAGS=-std=c++11 $(IDIRS) $(OPTZ) $ + LDFLAGS+= + NOJEMALLOC := $(shell echo $(NOJEMALLOC)) + ifeq ($(NOJEMALLOC),1) +-MYLIBS=-Wl,--export-dynamic -Wl,-Bstatic -lconfig -lproxysql -ldaemon -lconfig++ -lre2 -lpcrecpp -lpcre -lmariadbclient -lmicrohttpd -lhttpserver -linjection -lcurl -lssl -lcrypto -lev -Wl,-Bdynamic -lgnutls -lpthread -lm -lz -lrt $(EXTRALINK) ++MYLIBS=-Wl,--export-dynamic -Wl,-Bstatic -Wl,--no-whole-archive -Wl,--start-group -lconfig -lproxysql -ldaemon -lconfig++ -lre2 -lpcrecpp -lpcre -lmariadbclient -lmicrohttpd -lhttpserver -linjection -lcurl -lssl -lcrypto -lev -Wl,--end-group -Wl,-Bdynamic -lgnutls -lpthread -lm -lz -lrt $(EXTRALINK) + else + MYLIBS=-Wl,--export-dynamic -Wl,-Bstatic -lconfig -lproxysql -ldaemon -ljemalloc -lconfig++ -lre2 -lpcrecpp -lpcre -lmariadbclient -lhttpserver -lmicrohttpd -linjection -lcurl -lssl -lcrypto -lev -Wl,-Bdynamic -lgnutls -lpthread -lm -lz -lrt $(EXTRALINK) + endif Property changes on: databases/proxysql/files/patch-src_Makefile ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: databases/proxysql/files/pkg-deinstall.in =================================================================== --- databases/proxysql/files/pkg-deinstall.in (nonexistent) +++ databases/proxysql/files/pkg-deinstall.in (working copy) @@ -0,0 +1,26 @@ +#!/bin/sh +# $FreeBSD$ + +if [ "$2" != "POST-DEINSTALL" ]; then + exit 0 +fi + +USER=%%USER%% + +echo +echo "====================================================" +echo +echo "If you want remove ProxySQL permanently from you system" +echo "execute following commands:" +echo +echo " # rm -rf %%PROXYSQL_LOGDIR%%" +echo " # rm -rf %%PROXYSQL_DATADIR%%" +echo " # rm -rf %%ETCDIR%%/%%PORTNAME%%" +if pw usershow "${USER}" 2>/dev/null 1>&2; then + echo " # pw userdel ${USER}" +fi +echo +echo "====================================================" +echo + +exit 0 Property changes on: databases/proxysql/files/pkg-deinstall.in ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: databases/proxysql/files/pkg-message.in =================================================================== --- databases/proxysql/files/pkg-message.in (nonexistent) +++ databases/proxysql/files/pkg-message.in (working copy) @@ -0,0 +1,6 @@ +[ +{ + message: "The ProxySQL port has been installed with an example config file, located + in %%ETCDIR%%/proxysql.cfg.example. +} +] Property changes on: databases/proxysql/files/pkg-message.in ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: databases/proxysql/files/proxysql.in =================================================================== --- databases/proxysql/files/proxysql.in (nonexistent) +++ databases/proxysql/files/proxysql.in (working copy) @@ -0,0 +1,83 @@ +#!/bin/sh +# $FreeBSD$ +# + +# PROVIDE: proxysql +# REQUIRE: LOGIN DAEMON NETWORKING +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable proxysql: +# proxysql_enable="YES" +# + +# proxysql_enable (bool): Set to NO by default. +# Set it to YES to enable doormand. +# proxysql_config (path): Set to %%PREFIX%%/etc/proxysql.cnf +# by default. +# proxysql_datadir (str): proxysql data dir +# Default: %%PROXYSQL_DATADIR%% +# proxysql_user (str): proxysql daemon user +# Default: %%PROXYSQL_USER%% +# proxysql_group (str): proxysql daemon group +# Default: %%PROXYSQL_GROUP%% +# proxysql_flags (str): Extra flags passed to proxysql +# Default: -f + +. /etc/rc.subr + +name="proxysql" +rcvar="proxysql_enable" + +load_rc_config $name + +: ${proxysql_enable:="NO"} +: ${proxysql_config:="%%PREFIX%%/etc/${name}.cnf"} +: ${proxysql_user:="%%PROXYSQL_USER%%"} +: ${proxysql_group:="%%PROXYSQL_GROUP%%"} +: ${proxysql_datadir="%%PROXYSQL_DATADIR%%"} +: ${proxysql_flags:="-f"} + +command="/usr/sbin/daemon" +command_args="%%PREFIX%%/bin/${name} -f -c ${proxysql_config} -D ${proxysql_datadir}" +logfile="%%PROXYSQL_LOGDIR%%/${name}.log" +pidfile="/var/run/${name}.pid" +start_precmd="${name}_prestart" +start_cmd="${name}_start" +stop_cmd="${name}_stop" +status_cmd="${name}_status" + +proxysql_prestart() +{ + # Create ProxySQL datadir + if [ ! -d "${proxysql_datadir}" ]; then + mkdir -p ${proxysql_datadir} || return 1 + [ $? -eq 0 ] && chown -R ${user}:${group} ${proxysql_datadir} + fi + # Create ProxySQL logdir + install -d -o ${proxysql_user} -g ${proxysql_group} -m750 %%PROXYSQL_LOGDIR%% +} + +proxysql_stop() +{ + if [ -f ${pidfile} ]; then + kill `cat ${pidfile}` + fi +} + +proxysql_status() +{ + if [ -e ${pidfile} ]; then + echo "${name} is running as pid `cat ${pidfile}`" + else + echo "${name} is not running" + fi +} + +proxysql_start() +{ + echo "Starting ${name}" + ${command} -fcr -P ${pidfile} -u ${proxysql_user} -o ${logfile} \ + ${command_args} +} + +run_rc_command "$1" Property changes on: databases/proxysql/files/proxysql.in ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: databases/proxysql/pkg-descr =================================================================== --- databases/proxysql/pkg-descr (nonexistent) +++ databases/proxysql/pkg-descr (working copy) @@ -0,0 +1,8 @@ +ProxySQL is a high performance, high availability, protocol aware proxy for +MySQL and forks (like Percona Server and MariaDB). All the while getting +the unlimited freedom that comes with a GPL license. + +Its development is driven by the lack of open source proxies that provide +high performance. + +WWW: http://www.proxysql.com Property changes on: databases/proxysql/pkg-descr ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: databases/proxysql/pkg-plist =================================================================== --- databases/proxysql/pkg-plist (nonexistent) +++ databases/proxysql/pkg-plist (working copy) @@ -0,0 +1,9 @@ +bin/proxysql +%%ETCDIR%%/proxysql.cnf.sample +%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG.md +%%PORTDOCS%%%%DOCSDIR%%/INSTALL.md +%%PORTDOCS%%%%DOCSDIR%%/README.md +%%PORTDOCS%%%%DOCSDIR%%/RUNNING.md +%%DATADIR%%/proxysql_galera_checker.sh +%%DATADIR%%/proxysql_galera_writer.pl +@dir /var/db/proxysql Property changes on: databases/proxysql/pkg-plist ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property