summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Kicherer <dev@kicherer.org>2015-02-15 20:19:36 +0100
committerMario Kicherer <dev@kicherer.org>2015-02-15 20:19:36 +0100
commit09acfce8ee59a8cb7f51960840e309e3cb56e28c (patch)
tree5a18f959fbb8e78f62a10ae232c826f2e219a518
parent[games-engine/openxcom] Version bump (diff)
downloadgamerlay-09acfce8ee59a8cb7f51960840e309e3cb56e28c.tar.gz
gamerlay-09acfce8ee59a8cb7f51960840e309e3cb56e28c.tar.bz2
gamerlay-09acfce8ee59a8cb7f51960840e309e3cb56e28c.zip
[games-puzzle/londonlaw] new ebuild
-rw-r--r--games-puzzle/londonlaw/files/londonlaw.confd2
-rw-r--r--games-puzzle/londonlaw/files/londonlaw.rc21
-rw-r--r--games-puzzle/londonlaw/londonlaw-9999.ebuild93
3 files changed, 116 insertions, 0 deletions
diff --git a/games-puzzle/londonlaw/files/londonlaw.confd b/games-puzzle/londonlaw/files/londonlaw.confd
new file mode 100644
index 0000000..083798b
--- /dev/null
+++ b/games-puzzle/londonlaw/files/londonlaw.confd
@@ -0,0 +1,2 @@
+#run londonlaw on port 7921 (default)
+LONDONLAW_PORT="7921"
diff --git a/games-puzzle/londonlaw/files/londonlaw.rc b/games-puzzle/londonlaw/files/londonlaw.rc
new file mode 100644
index 0000000..fbc185c
--- /dev/null
+++ b/games-puzzle/londonlaw/files/londonlaw.rc
@@ -0,0 +1,21 @@
+#!/sbin/runscript
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting londonlaw server"
+ start-stop-daemon --start --pidfile /var/run/london-server.pid \
+ --user GAMES_USER_DED --background --stdout GAMES_LOGDIR/PN.log \
+ --stderr GAMES_LOGDIR/PN.log --make-pidfile \
+ --exec GAMES_BINDIR/london-server -- -p $LONDONLAW_PORT
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping londonlaw server"
+ start-stop-daemon --stop --pidfile /var/run/london-server.pid \
+ --exec GAMES_BINDIR/london-server
+ eend $?
+}
diff --git a/games-puzzle/londonlaw/londonlaw-9999.ebuild b/games-puzzle/londonlaw/londonlaw-9999.ebuild
new file mode 100644
index 0000000..ac09482
--- /dev/null
+++ b/games-puzzle/londonlaw/londonlaw-9999.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-single-r1 games git-r3
+
+DESCRIPTION="Clone of the famous Scotland Yard board game"
+HOMEPAGE="http://pessimization.com/software/londonlaw/"
+if [ "${PV}" == "9999" ]; then
+ EGIT_REPO_URI=https://github.com/anyc/londonlaw.git
+else
+ SRC_URI=""
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="dedicated"
+
+DEPEND="dev-python/twisted[${PYTHON_USEDEP}]
+ dev-python/zope-interface[${PYTHON_USEDEP}]
+
+ !dedicated? ( dev-python/wxpython:3.0[${PYTHON_USEDEP}] )
+ ${PYTHON_DEPS}"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+src_prepare() {
+ if use dedicated ; then
+ local f
+ rm -r londonlaw/{london-client,london-client.py,guiclient/}
+ sed -i \
+ -e "s:'londonlaw.guiclient',::" \
+ -e "s:'londonlaw/london-client',::" \
+ setup.py \
+ || die "sed failed"
+ fi
+
+ for f in londonlaw.rc londonlaw.confd
+ do
+ sed \
+ -e "s/GAMES_USER_DED/${GAMES_USER_DED}/" \
+ -e "s:GAMES_BINDIR:${GAMES_BINDIR}:" \
+ -e "s:GAMES_LOGDIR:${GAMES_LOGDIR}:" \
+ -e "s:PN:${PN}:" \
+ "${FILESDIR}/${f}" > "${T}/${f}" \
+ || die "sed failed"
+ done
+ sed -i \
+ -e "/serverdata/ s:\"$:\"\n dbDir = \"${GAMES_STATEDIR}/${PN}\":" \
+ londonlaw/server/GameRegistry.py \
+ || die "sed failed"
+
+ python_fix_shebang .
+}
+
+src_install() {
+ "${PYTHON}" setup.py install \
+ --root="${D}" \
+ --prefix="${GAMES_PREFIX}" \
+ --install-lib=$(python_get_sitedir) \
+ --install-data="${GAMES_DATADIR}" \
+ || die "install failed"
+ dodoc doc/ChangeLog README.md doc/TODO doc/manual.tex doc/readme.protocol
+ dohtml doc/manual.html
+
+ newinitd "${T}/londonlaw.rc" londonlaw
+ newconfd "${T}/londonlaw.confd" londonlaw
+ keepdir "${GAMES_STATEDIR}/${PN}"
+ dodir "${GAMES_LOGDIR}"
+ touch "${D}/${GAMES_LOGDIR}"/${PN}.log
+ fowners ${GAMES_USER_DED}:${GAMES_GROUP} \
+ "${GAMES_STATEDIR}/${PN}" "${GAMES_LOGDIR}"/${PN}.log
+
+ prepgamesdirs
+}
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ games_pkg_setup
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ if ! use dedicated ; then
+ echo
+ elog "To play, first start the server (london-server), then connect"
+ elog "with the client (london-client)."
+ echo
+ fi
+}