diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2006-08-28 20:14:42 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2006-08-28 20:14:42 +0000 |
commit | deb72e9dba724f46046af245d80d0c19717f6b06 (patch) | |
tree | 2956def2d99330dfc8122b1a1e545c239b114be2 /net/vserver | |
parent | 8ddaf23bf5657ad405382ce9823f0857f94b91f3 (diff) | |
download | ports-deb72e9dba724f46046af245d80d0c19717f6b06.tar.gz ports-deb72e9dba724f46046af245d80d0c19717f6b06.zip |
Notes
Diffstat (limited to 'net/vserver')
-rw-r--r-- | net/vserver/Makefile | 28 | ||||
-rw-r--r-- | net/vserver/distinfo | 6 | ||||
-rw-r--r-- | net/vserver/files/pkg-deinstall.in | 25 | ||||
-rw-r--r-- | net/vserver/files/pkg-install.in | 93 | ||||
-rw-r--r-- | net/vserver/files/vserver.in | 44 |
5 files changed, 189 insertions, 7 deletions
diff --git a/net/vserver/Makefile b/net/vserver/Makefile index 324a09c227a1..c1bf3d4faddc 100644 --- a/net/vserver/Makefile +++ b/net/vserver/Makefile @@ -6,16 +6,36 @@ # PORTNAME= vserver -PORTVERSION= 2.42f +PORTVERSION= 2.43a CATEGORIES= net MASTER_SITES= http://www.enforcer.cc/vchat/filez/ MAINTAINER= mickey@netassembly.de COMMENT= Server software of the VChat conference system -GNU_CONFIGURE= yes +HAS_CONFIGURE= yes +USE_RC_SUBR= vserver MAN8= vchatctl.8 vserver.8 -PLIST_FILES= sbin/vserver sbin/vchatctl -.include <bsd.port.mk> +VCHATUSER= vchat +VCHATGROUP= vchat + +SUB_FILES= pkg-install pkg-deinstall +SUB_LIST+= VCHATUSER=${VCHATUSER} \ + VCHATGROUP=${VCHATGROUP} + +PLIST_FILES= sbin/vserver sbin/vchatctl \ + "@dirrmtry etc/vchat" + +.include <bsd.port.pre.mk> + +pre-install: + @${SETENV} PKG_PREFIX=${PREFIX} \ + ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL + +post-install: + @${SETENV} PKG_PREFIX=${PREFIX} \ + ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + +.include <bsd.port.post.mk> diff --git a/net/vserver/distinfo b/net/vserver/distinfo index fe7f29202403..dd137d421aa0 100644 --- a/net/vserver/distinfo +++ b/net/vserver/distinfo @@ -1,3 +1,3 @@ -MD5 (vserver-2.42f.tar.gz) = a177993f51877a3e9c21dd4787bded8c -SHA256 (vserver-2.42f.tar.gz) = 86dddc414ca0372a3f10d1a32db346539ece4befd97bb3ab214cac50412c8526 -SIZE (vserver-2.42f.tar.gz) = 121606 +MD5 (vserver-2.43a.tar.gz) = c2fae94f0cdfe438711aeede741e38f8 +SHA256 (vserver-2.43a.tar.gz) = 74e53c2a5446e3c21c025db776e56938b57a724151949057130f622eee1115fa +SIZE (vserver-2.43a.tar.gz) = 241481 diff --git a/net/vserver/files/pkg-deinstall.in b/net/vserver/files/pkg-deinstall.in new file mode 100644 index 000000000000..0eab04e3dc3c --- /dev/null +++ b/net/vserver/files/pkg-deinstall.in @@ -0,0 +1,25 @@ +#! /bin/sh + +if [ "$2" != "POST-DEINSTALL" ]; then + exit 0 +fi + +PREFIX=${PKG_PREFIX:-%%PREFIX%%} +VCHATUSER=%%VCHATUSER%% +VCHATGROUP=%%VCHATGROUP%% + +if pw usershow "${VCHATUSER}" 2>/dev/null 1>&2; then + + echo "To delete ${VCHATUSER} user permanently, use 'pw userdel \"${VCHATUSER}\"'" + +fi + +if [ -d "${PREFIX}/etc/vchat" ]; then + + + echo "If you do not intend to use this package any longer, please delete" + echo "the directory \"${PREFIX}/etc/vchat\" manually." + +fi + +exit 0 diff --git a/net/vserver/files/pkg-install.in b/net/vserver/files/pkg-install.in new file mode 100644 index 000000000000..e677774c5ee9 --- /dev/null +++ b/net/vserver/files/pkg-install.in @@ -0,0 +1,93 @@ +#! /bin/sh + +PREFIX=${PKG_PREFIX:-%%PREFIX%%} + +VCHATUSER=%%VCHATUSER%% +VCHATGROUP=%%VCHATGROUP%% +UID=128 +GID=128 + +if [ -n "%%DESTDIR%%" ]; then + + PW="/usr/sbin/chroot %%DESTDIR%% pw" + CHOWN="/usr/sbin/chroot %%DESTDIR%% chown" + CHMOD="/usr/sbin/chroot %%DESTDIR%% chmod" + MKDIR="/usr/sbin/chroot %%DESTDIR%% mkdir -p" + +else + + PW="pw" + CHOWN="chown" + CHMOD="chmod" + MKDIR="mkdir" + + +fi + + +if [ "$2" = "PRE-INSTALL" ]; then + + if ! ${PW} groupshow ${VCHATGROUP} 2>/dev/null 1>&2; then + + if ${PW} groupadd ${VCHATGROUP} -g $GID; then + echo "=> Added group \"${VCHATGROUP}\"." + else + echo "=> Adding group \"${VCHATGROUP}\" failed." + exit 1 + fi + fi + + if ! ${PW} usershow ${VCHATUSER} 2>/dev/null 1>&2; then + + if ${PW} useradd ${VCHATUSER} -u $UID -g ${VCHATGROUP} -h - \ + -s "/sbin/nologin" -d "/nonexistent" \ + -c "VChat Conferencing System"; \ + then + + echo "=> Added user \"${VCHATUSER}\"." + + else + + echo "=> Adding user \"${VCHATUSER}\" failed." + exit 1 + + fi + fi + +elif [ "$2" = "POST-INSTALL" ]; then + + if [ ! -d "${PREFIX}/etc/vchat" ]; then + ${MKDIR} ${PREFIX}/etc/vchat || exit 1 + fi + + ${CHOWN} ${VCHATUSER}:${VCHATGROUP} ${PREFIX}/etc/vchat + ${CHMOD} 755 ${PREFIX}/etc/vchat + + if [ ! -f "${PREFIX}/etc/vchat/user.db" ]; then + + +cat << -EOT- + +****************************** IMPORTANT NOTE ******************************* + +Before starting vserver into normal operations for the first time, you +need to create an initial user database file "${PREFIX}/etc/vchat/user.db". + +This is accomplished by running the following command sequence: + +su -f -m ${VCHATUSER} -c "${PREFIX}/sbin/vserver /BASEDIR=${PREFIX}/etc/vchat /CREATEUDB" + +***************************************************************************** + +-EOT- + + else + + ${CHOWN} ${VCHATUSER}:${VCHATGROUP} ${PREFIX}/etc/vchat/user.db + ${CHMOD} 600 ${PREFIX}/etc/vchat/user.db + + fi + +fi + +exit 0 diff --git a/net/vserver/files/vserver.in b/net/vserver/files/vserver.in new file mode 100644 index 000000000000..c122fb1e7f82 --- /dev/null +++ b/net/vserver/files/vserver.in @@ -0,0 +1,44 @@ +#!/bin/sh + +# +# $Id: startup-freebsd.sh,v 1.2 2006/06/03 17:18:59 mickey Exp $ +# +# FreeBSD boot time start up script for vserver(8). +# +# PROVIDE: vserver +# REQUIRE: LOGIN +# KEYWORD: FreeBSD shutdown + +# +# Add the following line to /etc/rc.conf to enable vserver: +# +# vserver_enable="YES" +# +# Additional commandline qualifiers to be passed to vserver(8) may +# be specified in /etc/rc.conf by adding: +# +# vserver_flags="<your commandline qualifiers here>" +# +# See vserver(8) for a detailed description of vserver commandline qualifiers. +# + +. %%RC_SUBR%% + +name=vserver +rcvar=`set_rcvar` + +command=%%PREFIX%%/sbin/vserver +required_files=%%PREFIX%%/etc/vchat/user.db + +# read settings, set default values + +load_rc_config "$name" +: ${vserver_enable="NO"} +: ${vserver_flags="/SYSLOG"} +: ${vserver_user="vchat"} +: ${vserver_group="vchat"} +: ${vserver_pidfile="%%PREFIX%%/etc/vchat/vserver.pid"} + +command_args="/DETACH" + +run_rc_command "$1" |