aboutsummaryrefslogtreecommitdiff
path: root/audio/jamulus
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2021-03-23 01:47:23 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2021-03-23 01:47:23 +0000
commitfe0fee4919324374c610dab77391eae4c1018bfe (patch)
tree41d1af51b080dd0be9ce4c904162fe2264c7701e /audio/jamulus
parent542ebcbf919c1fd0ae75d2aa482376e21417012a (diff)
downloadports-fe0fee4919324374c610dab77391eae4c1018bfe.tar.gz
ports-fe0fee4919324374c610dab77391eae4c1018bfe.zip
audio/jamulus: Favorize by adding the 'server' flavor
Notes
Notes: svn path=/head/; revision=569005
Diffstat (limited to 'audio/jamulus')
-rw-r--r--audio/jamulus/Makefile61
-rw-r--r--audio/jamulus/files/jamulus-server.in30
-rw-r--r--audio/jamulus/pkg-message32
3 files changed, 104 insertions, 19 deletions
diff --git a/audio/jamulus/Makefile b/audio/jamulus/Makefile
index efda36ccd9b3..2837646abc02 100644
--- a/audio/jamulus/Makefile
+++ b/audio/jamulus/Makefile
@@ -3,7 +3,7 @@
PORTNAME= jamulus
DISTVERSIONPREFIX= r
DISTVERSION= 3_7_0
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= audio
MAINTAINER= yuri@FreeBSD.org
@@ -14,35 +14,58 @@ LICENSE_FILE= ${WRKSRC}/COPYING
LIB_DEPENDS= libjack.so:audio/jack
+FLAVORS= desktop server
+FLAVOR?= ${FLAVORS:[1]}
+server_PKGNAMESUFFIX= -server
+
USES= compiler:c++11-lang gl pkgconfig qmake qt:5
-USE_QT= concurrent core gui network widgets xml buildtools_build linguisttools_build
+USE_QT= concurrent core network xml buildtools_build linguisttools_build
USE_GL= gl
USE_GITHUB= yes
GH_ACCOUNT= jamulussoftware
+.if ${FLAVOR:U} == desktop
+USE_QT+= gui widgets
PLIST_FILES= bin/${PORTNAME} \
- share/applications/jamulus.desktop \
- share/applications/jamulus-server.desktop \
- share/pixmaps/jamulus.png \
- share/pixmaps/jamulus-server.png
+ share/applications/${PORTNAME}.desktop \
+ share/applications/${PORTNAME}-server.desktop \
+ share/pixmaps/${PORTNAME}.png \
+ share/pixmaps/${PORTNAME}-server.png
+.endif
+
+.if ${FLAVOR:U} == server
+COMMENT+= (headless server)
+QMAKE_ARGS= CONFIG+="headless nosound"
+USER= nobody
+SUB_LIST= USER=${USER}
+USE_RC_SUBR= ${PORTNAME}-server
+PLIST_FILES= bin/${PORTNAME}-server
+.endif
-QMAKE_ARGS= CONFIG+="noupcasename"
+QMAKE_ARGS+= CONFIG+="noupcasename"
PORTSCOUT= limit:^r\d+_ # prevent malformatted tags, like 'latest'
+.if ${FLAVOR:U} == desktop
+post-install:
+ # workaround for https://gitlab.xfce.org/xfce/xfdesktop/-/issues/131
+ ${MV} ${STAGEDIR}${PREFIX}/share/icons/hicolor/512x512/apps/jamulus.png ${STAGEDIR}${PREFIX}/share/pixmaps/
+ ${RM} -r ${STAGEDIR}${PREFIX}/share/icons
+ # add Jamulus Server menu item which is simply 'jamulus -s' with a special icon
+ ${CP} ${STAGEDIR}${PREFIX}/share/applications/${PORTNAME}.desktop ${STAGEDIR}${PREFIX}/share/applications/${PORTNAME}-server.desktop
+ ${REINPLACE_CMD} -i '' ' \
+ s|Name=Jamulus|Name=Jamulus Server| ; \
+ s|Comment=Jam Session|Comment=Jam Session Server| ; \
+ s|Exec=jamulus|Exec=jamulus -s| ; \
+ s|Icon=jamulus|Icon=jamulus-server| ; \
+ ' ${STAGEDIR}${PREFIX}/share/applications/${PORTNAME}-server.desktop
+ ${INSTALL_DATA} ${WRKSRC}/src/res/fronticonserver.png ${STAGEDIR}${PREFIX}/share/pixmaps/${PORTNAME}-server.png
+.endif
+
+.if ${FLAVOR:U} == server
post-install:
- # workaround for https://gitlab.xfce.org/xfce/xfdesktop/-/issues/131
- ${MV} ${STAGEDIR}${PREFIX}/share/icons/hicolor/512x512/apps/jamulus.png ${STAGEDIR}${PREFIX}/share/pixmaps/
- ${RM} -r ${STAGEDIR}${PREFIX}/share/icons
- # add Jamulus Server menu item which is simply 'jamulus -s' with a special icon
- ${CP} ${STAGEDIR}${PREFIX}/share/applications/jamulus.desktop ${STAGEDIR}${PREFIX}/share/applications/jamulus-server.desktop
- ${REINPLACE_CMD} -i '' ' \
- s|Name=Jamulus|Name=Jamulus Server| ; \
- s|Comment=Jam Session|Comment=Jam Session Server| ; \
- s|Exec=jamulus|Exec=jamulus -s| ; \
- s|Icon=jamulus|Icon=jamulus-server| ; \
- ' ${STAGEDIR}${PREFIX}/share/applications/jamulus-server.desktop
- ${INSTALL_DATA} ${WRKSRC}/src/res/fronticonserver.png ${STAGEDIR}${PREFIX}/share/pixmaps/jamulus-server.png
+ ${MV} ${STAGEDIR}${PREFIX}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}-server
+.endif
.include <bsd.port.mk>
diff --git a/audio/jamulus/files/jamulus-server.in b/audio/jamulus/files/jamulus-server.in
new file mode 100644
index 000000000000..f503113c5f71
--- /dev/null
+++ b/audio/jamulus/files/jamulus-server.in
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: jamulus-server
+# REQUIRE: DAEMON NETWORKING
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable jamulus_server:
+# jamulus_server_enable : set to "YES" to enable the daemon, default is "NO"
+# jamulus_server_flags : any extra flags, default is ""
+# - list of all possible flags: https://jamulus.io/wiki/Command-Line-Options
+
+. /etc/rc.subr
+
+name=jamulus_server
+rcvar=jamulus_server_enable
+
+load_rc_config $name
+
+jamulus_server_enable=${jamulus_server_enable:-"NO"}
+jamulus_server_flags=${jamulus_server_flags:-""}
+
+logfile="/var/log/${name}.log"
+
+procname=%%PREFIX%%/bin/jamulus-server
+command="/usr/sbin/daemon"
+command_args="-u %%USER%% -o ${logfile} -t ${name} %%PREFIX%%/bin/jamulus-server -s ${jamulus_server_flags}"
+
+run_rc_command "$1"
diff --git a/audio/jamulus/pkg-message b/audio/jamulus/pkg-message
new file mode 100644
index 000000000000..6a3bdab536e7
--- /dev/null
+++ b/audio/jamulus/pkg-message
@@ -0,0 +1,32 @@
+[
+{ type: install
+ message: <<EOM
+You installed Jamulus: Internet jam session software
+
+Most users need Jamulus client to listen to or participate in jam sessions
+hosted by others.
+
+You can run Jamulus client using the menu item or by running the "jamulus"
+command.
+
+Some users also need to run Jamulus server to host jam sessions.
+
+You can run Jamulus server as a graphical program by using the "Jamulus Server"
+menu item, or run the "jamulus -s" command.
+
+You can also run Jamulus Server as a headless server. In order to do this you
+need to install the jamulus-server package and run:
+# sysrc jamulus_server_enable="YES"
+# service jamulus-server start
+and then navigate to your server by your IP address in the Jamulus Client.
+
+You can also start the Jamulus Server service once with:
+# service jamulus-server onestart
+
+Please read https://jamulus.io/wiki/Command-Line-Options and add appropriate
+Jamulus Server options to jamulus_server_flags="{your options}"
+in /etc/rc.config
+
+EOM
+}
+]