1 |
nyhm 09/10/01 16:03:40 |
2 |
|
3 |
Modified: games-mods.eclass |
4 |
Log: |
5 |
use games_make_wrapper instead of own function; move installation of confd and initd files into the games-mod_make* functions |
6 |
|
7 |
Revision Changes Path |
8 |
1.26 eclass/games-mods.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/games-mods.eclass?rev=1.26&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/games-mods.eclass?rev=1.26&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/games-mods.eclass?r1=1.25&r2=1.26 |
13 |
|
14 |
Index: games-mods.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/games-mods.eclass,v |
17 |
retrieving revision 1.25 |
18 |
retrieving revision 1.26 |
19 |
diff -u -r1.25 -r1.26 |
20 |
--- games-mods.eclass 1 Oct 2009 14:05:04 -0000 1.25 |
21 |
+++ games-mods.eclass 1 Oct 2009 16:03:40 -0000 1.26 |
22 |
@@ -1,6 +1,6 @@ |
23 |
# Copyright 1999-2009 Gentoo Foundation |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/games-mods.eclass,v 1.25 2009/10/01 14:05:04 nyhm Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/games-mods.eclass,v 1.26 2009/10/01 16:03:40 nyhm Exp $ |
27 |
|
28 |
# Variables to specify in an ebuild which uses this eclass: |
29 |
# GAME - (doom3, quake4 or ut2004, etc), unless ${PN} starts with e.g. "doom3-" |
30 |
@@ -351,15 +351,11 @@ |
31 |
dosym "${GAMES_SYSCONFDIR}"/${GAME}/${MOD_DIR}/server.cfg \ |
32 |
"${GAMES_PREFIX}"/${DED_CFG_DIR}/${MOD_DIR}/server.cfg |
33 |
fi |
34 |
- games-mods_make_ded_exec |
35 |
- newgamesbin "${T}"/${GAME_EXE}-${MOD_DIR}-ded.bin \ |
36 |
- ${GAME_EXE}-${MOD_DIR}-ded || die "dedicated" |
37 |
- games-mods_make_init.d |
38 |
- newinitd "${T}"/${GAME_EXE}-${MOD_DIR}-ded.init.d \ |
39 |
- ${GAME_EXE}-${MOD_DIR}-ded || die "init.d" |
40 |
- games-mods_make_conf.d |
41 |
- newconfd "${T}"/${GAME_EXE}-${MOD_DIR}-ded.conf.d \ |
42 |
- ${GAME_EXE}-${MOD_DIR}-ded || die "conf.d" |
43 |
+ games_make_wrapper \ |
44 |
+ ${GAME_EXE}-${MOD_DIR}-ded \ |
45 |
+ "${DED_EXE} ${SELECT_MOD}${MOD_DIR} ${DED_OPTIONS}" |
46 |
+ games-mods_make_initd |
47 |
+ games-mods_make_confd |
48 |
fi |
49 |
|
50 |
prepgamesdirs |
51 |
@@ -390,51 +386,41 @@ |
52 |
fi |
53 |
} |
54 |
|
55 |
-games-mods_make_ded_exec() { |
56 |
- cat <<-EOF > "${T}"/${GAME_EXE}-${MOD_DIR}-ded.bin |
57 |
- #!/bin/sh |
58 |
- ${GAMES_BINDIR}/${DED_EXE} ${SELECT_MOD}${MOD_DIR} ${DED_OPTIONS} \${@} |
59 |
- EOF |
60 |
-} |
61 |
- |
62 |
-games-mods_make_init.d() { |
63 |
- cat <<EOF > "${T}"/${GAME_EXE}-${MOD_DIR}-ded.init.d |
64 |
+games-mods_make_initd() { |
65 |
+ cat <<EOF > "${T}"/${GAME_EXE}-${MOD_DIR}-ded |
66 |
#!/sbin/runscript |
67 |
-$(<${PORTDIR}/header.txt) |
68 |
+$(head -n 2 ${PORTDIR}/header.txt) |
69 |
+# Generated by games-mods.eclass |
70 |
|
71 |
depend() { |
72 |
need net |
73 |
} |
74 |
|
75 |
start() { |
76 |
- ebegin "Starting ${GAME_TITLE} - ${MOD_NAME} dedicated server" |
77 |
+ ebegin "Starting ${GAME_TITLE} ${MOD_NAME} dedicated server" |
78 |
start-stop-daemon --start --quiet --background --chuid \\ |
79 |
${GAMES_USER_DED}:games --env HOME="${GAMES_PREFIX}" --exec \\ |
80 |
- ${GAMES_BINDIR}/${GAME_EXE}-${MOD_DIR}-ded \\ |
81 |
- \${${GAME_EXE}_${MOD_DIR}_OPTS} |
82 |
+ ${GAMES_BINDIR}/${GAME_EXE}-${MOD_DIR}-ded -- \\ |
83 |
+ \${${GAME_EXE}_${MOD_DIR}_opts} |
84 |
eend \$? |
85 |
} |
86 |
|
87 |
stop() { |
88 |
- ebegin "Stopping ${GAME_TITLE} - ${MOD_NAME} dedicated server" |
89 |
+ ebegin "Stopping ${GAME_TITLE} ${MOD_NAME} dedicated server" |
90 |
start-stop-daemon --stop --quiet --exec \\ |
91 |
${GAMES_BINDIR}/${GAME_EXE}-${MOD_DIR}-ded |
92 |
eend \$? |
93 |
} |
94 |
EOF |
95 |
-} |
96 |
|
97 |
-games-mods_make_conf.d() { |
98 |
- if [[ -e ${FILESDIR}/${GAME_EXE}-${MOD_DIR}.conf.d ]] ; then |
99 |
- cp "${FILESDIR}"/${GAME_EXE}-${MOD_DIR}.conf.d \ |
100 |
- "${T}"/${GAME_EXE}-${MOD_DIR}-ded.conf.d |
101 |
- return 0 |
102 |
- fi |
103 |
-cat <<-EOF > "${T}"/${GAME_EXE}-${MOD_DIR}-ded.conf.d |
104 |
- $(<${PORTDIR}/header.txt) |
105 |
+ doinitd "${T}"/${GAME_EXE}-${MOD_DIR}-ded || die "doinitd failed" |
106 |
+} |
107 |
|
108 |
+games-mods_make_confd() { |
109 |
+ cat <<-EOF > "${T}"/${GAME_EXE}-${MOD_DIR}-ded |
110 |
# Any extra options you want to pass to the dedicated server |
111 |
- # ${GAME_EXE}_${MOD_DIR}_OPTS="+set com_hunkmegs 64 +set com_zonemegs 32" |
112 |
- |
113 |
+ ${GAME_EXE}_${MOD_DIR}_opts="" |
114 |
EOF |
115 |
+ |
116 |
+ doconfd "${T}"/${GAME_EXE}-${MOD_DIR}-ded || die "doconfd failed" |
117 |
} |