aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--audio/teamspeak3-server/Makefile25
-rw-r--r--audio/teamspeak3-server/files/teamspeak-server.in35
-rw-r--r--audio/teamspeak3-server/files/teamspeak_server.sh29
-rw-r--r--audio/teamspeak3-server/pkg-plist1
-rw-r--r--audio/teamspeak_server/Makefile25
-rw-r--r--audio/teamspeak_server/files/teamspeak-server.in35
-rw-r--r--audio/teamspeak_server/files/teamspeak_server.sh29
-rw-r--r--audio/teamspeak_server/pkg-plist1
8 files changed, 98 insertions, 82 deletions
diff --git a/audio/teamspeak3-server/Makefile b/audio/teamspeak3-server/Makefile
index 57f6a4746ec9..69bb8fa8fdaa 100644
--- a/audio/teamspeak3-server/Makefile
+++ b/audio/teamspeak3-server/Makefile
@@ -7,6 +7,7 @@
PORTNAME= teamspeak_server
PORTVERSION= 2.0.20.1
+PORTREVISION= 1
CATEGORIES= audio net
MASTER_SITES= ftp://ftp.freenet.de/pub/4players/teamspeak.org/releases/
DISTNAME= ts2_server_rc2_20201
@@ -19,22 +20,24 @@ ONLY_FOR_ARCHS= i386
USE_BZIP2= yes
NO_BUILD= yes
USE_LINUX= yes
+PKGDEINSTALL= ${PKGINSTALL}
-do-install:
- @ ${SETENV} PKG_PREFIX=${PREFIX} \
+USE_RC_SUBR= teamspeak-server
+
+pre-install:
+ @${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
- ${MKDIR} ${PREFIX}/lib/teamspeak_server
+
+do-install:
+ @${MKDIR} ${PREFIX}/lib/teamspeak_server
${TAR} -C ${WRKSRC} -cf - . | ${TAR} -C ${PREFIX}/lib/teamspeak_server -xf -
- ${SED} -e 's#%%TSHOME%%#${PREFIX}/lib/teamspeak_server#' <${FILESDIR}/teamspeak_server.sh >${WRKSRC}/teamspeak_server.sh
- ${INSTALL_SCRIPT} ${WRKSRC}/teamspeak_server.sh ${PREFIX}/etc/rc.d/teamspeak_server.sh.sample
- ${RM} ${WRKSRC}/teamspeak_server.sh
- @ ${SETENV} PKG_PREFIX=${PREFIX} \
+
+post-install:
+ @${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL
post-deinstall:
- @ ${SETENV} PKG_PREFIX=${PREFIX} \
+ @${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGDEINSTALL} ${PORTNAME} POST-DEINSTALL
-.include <bsd.port.pre.mk>
-PKGDEINSTALL= ${PKGINSTALL}
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/audio/teamspeak3-server/files/teamspeak-server.in b/audio/teamspeak3-server/files/teamspeak-server.in
new file mode 100644
index 000000000000..eae1f09842a0
--- /dev/null
+++ b/audio/teamspeak3-server/files/teamspeak-server.in
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: teamspeak
+# REQUIRE: NETWORKING
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# teamspeak_enable (bool): Set to NO by default.
+# Set it to YES to enable teamspeak.
+#
+
+. %%RC_SUBR%%
+
+name=teamspeak
+rcvar=${name}_enable
+
+command="%%PREFIX%%/lib/teamspeak_server/server_linux"
+command_args=">/dev/null"
+pidfile="%%PREFIX%%/lib/teamspeak_server/server.pid"
+stop_postcmd="teamspeak_poststop"
+
+teamspeak_poststop()
+{
+ /bin/rm -f "${pidfile}"
+}
+
+load_rc_config $name
+
+: ${teamspeak_enable="NO"}
+
+run_rc_command "$1"
diff --git a/audio/teamspeak3-server/files/teamspeak_server.sh b/audio/teamspeak3-server/files/teamspeak_server.sh
deleted file mode 100644
index be5137cbfcc1..000000000000
--- a/audio/teamspeak3-server/files/teamspeak_server.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-#
-# Start/stop the TeamSpeak 2 server
-#
-
-TSHOME=%%TSHOME%%
-PIDFILE=${TSHOME}/server.pid
-
-cd "$TSHOME"
-
-case "$1" in
- start)
- su -fm teamspeak -c './server_linux >/dev/null' && echo -n ' teamspeak_server'
- ;;
- stop)
- kill -TERM `cat "$PIDFILE"`
- ;;
- restart)
- $0 stop
- echo 5 second pause before restart. . .
- sleep 5
- $0 start
- ;;
- *)
- echo "Usage: $0 {start|stop|restart}"
- exit 1
-esac
-exit 0
-
diff --git a/audio/teamspeak3-server/pkg-plist b/audio/teamspeak3-server/pkg-plist
index ae3535e10042..7dbdc288b0de 100644
--- a/audio/teamspeak3-server/pkg-plist
+++ b/audio/teamspeak3-server/pkg-plist
@@ -1,4 +1,3 @@
-etc/rc.d/teamspeak_server.sh.sample
lib/teamspeak_server/INSTALL
lib/teamspeak_server/INSTALL.mysql
lib/teamspeak_server/Manual/C1H_HTML.css
diff --git a/audio/teamspeak_server/Makefile b/audio/teamspeak_server/Makefile
index 57f6a4746ec9..69bb8fa8fdaa 100644
--- a/audio/teamspeak_server/Makefile
+++ b/audio/teamspeak_server/Makefile
@@ -7,6 +7,7 @@
PORTNAME= teamspeak_server
PORTVERSION= 2.0.20.1
+PORTREVISION= 1
CATEGORIES= audio net
MASTER_SITES= ftp://ftp.freenet.de/pub/4players/teamspeak.org/releases/
DISTNAME= ts2_server_rc2_20201
@@ -19,22 +20,24 @@ ONLY_FOR_ARCHS= i386
USE_BZIP2= yes
NO_BUILD= yes
USE_LINUX= yes
+PKGDEINSTALL= ${PKGINSTALL}
-do-install:
- @ ${SETENV} PKG_PREFIX=${PREFIX} \
+USE_RC_SUBR= teamspeak-server
+
+pre-install:
+ @${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
- ${MKDIR} ${PREFIX}/lib/teamspeak_server
+
+do-install:
+ @${MKDIR} ${PREFIX}/lib/teamspeak_server
${TAR} -C ${WRKSRC} -cf - . | ${TAR} -C ${PREFIX}/lib/teamspeak_server -xf -
- ${SED} -e 's#%%TSHOME%%#${PREFIX}/lib/teamspeak_server#' <${FILESDIR}/teamspeak_server.sh >${WRKSRC}/teamspeak_server.sh
- ${INSTALL_SCRIPT} ${WRKSRC}/teamspeak_server.sh ${PREFIX}/etc/rc.d/teamspeak_server.sh.sample
- ${RM} ${WRKSRC}/teamspeak_server.sh
- @ ${SETENV} PKG_PREFIX=${PREFIX} \
+
+post-install:
+ @${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL
post-deinstall:
- @ ${SETENV} PKG_PREFIX=${PREFIX} \
+ @${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGDEINSTALL} ${PORTNAME} POST-DEINSTALL
-.include <bsd.port.pre.mk>
-PKGDEINSTALL= ${PKGINSTALL}
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/audio/teamspeak_server/files/teamspeak-server.in b/audio/teamspeak_server/files/teamspeak-server.in
new file mode 100644
index 000000000000..eae1f09842a0
--- /dev/null
+++ b/audio/teamspeak_server/files/teamspeak-server.in
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: teamspeak
+# REQUIRE: NETWORKING
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# teamspeak_enable (bool): Set to NO by default.
+# Set it to YES to enable teamspeak.
+#
+
+. %%RC_SUBR%%
+
+name=teamspeak
+rcvar=${name}_enable
+
+command="%%PREFIX%%/lib/teamspeak_server/server_linux"
+command_args=">/dev/null"
+pidfile="%%PREFIX%%/lib/teamspeak_server/server.pid"
+stop_postcmd="teamspeak_poststop"
+
+teamspeak_poststop()
+{
+ /bin/rm -f "${pidfile}"
+}
+
+load_rc_config $name
+
+: ${teamspeak_enable="NO"}
+
+run_rc_command "$1"
diff --git a/audio/teamspeak_server/files/teamspeak_server.sh b/audio/teamspeak_server/files/teamspeak_server.sh
deleted file mode 100644
index be5137cbfcc1..000000000000
--- a/audio/teamspeak_server/files/teamspeak_server.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-#
-# Start/stop the TeamSpeak 2 server
-#
-
-TSHOME=%%TSHOME%%
-PIDFILE=${TSHOME}/server.pid
-
-cd "$TSHOME"
-
-case "$1" in
- start)
- su -fm teamspeak -c './server_linux >/dev/null' && echo -n ' teamspeak_server'
- ;;
- stop)
- kill -TERM `cat "$PIDFILE"`
- ;;
- restart)
- $0 stop
- echo 5 second pause before restart. . .
- sleep 5
- $0 start
- ;;
- *)
- echo "Usage: $0 {start|stop|restart}"
- exit 1
-esac
-exit 0
-
diff --git a/audio/teamspeak_server/pkg-plist b/audio/teamspeak_server/pkg-plist
index ae3535e10042..7dbdc288b0de 100644
--- a/audio/teamspeak_server/pkg-plist
+++ b/audio/teamspeak_server/pkg-plist
@@ -1,4 +1,3 @@
-etc/rc.d/teamspeak_server.sh.sample
lib/teamspeak_server/INSTALL
lib/teamspeak_server/INSTALL.mysql
lib/teamspeak_server/Manual/C1H_HTML.css