diff options
author | Danny Rawlins <romster@shortcircuit.net.au> | 2008-05-05 15:06:34 +1000 |
---|---|---|
committer | Danny Rawlins <romster@shortcircuit.net.au> | 2008-05-08 19:20:10 +1000 |
commit | 630426be7ecaa1cc6da236f64a209372d1a512ec (patch) | |
tree | e9f094f11596135a9d7b6ad44d4de3c24706186b /wesnoth-server | |
parent | fc305ce9c9a261bbba844d06a432a503e27cd2b6 (diff) | |
download | contrib-630426be7ecaa1cc6da236f64a209372d1a512ec.tar.gz contrib-630426be7ecaa1cc6da236f64a209372d1a512ec.tar.xz |
wesnoth-server: initial commit
Diffstat (limited to 'wesnoth-server')
-rw-r--r-- | wesnoth-server/.footprint | 9 | ||||
-rw-r--r-- | wesnoth-server/.md5sum | 2 | ||||
-rw-r--r-- | wesnoth-server/Pkgfile | 39 | ||||
-rwxr-xr-x | wesnoth-server/pre-install | 41 | ||||
-rw-r--r-- | wesnoth-server/wesnothd.rc | 40 |
5 files changed, 131 insertions, 0 deletions
diff --git a/wesnoth-server/.footprint b/wesnoth-server/.footprint new file mode 100644 index 000000000..8ca54f254 --- /dev/null +++ b/wesnoth-server/.footprint @@ -0,0 +1,9 @@ +drwxr-xr-x root/root etc/ +drwxr-xr-x root/root etc/rc.d/ +-rwxr-xr-x root/root etc/rc.d/wesnoth +drwxr-xr-x root/root usr/ +drwxr-xr-x root/root usr/bin/ +-rwxr--r-- _wesnoth/daemon usr/bin/wesnothd +drwxr-xr-x root/root usr/var/ +drwxr-xr-x root/root usr/var/run/ +drwx------ _wesnoth/daemon usr/var/run/wesnothd/ diff --git a/wesnoth-server/.md5sum b/wesnoth-server/.md5sum new file mode 100644 index 000000000..2b3cdea40 --- /dev/null +++ b/wesnoth-server/.md5sum @@ -0,0 +1,2 @@ +a357fcba2f2055ce112f25941a681374 wesnoth-1.4.1.tar.bz2 +345191c344845c040d2f1e37123f9b83 wesnothd.rc diff --git a/wesnoth-server/Pkgfile b/wesnoth-server/Pkgfile new file mode 100644 index 000000000..c61db6872 --- /dev/null +++ b/wesnoth-server/Pkgfile @@ -0,0 +1,39 @@ +# Description: Server for Wesnoth. +# URL: http://www.wesnoth.org/ +# Maintainer: Danny Rawlins, monster dot romster at gmail dot com +# Packager: Danny Rawlins, monster dot romster at gmail dot com +# Depends on: xorg-libx11 sdl_image sdl_mixer sdl_net freetype boost + +name=wesnoth-server +version=1.4.1 +release=1 +source=(http://dl.sourceforge.net/sourceforge/wesnoth/wesnoth-$version.tar.bz2 \ + wesnothd.rc) + +build() { + cd wesnoth-$version + rm po/*/*.po + + sed -i \ + -e 's/USE_NLS=yes/USE_NLS=no/' \ + -e 's/ENABLE_NLS 1/ENABLE_NLS 0/' configure + + ./configure \ + --prefix=/usr \ + --mandir=/usr/man \ + --disable-nls \ + --disable-game \ + --enable-server + + make + make DESTDIR=$PKG install + install -m 0755 -D ../wesnothd.rc $PKG/etc/rc.d/wesnoth + + chown _wesnoth:daemon \ + $PKG/usr/bin/wesnothd \ + $PKG/usr/var/run/wesnothd + + chmod g-x,o-x $PKG/usr/bin/wesnothd + find $PKG/usr/man -maxdepth 0 -type d ! -regex 'man?' -exec rm -r {} \; +} + diff --git a/wesnoth-server/pre-install b/wesnoth-server/pre-install new file mode 100755 index 000000000..8eca84d2d --- /dev/null +++ b/wesnoth-server/pre-install @@ -0,0 +1,41 @@ +#!/bin/sh +# Created by Danny Rawlins, monster dot romster at gmail dot com + +GROUP=daemon +USER=_wesnoth +USER_COMMENT="Wesnoth game server" +USER_HOME=/var/empty +USER_SHELL=/bin/sh + +if [ ! $(id -u) = 0 ]; then + echo "ERROR: you need to be root to run this!" + exit 1 +fi + +if [ $GROUP ]; then + if ! getent group $GROUP > /dev/null; then + /usr/sbin/groupadd $GROUP + if [ $? -eq 0 ]; then + echo "Group: $GROUP added." + fi + else + echo "Group: $GROUP already exists! Skipping." + fi +fi + +if ! getent passwd $USER > /dev/null; then + /usr/sbin/useradd -g $GROUP -c "$USER_COMMENT" -d $USER_HOME -s $USER_SHELL $USER + if [ $? -eq 0 ]; then + echo "User: $USER added." + /usr/bin/passwd -l $USER > /dev/null + if [ $? -eq 0 ]; then + echo "Locked: $USER account." + fi + else + echo "ERROR: unable to lock $USER account." + /usr/sbin/userdel $USER + fi + else + echo "User: $USER already exists! Skipping." +fi + diff --git a/wesnoth-server/wesnothd.rc b/wesnoth-server/wesnothd.rc new file mode 100644 index 000000000..b0609c954 --- /dev/null +++ b/wesnoth-server/wesnothd.rc @@ -0,0 +1,40 @@ +#!/bin/sh +# +# /etc/rc.d/wesnoth: start/stop wesnothd daemon +# + +# User settings here +DAEMON=wesnothd +RUN_AS_USER=_wesnoth + +RETVAL=0 + +case $1 in +start) + echo -n "Starting $DAEMON..." + su $RUN_AS_USER -c /usr/bin/$DAEMON > /dev/null & RETVAL=$? + if [ $RETVAL = 0 ]; then + echo " done." + fi + ;; +stop) + echo -n "Shutting down $DAEMON..." + killall -q /usr/bin/$DAEMON + RETVAL=$? + echo " done." + ;; +restart) + $0 stop + sleep 2 + $0 start + RETVAL=$? + ;; +*) + echo "usage: $0 [start|stop|restart]" + exit 1 + ;; +esac + +exit $RETVAL + +# End of file |