diff --git a/net/seaweedfs/Makefile b/net/seaweedfs/Makefile index f19b166fe7a5..fd0c6284f444 100644 --- a/net/seaweedfs/Makefile +++ b/net/seaweedfs/Makefile @@ -1,51 +1,70 @@ PORTNAME= seaweedfs DISTVERSION= 3.20 PORTREVISION= 2 CATEGORIES= net sysutils MASTER_SITES= https://raw.githubusercontent.com/${PORTNAME}/${PORTNAME}/${DISTVERSIONFULL}/:gomod DISTFILES= go.mod:gomod MAINTAINER= dch@FreeBSD.org COMMENT= Distributed Object Store and Filesystem WWW= https://github.com/chrislusf/seaweedfs/wiki LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE USES= go:modules USE_GITHUB= yes USE_RC_SUBR= seaweedfs GO_MODULE= github.com/seaweedfs/seaweedfs GO_TARGET= ./weed CGO_CFLAGS= -I. SEAWEEDFS_DIR?= /var/db/${PORTNAME} SEAWEEDFS_USER?= seaweedfs SEAWEEDFS_GROUP?= seaweedfs SUB_FILES= pkg-message SUB_LIST= GROUP=${SEAWEEDFS_GROUP} \ SEAWEEDFS_DIR=${SEAWEEDFS_DIR} \ USER=${SEAWEEDFS_USER} USERS= ${SEAWEEDFS_USER} GROUPS= ${SEAWEEDFS_GROUP} +OPTIONS_DEFINE= GOCDK +OPTIONS_DEFAULT= ELASTIC GOCDK SQLITE +OPTIONS_GROUP= FILERS +OPTIONS_GROUP_FILERS= ELASTIC SQLITE TIKV YDB + +ELASTIC_DESC= Elasticsearch support +FILERS_DESC= Filer store engines +GOCDK_DESC= Go CDK PubSub API support +TIKV_DESC= TiKV database support +YDB_DESC= YDB support + +ELASTIC_VARS= GO_TAGS+=elastic +GOCDK_VARS= GO_TAGS+=gocdk +SQLITE_VARS= GO_TAGS+=sqlite +TIKV_VARS= GO_TAGS+=tikv +YDB_VARS= GO_TAGS+=ydb + +.include +.if !empty (GO_TAGS) +GO_BUILDFLAGS+= -tags "${GO_TAGS}" +.endif + post-build: .for cfg in master filer security replication notification ${WRKDIR}/bin/weed scaffold -config ${cfg} -output ${WRKDIR}/ .endfor post-install: - ${MKDIR} \ - ${STAGEDIR}/var/db/${PORTNAME} \ - ${STAGEDIR}/var/log/${PORTNAME} \ - ${STAGEDIR}${ETCDIR} + ${MKDIR} ${STAGEDIR}${ETCDIR} .for cfg in filer master notification replication security ${INSTALL_DATA} ${WRKDIR}/${cfg}.toml \ ${STAGEDIR}${ETCDIR}/${cfg}.toml.sample .endfor -.include +.include diff --git a/net/seaweedfs/distinfo b/net/seaweedfs/distinfo index 18adbc339ea8..61e515117a65 100644 --- a/net/seaweedfs/distinfo +++ b/net/seaweedfs/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1659960872 -SHA256 (go/net_seaweedfs/seaweedfs-seaweedfs-3.20_GH0/go.mod) = 29ab0345461593560ee5712730c89c63f63637b136aa2d63dbc57a3b351c9e4d -SIZE (go/net_seaweedfs/seaweedfs-seaweedfs-3.20_GH0/go.mod) = 11375 -SHA256 (go/net_seaweedfs/seaweedfs-seaweedfs-3.20_GH0/seaweedfs-seaweedfs-3.20_GH0.tar.gz) = ed5f3eb0abe4216504192646bcda1ed7e5d21c1478f9b23ca26597b04044963e -SIZE (go/net_seaweedfs/seaweedfs-seaweedfs-3.20_GH0/seaweedfs-seaweedfs-3.20_GH0.tar.gz) = 28872299 +TIMESTAMP = 1662714159 +SHA256 (go/net_seaweedfs/seaweedfs-seaweedfs-3.26_GH0/go.mod) = bda5d80fad3ccd26c08bdd1fee554be2501e09b087bc079bd54bea4dab01feea +SIZE (go/net_seaweedfs/seaweedfs-seaweedfs-3.26_GH0/go.mod) = 11431 +SHA256 (go/net_seaweedfs/seaweedfs-seaweedfs-3.26_GH0/seaweedfs-seaweedfs-3.26_GH0.tar.gz) = a2798c587aa4193923e0ee9eae6c008b43f4b17dea3136f1c67e4acee45468c7 +SIZE (go/net_seaweedfs/seaweedfs-seaweedfs-3.26_GH0/seaweedfs-seaweedfs-3.26_GH0.tar.gz) = 28883805 diff --git a/net/seaweedfs/files/pkg-message.in b/net/seaweedfs/files/pkg-message.in index a54e166d0a70..a6c2683314a9 100644 --- a/net/seaweedfs/files/pkg-message.in +++ b/net/seaweedfs/files/pkg-message.in @@ -1,24 +1,45 @@ [ { type: install message: <&1 | grep -q syslog ; echo $?) -if [ ${DAEMON} -eq 0 ]; then - : ${seaweedfs_syslog_enable:="NO"} - : ${seaweedfs_syslog_priority:="info"} - : ${seaweedfs_syslog_facility:="daemon"} - if checkyesno seaweedfs_syslog_enable; then - seaweedfs_syslog_flags="-T ${name}" +# backwards compatibility +if [ -d "${seaweedfs_dir}/data" -a \( "${seaweedfs_options}" = "server -dir=${seaweedfs_dir}" \) ]; then + seaweedfs_dir="${seaweedfs_dir}/data" + seaweedfs_options="server -dir=${seaweedfs_dir}" +fi +if [ -n "${seaweedfs_syslog_enable}" ]; then + seaweedfs_syslog_output_enable="YES" + seaweedfs_syslog_output_priority="${seaweedfs_syslog_priority}" + seaweedfs_syslog_output_facility="${seaweedfs_syslog_facility}" +fi + +if checkyesno seaweedfs_syslog_output_enable; then + if [ -n "${seaweedfs_syslog_output_tag}" ]; then + seaweedfs_syslog_output_flags="-T ${seaweedfs_syslog_output_tag}" + else + seaweedfs_syslog_output_flags="-T ${name}" + fi - if [ -n "${seaweedfs_syslog_priority}" ]; then - seaweedfs_syslog_flags="${seaweedfs_syslog_flags} -s ${seaweedfs_syslog_priority}" - fi + if [ -n "${seaweedfs_syslog_output_priority}" ]; then + seaweedfs_syslog_output_flags="${seaweedfs_syslog_output_flags} -s ${seaweedfs_syslog_output_priority}" + fi - if [ -n "${seaweedfs_syslog_facility}" ]; then - seaweedfs_syslog_flags="${seaweedfs_syslog_flags} -l ${seaweedfs_syslog_facility}" - fi - fi -else - seaweedfs_syslog_enable="NO" - seaweedfs_syslog_flags="" + if [ -n "${seaweedfs_syslog_output_facility}" ]; then + seaweedfs_syslog_output_flags="${seaweedfs_syslog_output_flags} -l ${seaweedfs_syslog_output_facility}" + fi fi -pidfile=/var/run/seaweedfs.pid +pidfile=${seaweedfs_pidfile} procname="%%PREFIX%%/bin/weed" command="/usr/sbin/daemon" -command_args="-f -t ${name} ${seaweedfs_syslog_flags} -p ${pidfile} ${procname} ${seaweedfs_options}" +command_args="-f -t ${name} ${seaweedfs_syslog_output_flags} -p ${pidfile} ${procname} ${seaweedfs_options}" -extra_commands="reload monitor" -monitor_cmd=seaweedfs_monitor start_precmd=seaweedfs_startprecmd -required_files="${seaweedfs_dir}" - -seaweedfs_monitor() -{ - sig_reload=USR1 - run_rc_command "reload" -} seaweedfs_startprecmd() { - if [ ! -e ${pidfile} ]; then - install -o ${seaweedfs_user} -g ${seaweedfs_group} /dev/null ${pidfile}; - fi + if [ ! -e "${pidfile}" ]; then + install -m 0600 -o "${seaweedfs_user}" -g "${seaweedfs_group}" /dev/null "${pidfile}"; + fi - if [ ! -d ${seaweedfs_dir}/data ]; then - install -d -m 0750 -o ${seaweedfs_user} -g ${seaweedfs_group} ${seaweedfs_dir}/data - fi - if [ ! -d ${seaweedfs_dir}/metadata ]; then - install -d -m 0750 -o ${seaweedfs_user} -g ${seaweedfs_group} ${seaweedfs_dir}/metadata - fi - chdir ${seaweedfs_dir} + if [ ! -d "${seaweedfs_dir}" ]; then + install -d -m 0750 -o "${seaweedfs_user}" -g "${seaweedfs_group}" "${seaweedfs_dir}" + fi } run_rc_command "$1" diff --git a/net/seaweedfs/pkg-plist b/net/seaweedfs/pkg-plist index 815b7c1e006e..034ae7900cf5 100644 --- a/net/seaweedfs/pkg-plist +++ b/net/seaweedfs/pkg-plist @@ -1,10 +1,8 @@ -@dir(seaweedfs,seaweedfs,750) /var/db/seaweedfs -@dir(seaweedfs,seaweedfs,750) /var/log/seaweedfs @comment normally these would auto-populate your etc dir but these generated @comment files contain conflicting options; users must read the wiki first! %%ETCDIR%%/filer.toml.sample %%ETCDIR%%/master.toml.sample %%ETCDIR%%/notification.toml.sample %%ETCDIR%%/replication.toml.sample %%ETCDIR%%/security.toml.sample bin/weed