Gentoo Archives: gentoo-commits

From: "Tristan Heaven (nyhm)" <nyhm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: games-mods.eclass
Date: Tue, 06 Oct 2009 12:59:12
Message-Id: E1Mv9dD-00047y-Fl@stork.gentoo.org
1 nyhm 09/10/06 12:59:07
2
3 Modified: games-mods.eclass
4 Log:
5 name wrappers and init scripts ${PN/${GAME}-} instead of ${MOD_DIR}
6
7 Revision Changes Path
8 1.32 eclass/games-mods.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/games-mods.eclass?rev=1.32&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/games-mods.eclass?rev=1.32&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/games-mods.eclass?r1=1.31&r2=1.32
13
14 Index: games-mods.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/games-mods.eclass,v
17 retrieving revision 1.31
18 retrieving revision 1.32
19 diff -u -r1.31 -r1.32
20 --- games-mods.eclass 4 Oct 2009 14:13:59 -0000 1.31
21 +++ games-mods.eclass 6 Oct 2009 12:59:07 -0000 1.32
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.31 2009/10/04 14:13:59 nyhm Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/games-mods.eclass,v 1.32 2009/10/06 12:59:07 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 @@ -260,20 +260,20 @@
31 # We don't want to leave the binary directory around
32 rm -rf bin
33 elif [[ -n "${MOD_DIR}" ]] ; then
34 - games_make_wrapper "${GAME_EXE}-${MOD_DIR}" \
35 + games_make_wrapper "${GAME_EXE}-${PN/${GAME}-}" \
36 "${GAME_EXE} ${SELECT_MOD}${MOD_DIR}" "${dir}" "${dir}"
37 - make_desktop_entry "${GAME_EXE}-${MOD_DIR}" \
38 + make_desktop_entry "${GAME_EXE}-${PN/${GAME}-}" \
39 "${GAME_TITLE} - ${MOD_NAME}" "${MOD_ICON}"
40 # Since only quake3 has both a binary and a source-based install,
41 # we only look for quake3 here.
42 case "${GAME_EXE}" in
43 "quake3")
44 if has_version games-fps/quake3-bin ; then
45 - games_make_wrapper "${GAME_EXE}-bin-${MOD_DIR}" \
46 + games_make_wrapper "${GAME_EXE}-bin-${PN/${GAME}-}" \
47 "${GAME_EXE}-bin ${SELECT_MOD}${MOD_DIR}" \
48 "${dir}" "${dir}"
49 fi
50 - make_desktop_entry "${GAME_EXE}-bin-${MOD_DIR}" \
51 + make_desktop_entry "${GAME_EXE}-bin-${PN/${GAME}-}" \
52 "${GAME_TITLE} - ${MOD_NAME} (binary)" \
53 "${MOD_ICON}"
54 ;;
55 @@ -358,7 +358,7 @@
56 "${GAMES_PREFIX}"/${DED_CFG_DIR}/${MOD_DIR}/server.cfg
57 fi
58 games_make_wrapper \
59 - ${GAME_EXE}-${MOD_DIR}-ded \
60 + ${GAME_EXE}-${PN/${GAME}-}-ded \
61 "${DED_EXE} ${SELECT_MOD}${MOD_DIR} ${DED_OPTIONS}"
62 games-mods_make_initd
63 games-mods_make_confd
64 @@ -378,13 +378,13 @@
65 done
66 elif [[ -n "${MOD_DIR}" ]] ; then
67 elog "To play this mod run:"
68 - elog " ${GAME_EXE}-${MOD_DIR}"
69 + elog " ${GAME_EXE}-${PN/${GAME}-}"
70 echo
71 fi
72 fi
73 if games-mods_use_dedicated ; then
74 elog "To launch a dedicated server run:"
75 - elog " ${GAME_EXE}-${MOD_DIR}-ded"
76 + elog " ${GAME_EXE}-${PN/${GAME}-}-ded"
77 echo
78 elog "To launch server at startup run:"
79 elog " rc-update add ${GAME_EXE}-${MOD_DIR}-ded default"
80 @@ -393,7 +393,7 @@
81 }
82
83 games-mods_make_initd() {
84 - cat <<EOF > "${T}"/${GAME_EXE}-${MOD_DIR}-ded
85 + cat <<EOF > "${T}"/${GAME_EXE}-${PN/${GAME}-}-ded
86 #!/sbin/runscript
87 $(head -n 2 ${PORTDIR}/header.txt)
88 # Generated by games-mods.eclass
89 @@ -406,27 +406,27 @@
90 ebegin "Starting ${GAME_TITLE} ${MOD_NAME} dedicated server"
91 start-stop-daemon --start --quiet --background --chuid \\
92 ${GAMES_USER_DED}:${GAMES_GROUP} --env HOME="${GAMES_PREFIX}" --exec \\
93 - ${GAMES_BINDIR}/${GAME_EXE}-${MOD_DIR}-ded -- \\
94 - \${${GAME_EXE}_${MOD_DIR}_opts}
95 + ${GAMES_BINDIR}/${GAME_EXE}-${PN/${GAME}-}-ded -- \\
96 + \${${GAME_EXE}_${PN/${GAME}-}_opts}
97 eend \$?
98 }
99
100 stop() {
101 ebegin "Stopping ${GAME_TITLE} ${MOD_NAME} dedicated server"
102 start-stop-daemon --stop --quiet --exec \\
103 - ${GAMES_BINDIR}/${GAME_EXE}-${MOD_DIR}-ded
104 + ${GAMES_BINDIR}/${GAME_EXE}-${PN/${GAME}-}-ded
105 eend \$?
106 }
107 EOF
108
109 - doinitd "${T}"/${GAME_EXE}-${MOD_DIR}-ded || die "doinitd failed"
110 + doinitd "${T}"/${GAME_EXE}-${PN/${GAME}-}-ded || die "doinitd failed"
111 }
112
113 games-mods_make_confd() {
114 - cat <<-EOF > "${T}"/${GAME_EXE}-${MOD_DIR}-ded
115 + cat <<-EOF > "${T}"/${GAME_EXE}-${PN/${GAME}-}-ded
116 # Any extra options you want to pass to the dedicated server
117 - ${GAME_EXE}_${MOD_DIR}_opts=""
118 + ${GAME_EXE}_${PN/${GAME}-}_opts=""
119 EOF
120
121 - doconfd "${T}"/${GAME_EXE}-${MOD_DIR}-ded || die "doconfd failed"
122 + doconfd "${T}"/${GAME_EXE}-${PN/${GAME}-}-ded || die "doconfd failed"
123 }