Date: Mon, 12 Jul 2021 13:55:12 GMT From: Kirill Ponomarev <krion@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: cdd4f8853bb0 - main - sysutils/cbsd-mq-api: New port: Simplified API for creating and destroying CBSD virtual environments Message-ID: <202107121355.16CDtC06062162@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by krion: URL: https://cgit.FreeBSD.org/ports/commit/?id=cdd4f8853bb0424189505d4d82ed3bae2e9594c2 commit cdd4f8853bb0424189505d4d82ed3bae2e9594c2 Author: Kirill Ponomarev <krion@FreeBSD.org> AuthorDate: 2021-07-12 13:54:01 +0000 Commit: Kirill Ponomarev <krion@FreeBSD.org> CommitDate: 2021-07-12 13:54:01 +0000 sysutils/cbsd-mq-api: New port: Simplified API for creating and destroying CBSD virtual environments Submitted by: olevole at olevole__dot.ru --- sysutils/Makefile | 1 + sysutils/cbsd-mq-api/Makefile | 34 ++++++++++++++ sysutils/cbsd-mq-api/distinfo | 9 ++++ sysutils/cbsd-mq-api/files/cbsd-mq-api.in | 78 +++++++++++++++++++++++++++++++ sysutils/cbsd-mq-api/pkg-descr | 4 ++ 5 files changed, 126 insertions(+) diff --git a/sysutils/Makefile b/sysutils/Makefile index 89c767d43c2c..ef9e5caf77f4 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -143,6 +143,7 @@ SUBDIR += byobu SUBDIR += catfish SUBDIR += cbsd + SUBDIR += cbsd-mq-api SUBDIR += cbsd-mq-router SUBDIR += ccd2iso SUBDIR += cciss_vol_status diff --git a/sysutils/cbsd-mq-api/Makefile b/sysutils/cbsd-mq-api/Makefile new file mode 100644 index 000000000000..1dd9d2fef92d --- /dev/null +++ b/sysutils/cbsd-mq-api/Makefile @@ -0,0 +1,34 @@ +PORTNAME= cbsd-mq-api +PORTVERSION= 0.1 +CATEGORIES= sysutils + +MAINTAINER= olevole@olevole.ru +COMMENT= Simplified API for creating and destroying CBSD virtual environments + +LICENSE= BSD2CLAUSE + +USES= go + +USE_GITHUB= yes +GH_ACCOUNT= cbsd +GH_PROJECT= cbsd-mq-api +GH_TUPLE= beanstalkd:go-beanstalk:3bed00be7a17:beanstalkd/src/github.com/beanstalkd/go-beanstalk \ + gorilla:mux:d07530f46e1e:gorilla_mux/vendor/github.com/gorilla/mux \ + golang:crypto:5ff15b29337e:golang_crypto/vendor/golang.org/x/crypto +USE_RC_SUBR= cbsd-mq-api + +USERS= cbsd +GROUPS= cbsd + +PLIST_FILES= bin/cbsd-mq-api \ + "@sample etc/cbsd-mq-api.json.sample" + +post-extract: + ${LN} -sf ${WRKSRC}/src ${WRKDIR} + ${LN} -sf ${WRKSRC} ${WRKDIR}/src/${PORTNAME} + +do-install: + ${INSTALL_PROGRAM} ${WRKDIR}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/cbsd-mq-api + ${INSTALL_DATA} ${WRKDIR}/${PORTNAME}-${GH_TAGNAME}/etc/cbsd-mq-api.json ${STAGEDIR}${PREFIX}/etc/cbsd-mq-api.json.sample + +.include <bsd.port.mk> diff --git a/sysutils/cbsd-mq-api/distinfo b/sysutils/cbsd-mq-api/distinfo new file mode 100644 index 000000000000..c96ce45a470d --- /dev/null +++ b/sysutils/cbsd-mq-api/distinfo @@ -0,0 +1,9 @@ +TIMESTAMP = 1626095273 +SHA256 (cbsd-cbsd-mq-api-0.1_GH0.tar.gz) = 235ad0b64e171afb53daf05d457d59cbe526e7857a6e6cb1b59ee9a37e82baf3 +SIZE (cbsd-cbsd-mq-api-0.1_GH0.tar.gz) = 10330 +SHA256 (beanstalkd-go-beanstalk-3bed00be7a17_GH0.tar.gz) = 4efb9667cadd4945ec54ccc3caa824ab7fb06f75f8b234c1899c4664dc718bb7 +SIZE (beanstalkd-go-beanstalk-3bed00be7a17_GH0.tar.gz) = 8063 +SHA256 (gorilla-mux-d07530f46e1e_GH0.tar.gz) = 398bd970e01d161642951f30fe285fce29564444c7f7776f8dddb271411882d0 +SIZE (gorilla-mux-d07530f46e1e_GH0.tar.gz) = 45450 +SHA256 (golang-crypto-5ff15b29337e_GH0.tar.gz) = 094d3a6563b4e2d7ce5e4ac2ff5f79bc14a4a7111a3310270e63505705a43cb6 +SIZE (golang-crypto-5ff15b29337e_GH0.tar.gz) = 1732042 diff --git a/sysutils/cbsd-mq-api/files/cbsd-mq-api.in b/sysutils/cbsd-mq-api/files/cbsd-mq-api.in new file mode 100644 index 000000000000..375933de475f --- /dev/null +++ b/sysutils/cbsd-mq-api/files/cbsd-mq-api.in @@ -0,0 +1,78 @@ +#!/bin/sh + +# PROVIDE: cbsd_mq_api +# REQUIRE: NETWORK +# BEFORE: DAEMON + +. /etc/rc.subr + +name="cbsd_mq_api" +desc="CBSD API Module" +rcvar="cbsd_mq_api_enable" +pidfile="/var/run/${name}.pid" +daemon_pidfile="/var/run/${name}-daemon.pid" +logdir="/var/log/${name}" +logfile="${logdir}/cbsd_mq_api.log" +extra_commands="reload" +command="%%PREFIX%%/bin/cbsd-mq-api" +cbsd_mq_api_user=${cbsd_mq_api_user-"cbsd"} +cbsd_mq_api_config=${cbsd_mq_api_config-"%%PREFIX%%/etc/cbsd-mq-api.json"} +required_files="${cbsd_mq_api_config}" + +cbsd_mq_api_args=${cbsd_mq_api_args-"-config ${cbsd_mq_api_config}"} +cbsd_mq_api_flags=${cbsd_mq_api_flags="-listen 127.0.0.1:65531"} + +load_rc_config ${name} + +start_cmd="start" +stop_cmd="stop" +status_cmd="status" +reload_cmd="reload" + +stop() +{ + if [ -f "${daemon_pidfile}" ]; then + pids=$( pgrep -F ${daemon_pidfile} 2>&1 ) + _err=$? + [ ${_err} -eq 0 ] && kill -9 ${pids} && /bin/rm -f ${daemon_pidfile} + fi + if [ -f "${pidfile}" ]; then + pids=$( pgrep -F ${pidfile} 2>&1 ) + _err=$? + [ ${_err} -eq 0 ] && kill -9 ${pids} && /bin/rm -f ${pidfile} + fi +} + +start() +{ + [ ! -d ${logdir} ] && mkdir -p ${logdir} + touch ${logfile} + chown ${cbsd_mq_api_user} ${logdir} ${logfile} + /usr/sbin/daemon -u ${cbsd_mq_api_user} -f -R5 -p ${pidfile} -P ${daemon_pidfile} -o ${logfile} ${command} ${cbsd_mq_api_args} ${cbsd_mq_api_flags} +} + +reload() +{ + stop + start +} + +status() +{ + if [ -f "${pidfile}" ]; then + pids=$( pgrep -F ${pidfile} 2>&1 ) + _err=$? + if [ ${_err} -eq 0 ]; then + echo "${name} is running as pid ${pids}" + exit 0 + else + echo "wrong pid: ${pids}" + exit 1 + fi + else + echo "no pidfile $pidfile" + exit 1 + fi +} + +run_rc_command "$1" diff --git a/sysutils/cbsd-mq-api/pkg-descr b/sysutils/cbsd-mq-api/pkg-descr new file mode 100644 index 000000000000..2cca4ca61bde --- /dev/null +++ b/sysutils/cbsd-mq-api/pkg-descr @@ -0,0 +1,4 @@ +Provides a simplified API for creating and destroying CBSD +virtual environments. + +WWW: https://www.bsdstore.ru/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107121355.16CDtC06062162>