diff options
author | mnag <mnag@FreeBSD.org> | 2006-04-15 02:10:37 +0800 |
---|---|---|
committer | mnag <mnag@FreeBSD.org> | 2006-04-15 02:10:37 +0800 |
commit | 1ac2d8d3932ecbd4d5abc22844faad2301946ba4 (patch) | |
tree | 515d50300df36080a91de3f5b280c1d2156438d8 /audio/teamspeak_server | |
parent | 2a98f1bd679cb8431a4b62445bf02f966747077f (diff) | |
download | freebsd-ports-gnome-1ac2d8d3932ecbd4d5abc22844faad2301946ba4.tar.gz freebsd-ports-gnome-1ac2d8d3932ecbd4d5abc22844faad2301946ba4.tar.zst freebsd-ports-gnome-1ac2d8d3932ecbd4d5abc22844faad2301946ba4.zip |
- Use new style rc.d script.
- Reorganize Makefile
- Bump PORTREVISION
PR: 95063
Submitted by: "Anish Mistry" <amistry___am-productions.biz>
Approved by: maintainer
Diffstat (limited to 'audio/teamspeak_server')
-rw-r--r-- | audio/teamspeak_server/Makefile | 25 | ||||
-rw-r--r-- | audio/teamspeak_server/files/teamspeak-server.in | 35 | ||||
-rw-r--r-- | audio/teamspeak_server/files/teamspeak_server.sh | 29 | ||||
-rw-r--r-- | audio/teamspeak_server/pkg-plist | 1 |
4 files changed, 49 insertions, 41 deletions
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 |