diff --git a/net/mosquitto/Makefile b/net/mosquitto/Makefile index 740405a39144..a98109f9c046 100644 --- a/net/mosquitto/Makefile +++ b/net/mosquitto/Makefile @@ -1,54 +1,55 @@ # Created by: Joseph Benden PORTNAME= mosquitto PORTVERSION= 2.0.10 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= https://mosquitto.org/files/source/ MAINTAINER= joe@thrallingpenguin.com COMMENT= Open source MQTT broker LICENSE= EPL BUILD_DEPENDS= xsltproc:textproc/libxslt \ docbook-xsl>0:textproc/docbook-xsl LIB_DEPENDS= libuuid.so:misc/e2fsprogs-libuuid \ libcjson.so:devel/libcjson RUN_DEPENDS= ${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss USES= cmake ssl USE_RC_SUBR= mosquitto USE_LDCONFIG= yes CMAKE_ARGS= -DCMAKE_LIBDATADIR:PATH="${PREFIX}/libdata" USERS= nobody PLIST_SUB= PORTVERSION=${PORTVERSION} OPTIONS_DEFINE= CARES WS OPTIONS_DEFAULT= CARES CARES_LIB_DEPENDS= libcares.so:dns/c-ares CARES_CMAKE_ON= -DWITH_SRV:BOOL=ON WS_DESC= MQTT over Websockets support WS_LIB_DEPENDS= libwebsockets.so:net/libwebsockets WS_CMAKE_ON= -DWITH_WEBSOCKETS:BOOL=ON post-patch: @${REINPLACE_CMD} -e '/ldconfig/d' ${WRKSRC}/src/CMakeLists.txt \ ${WRKSRC}/lib/CMakeLists.txt ${WRKSRC}/lib/cpp/CMakeLists.txt @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/CMakeLists.txt post-install: ${SED} -e '/cafile/s,/usr/local,${LOCALBASE},' \ ${STAGEDIR}${ETCDIR}/mosquitto.conf > \ ${STAGEDIR}${ETCDIR}/mosquitto.conf.sample ${MV} ${STAGEDIR}${ETCDIR}/pwfile.example \ ${STAGEDIR}${ETCDIR}/pwfile.sample ${MV} ${STAGEDIR}${ETCDIR}/pskfile.example \ ${STAGEDIR}${ETCDIR}/pskfile.sample ${MV} ${STAGEDIR}${ETCDIR}/aclfile.example \ ${STAGEDIR}${ETCDIR}/aclfile.sample .include diff --git a/net/mosquitto/files/mosquitto.in b/net/mosquitto/files/mosquitto.in index f781b772af61..ae1bd703ecbc 100644 --- a/net/mosquitto/files/mosquitto.in +++ b/net/mosquitto/files/mosquitto.in @@ -1,38 +1,44 @@ #!/bin/sh # PROVIDE: mosquitto # REQUIRE: DAEMON # BEFORE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable mosquitto: # # mosquitto_enable="YES" # mosquitto_flags="" # # See mosquitto(8) for flags # . /etc/rc.subr name=mosquitto rcvar=mosquitto_enable mosquitto_enable=${mosquitto_enable:="NO"} mosquitto_config=${mosquitto_config:="%%PREFIX%%/etc/mosquitto/mosquitto.conf"} +mosquitto_user=${mosquitto_user:="nobody"} command=%%PREFIX%%/sbin/mosquitto command_args="-c ${mosquitto_config} -d" -pidfile=$(grep pidfile ${mosquitto_config} | awk '{print($2)}') +pidfile=${mosquitto_pidfile:-"/var/run/mosquitto.pid"} required_files=${mosquitto_config} extra_commands="reload" stop_postcmd=stop_postcmd stop_postcmd() { rm -f $pidfile } +start_precmd=start_precmd +start_precmd() +{ + install -o ${mosquitto_user} -m 644 /dev/null ${pidfile} +} load_rc_config $name run_rc_command "$1"