diff --git a/comms/svxlink/Makefile b/comms/svxlink/Makefile index f0180a805dce..7caea05c081a 100644 --- a/comms/svxlink/Makefile +++ b/comms/svxlink/Makefile @@ -1,126 +1,127 @@ PORTNAME?= svxlink PORTVERSION= 19.09.2 +PORTREVISION= 1 CATEGORIES= comms hamradio MAINTAINER= hamradio@FreeBSD.org COMMENT?= General purpose ham radio voice services WWW= https://www.svxlink.org/ LICENSE?= GPLv2 LIB_DEPENDS?= libcurl.so:ftp/curl \ libgcrypt.so:security/libgcrypt \ libgpg-error.so:security/libgpg-error \ libgsm.so:audio/gsm \ libopus.so:audio/opus \ libpopt.so:devel/popt \ librtlsdr.so:comms/rtl-sdr \ libsigc-2.0.so:devel/libsigc++20 \ libspeex.so:audio/speex BUILD_DEPENDS= ${LOCALBASE}/include/linux/input.h:devel/evdev-proto USES+= cmake:noninja compiler:c++11-lang groff pkgconfig tcl USE_GITHUB= yes GH_ACCOUNT= sm0svx GH_PROJECT= svxlink CMAKE_SOURCE_PATH= ${WRKSRC}/src CMAKE_ARGS+= -DLOCAL_STATE_DIR=/var \ -DLOCALBASE:STRING="${LOCALBASE}" \ -DMAN_INSTALL_DIR:FILEPATH=${PREFIX}/share/man USERS= svxlink GROUPS= svxlink USE_RC_SUBR= remotetrx svxlink svxreflector .if ${PORTNAME} == svxlink CMAKE_ARGS+= -DUSE_QT:BOOL=NO .endif USE_LDCONFIG= yes ALL_TARGET?= all man OPTIONS_DEFINE= DOCS DOXYGEN STATIC STATIC_DESC= Build and install static libraries STATIC_CMAKE_ON= -DBUILD_STATIC_LIBS=YES .if ${PORTNAME} == svxlink OPTIONS_DEFAULT= ALSA OSS OPTIONS_MULTI= SOUND OPTIONS_MULTI_SOUND= ALSA OSS ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib ALSA_CMAKE_OFF= -DUSE_ALSA:BOOL=OFF ALSA_CMAKE_ON= -DUSE_ALSA:BOOL=ON OSS_CMAKE_OFF= -DUSE_OSS:BOOL=OFF OSS_CMAKE_ON= -DUSE_OSS:BOOL=ON .endif DOXYGEN_IMPLIES= DOCS DOXYGEN_ALL_TARGET= doc DOXYGEN_CMAKE_OFF= -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen:BOOL=TRUE DOXYGEN_BUILD_DEPENDS= dot:graphics/graphviz \ doxygen:devel/doxygen OPTIONS_SUB= yes PORTDOCS= * post-patch: @${GREP} -lr /dev/ttyS0 ${WRKSRC} | ${GREP} -v .bak | ${GREP} -v .orig | ${XARGS} \ ${REINPLACE_CMD} -e 's|/dev/ttyS0|/dev/ttyu0|' @${REINPLACE_CMD} -e 's|/usr/share/icons|${PREFIX}/share/icons|' \ ${WRKSRC}/src/qtel/qtel.desktop @${REINPLACE_CMD} -e 's|/usr/share/svxlink|${DOCSDIR}|' \ ${WRKSRC}/src/doc/man/svxlink.conf.5 @${REINPLACE_CMD} -e 's|/usr/bin/|${PREFIX}/bin/|' ${WRKSRC}/src/qtel/qtel.desktop \ ${WRKSRC}/src/doc/man/svxlink.conf.5 \ ${WRKSRC}/src/svxlink/svxlink/svxlink.conf.in @${REINPLACE_CMD} -e 's|/usr/lib|${PREFIX}/lib|' \ ${WRKSRC}/src/doc/man/svxlink.conf.5 post-patch-OSS-on: @${GREP} -lr alsa:default ${WRKSRC} | ${GREP} -v .bak | ${GREP} -v .orig | ${XARGS} \ ${REINPLACE_CMD} -e 's|alsa:default|oss:/dev/dsp|' @${GREP} -lr alsa:plughw:0 ${WRKSRC} | ${GREP} -v .bak | ${GREP} -v .orig | ${XARGS} \ ${REINPLACE_CMD} -e 's|alsa:plughw:0|oss:/dev/dsp|' .if ${PORTNAME} == svxlink post-install: ${MV} ${STAGEDIR}${PREFIX}/etc/svxlink/.procmailrc \ ${STAGEDIR}${PREFIX}/etc/svxlink/.procmailrc.sample ${MV} ${STAGEDIR}${PREFIX}/etc/svxlink/gpio.conf \ ${STAGEDIR}${PREFIX}/etc/svxlink/gpio.conf.sample ${MV} ${STAGEDIR}${PREFIX}/etc/svxlink/TclVoiceMail.conf \ ${STAGEDIR}${PREFIX}/etc/svxlink/TclVoiceMail.conf.sample ${MV} ${STAGEDIR}${PREFIX}/etc/svxlink/remotetrx.conf \ ${STAGEDIR}${PREFIX}/etc/svxlink/remotetrx.conf.sample ${MV} ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.conf \ ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.conf.sample ${MV} ${STAGEDIR}${PREFIX}/etc/svxlink/svxreflector.conf \ ${STAGEDIR}${PREFIX}/etc/svxlink/svxreflector.conf.sample ${MV} ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleDtmfRepeater.conf \ ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleDtmfRepeater.conf.sample ${MV} ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleEchoLink.conf \ ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleEchoLink.conf.sample ${MV} ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleFrn.conf \ ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleFrn.conf.sample ${MV} ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleHelp.conf \ ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleHelp.conf.sample ${MV} ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleMetarInfo.conf \ ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleMetarInfo.conf.sample ${MV} ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleParrot.conf \ ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleParrot.conf.sample ${MV} ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModulePropagationMonitor.conf \ ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModulePropagationMonitor.conf.sample ${MV} ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleSelCallEnc.conf \ ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleSelCallEnc.conf.sample ${MV} ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleTclVoiceMail.conf \ ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleTclVoiceMail.conf.sample ${MV} ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleTrx.conf \ ${STAGEDIR}${PREFIX}/etc/svxlink/svxlink.d/ModuleTrx.conf.sample do-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/src/doc/README-19.09.adoc ${STAGEDIR}${DOCSDIR} .endif .if ${PORTNAME} == qtel post-install: ${RM} ${STAGEDIR}${PREFIX}/include/svxlink/CppStdCompat.h ${RM} ${STAGEDIR}${PREFIX}/include/svxlink/common.h ${RM} ${STAGEDIR}${PREFIX}/lib/libsvxmisc.a .endif ${INSTALL} -d ${STAGEDIR}/var/spool/svxlink .include diff --git a/comms/svxlink/files/patch-src_svxlink_svxlink_CMakeLists.txt b/comms/svxlink/files/patch-src_svxlink_svxlink_CMakeLists.txt new file mode 100644 index 000000000000..b1f0d566d71d --- /dev/null +++ b/comms/svxlink/files/patch-src_svxlink_svxlink_CMakeLists.txt @@ -0,0 +1,12 @@ +--- src/svxlink/svxlink/CMakeLists.txt.orig 2021-03-09 23:15:07 UTC ++++ src/svxlink/svxlink/CMakeLists.txt +@@ -55,6 +55,9 @@ add_version_target(SVXLINK VERSION_DEPENDS) + set(VERSION_DEPENDS) + add_version_target(SVXLINK VERSION_DEPENDS) + ++# Needed on FreeBSD ++string(PREPEND CMAKE_CXX_FLAGS "-Wl,-export-dynamic ") ++ + # Build the executable + add_executable(svxlink + MsgHandler.cpp Module.cpp Logic.cpp SimplexLogic.cpp RepeaterLogic.cpp diff --git a/comms/svxlink/files/remotetrx.in b/comms/svxlink/files/remotetrx.in new file mode 100644 index 000000000000..b3c8f6f797f1 --- /dev/null +++ b/comms/svxlink/files/remotetrx.in @@ -0,0 +1,32 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: remotetrx +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add these lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# remotetrx_enable (bool): Set to NO by default. +# Set it to YES to enable remotetrx. +# remotetrx_config (path): Set to %%PREFIX%%/etc/remotetrx/remotetrx +# by default. + +. /etc/rc.subr + +name=remotetrx +rcvar=remotetrx_enable + +load_rc_config $name + +: ${remotetrx_enable:="NO"} +: ${remotetrx_config="%%PREFIX%%/etc/remotetrx/remotetrx.conf"} + +command=%%PREFIX%%/bin/${name} +pidfile=/var/run/${name}.pid + +command_args="--config $remotetrx_config --daemon --runasuser svxlink --pidfile ${pidfile}" + +run_rc_command "$1" diff --git a/comms/svxlink/files/svxlink.in b/comms/svxlink/files/svxlink.in new file mode 100644 index 000000000000..aba8a2ecebfc --- /dev/null +++ b/comms/svxlink/files/svxlink.in @@ -0,0 +1,31 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: svxlink +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add these lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# svxlink_enable (bool): Set to NO by default. +# Set it to YES to enable svxlink. +# svxlink_config (path): Set to %%PREFIX%%/etc/svxlink/svxlink.conf +# by default. + +. /etc/rc.subr + +name=svxlink +rcvar=svxlink_enable + +load_rc_config $name + +: ${svxlink_enable:="NO"} +: ${svxlink_config="%%PREFIX%%/etc/svxlink/svxlink.conf"} + +command=%%PREFIX%%/bin/${name} +pidfile=/var/run/${name}.pid +command_args="--config $svxlink_config --daemon --runasuser ${name} --pidfile ${pidfile}" + +run_rc_command "$1" diff --git a/comms/svxlink/files/svxreflector.in b/comms/svxlink/files/svxreflector.in new file mode 100644 index 000000000000..0e66932fc4b9 --- /dev/null +++ b/comms/svxlink/files/svxreflector.in @@ -0,0 +1,32 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: remotetrx +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add these lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# svxreflector_enable (bool): Set to NO by default. +# Set it to YES to enable svxreflector. +# svxreflector_config (path): Set to %%PREFIX%%/etc/svxlink/svxreflector.conf +# by default. + +. /etc/rc.subr + +name=svxreflector +rcvar=svxreflector_enable + +load_rc_config $name + +: ${svxreflector_enable:="NO"} +: ${svxreflector_config="%%PREFIX%%/etc/svxlink/svxreflector.conf"} + +command=%%PREFIX%%/bin/${name} +pidfile=/var/run/${name}.pid + +command_args="--config $svxreflector_config --daemon --runasuser svxlink --pidfile ${pidfile}" + +run_rc_command "$1" diff --git a/comms/svxlink/pkg-message b/comms/svxlink/pkg-message new file mode 100644 index 000000000000..f1766bf86153 --- /dev/null +++ b/comms/svxlink/pkg-message @@ -0,0 +1,22 @@ +[ +{ type: install + message: <