1 |
commit: 18cac6dffeba8ca04620b6525c08129957d53e8c |
2 |
Author: Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri Jul 29 14:49:55 2011 +0000 |
4 |
Commit: Azamat H. Hackimov <winterheart <AT> gentoo <DOT> ru> |
5 |
CommitDate: Fri Jul 29 14:49:55 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gamerlay.git;a=commit;h=18cac6df |
7 |
|
8 |
[games-action/teeworlds] Rev-bump - init-script for server instance. |
9 |
By krigstask via jabber. |
10 |
|
11 |
--- |
12 |
games-action/teeworlds/files/teeworlds-init.d | 40 ++++++++++++++++++++ |
13 |
games-action/teeworlds/files/teeworlds_srv.cfg | 7 +++ |
14 |
...rlds-0.6.0.ebuild => teeworlds-0.6.0-r1.ebuild} | 3 + |
15 |
3 files changed, 50 insertions(+), 0 deletions(-) |
16 |
|
17 |
diff --git a/games-action/teeworlds/files/teeworlds-init.d b/games-action/teeworlds/files/teeworlds-init.d |
18 |
new file mode 100644 |
19 |
index 0000000..1c4badd |
20 |
--- /dev/null |
21 |
+++ b/games-action/teeworlds/files/teeworlds-init.d |
22 |
@@ -0,0 +1,40 @@ |
23 |
+#!/sbin/runscript |
24 |
+# Copyright 1999-2006 Gentoo Foundation |
25 |
+# Distributed under the terms of the GNU General Public License v2 |
26 |
+ |
27 |
+PIDFILE=/var/run/teeworlds.pid |
28 |
+GAME_DIRECTORY=/usr/games/bin |
29 |
+CONFIG=/etc/teeworlds/teeworlds_srv.cfg |
30 |
+ |
31 |
+depend() { |
32 |
+ use dns logger net |
33 |
+} |
34 |
+ |
35 |
+checkconfig() { |
36 |
+ if [ ! -e ${CONFIG} ] ; then |
37 |
+ eerror "You need an ${CONFIG} config file to run TeeWorlds" |
38 |
+ return 1 |
39 |
+ fi |
40 |
+} |
41 |
+ |
42 |
+start() { |
43 |
+ ebegin "Starting TeeWorlds" |
44 |
+ start-stop-daemon --start --background --pidfile "${PIDFILE}" \ |
45 |
+ --make-pidfile -d ${GAME_DIRECTORY} --user games \ |
46 |
+ --exec ${GAME_DIRECTORY}/teeworlds_srv -- -f ${CONFIG} |
47 |
+ eend $? |
48 |
+} |
49 |
+ |
50 |
+reload() { |
51 |
+ ebegin "Reloading TeeWorlds configs and restarting processes" |
52 |
+ start-stop-daemon --stop --oknodo --user games \ |
53 |
+ --pidfile "${PIDFILE}" --signal HUP \ |
54 |
+ --exec ${GAME_DIRECTORY}/teeworlds_srv -- -f ${CONFIG} |
55 |
+ eend $? |
56 |
+} |
57 |
+ |
58 |
+stop() { |
59 |
+ ebegin "Stopping TeeWorlds" |
60 |
+ start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" |
61 |
+ eend $? |
62 |
+} |
63 |
|
64 |
diff --git a/games-action/teeworlds/files/teeworlds_srv.cfg b/games-action/teeworlds/files/teeworlds_srv.cfg |
65 |
new file mode 100644 |
66 |
index 0000000..dc67562 |
67 |
--- /dev/null |
68 |
+++ b/games-action/teeworlds/files/teeworlds_srv.cfg |
69 |
@@ -0,0 +1,7 @@ |
70 |
+# sample Teeworlds server config file |
71 |
+# see http://www.teeworlds.com/?page=docs&wiki=ServerSettings for details |
72 |
+sv_gametype dm |
73 |
+sv_map dm1 |
74 |
+sv_name gentoo-teeworlds |
75 |
+sv_register 1 |
76 |
+sv_scorelimit 20 |
77 |
\ No newline at end of file |
78 |
|
79 |
diff --git a/games-action/teeworlds/teeworlds-0.6.0.ebuild b/games-action/teeworlds/teeworlds-0.6.0-r1.ebuild |
80 |
similarity index 95% |
81 |
rename from games-action/teeworlds/teeworlds-0.6.0.ebuild |
82 |
rename to games-action/teeworlds/teeworlds-0.6.0-r1.ebuild |
83 |
index 0e620fc..7f01b3d 100644 |
84 |
--- a/games-action/teeworlds/teeworlds-0.6.0.ebuild |
85 |
+++ b/games-action/teeworlds/teeworlds-0.6.0-r1.ebuild |
86 |
@@ -89,6 +89,9 @@ src_install() { |
87 |
insinto "${GAMES_DATADIR}"/${PN}/data/maps |
88 |
doins -r data/maps/* || die "doins failed" |
89 |
fi |
90 |
+ newinitd "${FILESDIR}"/${PN}-init.d ${PN} |
91 |
+ insinto "/etc/${PN}" |
92 |
+ doins "${FILESDIR}"/teeworlds_srv.cfg |
93 |
|
94 |
dodoc readme.txt || die "dodoc failed" |