1 |
commit: 731ccc5fd59675c7535c09ffe04265d10313fe1b |
2 |
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 27 23:38:36 2019 +0000 |
4 |
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 27 23:47:36 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=731ccc5f |
7 |
|
8 |
games-fps/ut2004: Drop USE flags, add init script, misc improvements |
9 |
|
10 |
If you just want the server without the client part of the game, use |
11 |
ut2004-ded instead. This package now unconditionally installs both the |
12 |
client and the server init script. |
13 |
|
14 |
Package-Manager: Portage-2.3.78, Repoman-2.3.17 |
15 |
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org> |
16 |
|
17 |
games-fps/ut2004/files/ut2004-ded.confd | 6 ++ |
18 |
games-fps/ut2004/files/ut2004-ded.initd | 13 ++++ |
19 |
games-fps/ut2004/ut2004-3369.3-r2.ebuild | 102 +++++++++++++------------------ |
20 |
3 files changed, 61 insertions(+), 60 deletions(-) |
21 |
|
22 |
diff --git a/games-fps/ut2004/files/ut2004-ded.confd b/games-fps/ut2004/files/ut2004-ded.confd |
23 |
new file mode 100644 |
24 |
index 00000000000..e82238b93de |
25 |
--- /dev/null |
26 |
+++ b/games-fps/ut2004/files/ut2004-ded.confd |
27 |
@@ -0,0 +1,6 @@ |
28 |
+# User and group the server should run as. |
29 |
+ut2004_ded_user="nobody" |
30 |
+ut2004_ded_group="nobody" |
31 |
+ |
32 |
+# Any extra options you want to pass to the server. |
33 |
+ut2004_ded_opts="DM-Deck17" |
34 |
|
35 |
diff --git a/games-fps/ut2004/files/ut2004-ded.initd b/games-fps/ut2004/files/ut2004-ded.initd |
36 |
new file mode 100644 |
37 |
index 00000000000..c4cf9810cd1 |
38 |
--- /dev/null |
39 |
+++ b/games-fps/ut2004/files/ut2004-ded.initd |
40 |
@@ -0,0 +1,13 @@ |
41 |
+#!/sbin/openrc-run |
42 |
+# Copyright 1999-2019 Gentoo Authors |
43 |
+# Distributed under the terms of the GNU General Public License v2 |
44 |
+ |
45 |
+pidfile="/var/run/${RC_SVCNAME}.pid" |
46 |
+command_background="true" |
47 |
+command_user="${ut2004_ded_user}:${ut2004_ded_group}" |
48 |
+command="ut2004-ded" |
49 |
+command_args="${ut2004_ded_opts}" |
50 |
+ |
51 |
+depend() { |
52 |
+ need net |
53 |
+} |
54 |
|
55 |
diff --git a/games-fps/ut2004/ut2004-3369.3-r2.ebuild b/games-fps/ut2004/ut2004-3369.3-r2.ebuild |
56 |
index 9a5ffa68ae7..77ba2877605 100644 |
57 |
--- a/games-fps/ut2004/ut2004-3369.3-r2.ebuild |
58 |
+++ b/games-fps/ut2004/ut2004-3369.3-r2.ebuild |
59 |
@@ -5,98 +5,80 @@ EAPI=7 |
60 |
|
61 |
inherit desktop eutils |
62 |
|
63 |
-MY_P="${PN}-lnxpatch${PV%.*}-2.tar.bz2" |
64 |
- |
65 |
+PATCH_P="${PN}-lnxpatch${PV%.*}-2.tar.bz2" |
66 |
DESCRIPTION="Editor's Choice Edition plus Mega Pack for the well-known first-person shooter" |
67 |
-HOMEPAGE="http://www.unrealtournament2004.com/" |
68 |
+HOMEPAGE="https://liandri.beyondunreal.com/Unreal_Tournament_2004" |
69 |
SRC_URI=" |
70 |
- http://ut2004.ut-files.com/index.php?dir=Patches/Linux/&file=${MY_P} -> ${MY_P} |
71 |
- http://storage.guntoo.de/downs/downloads/Patch/ut2004-v${PV/./-}-linux-dedicated.7z |
72 |
- mirror://gentoo/ut2004-v${PV/./-}-linux-dedicated.7z" |
73 |
+ https://ut2004.ut-files.com/Patches/Linux/${PATCH_P} |
74 |
+ https://dev.gentoo.org/~chewi/distfiles/ut2004-v${PV/./-}-linux-dedicated.7z |
75 |
+" |
76 |
|
77 |
LICENSE="ut2003" |
78 |
SLOT="0" |
79 |
-KEYWORDS="~amd64 ~x86" |
80 |
-IUSE="dedicated opengl" |
81 |
+KEYWORDS="-* ~amd64 ~x86" |
82 |
RESTRICT="bindist mirror strip" |
83 |
|
84 |
-UIDEPEND=" |
85 |
+RDEPEND=" |
86 |
+ !games-server/ut2004-ded |
87 |
+ games-fps/ut2004-bonuspack-ece |
88 |
+ games-fps/ut2004-bonuspack-mega |
89 |
+ >=games-fps/ut2004-data-3186-r5 |
90 |
+ media-libs/libsdl |
91 |
+ media-libs/openal |
92 |
+ sys-libs/glibc |
93 |
~virtual/libstdc++-3.3 |
94 |
virtual/opengl |
95 |
- x11-libs/libXext |
96 |
x11-libs/libX11 |
97 |
x11-libs/libXau |
98 |
x11-libs/libXdmcp |
99 |
- media-libs/libsdl |
100 |
- media-libs/openal" |
101 |
-RDEPEND=" |
102 |
- sys-libs/glibc |
103 |
- games-fps/ut2004-data |
104 |
- games-fps/ut2004-bonuspack-ece |
105 |
- games-fps/ut2004-bonuspack-mega |
106 |
- dedicated? ( !games-server/ut2004-ded ) |
107 |
- opengl? ( ${UIDEPEND} ) |
108 |
- !dedicated? ( !opengl? ( ${UIDEPEND} ) )" |
109 |
+ x11-libs/libXext |
110 |
+" |
111 |
+ |
112 |
BDEPEND="app-arch/p7zip" |
113 |
|
114 |
S="${WORKDIR}/${PN^^}-Patch" |
115 |
+DIR="/opt/${PN}" |
116 |
|
117 |
-# The executable pages are required #114733 |
118 |
-QA_PREBUILT=" |
119 |
- /opt/${PN}/System/ut2004-bin |
120 |
- /opt/${PN}/System/ucc-bin" |
121 |
+# The executable pages are required. Bug #114733. |
122 |
+QA_PREBUILT="*" |
123 |
|
124 |
src_prepare() { |
125 |
default |
126 |
|
127 |
- cd System || die |
128 |
- |
129 |
- # These files are owned by ut2004-bonuspack-mega |
130 |
- rm -f Manifest.in{i,t} Packages.md5 ucc-bin* || die |
131 |
- |
132 |
- if use amd64 ; then |
133 |
- mv -f ut2004-bin-linux-amd64 ut2004-bin || die |
134 |
+ if use amd64; then |
135 |
+ mv System/${PN}-bin{-linux-amd64,} || die |
136 |
+ mv ../${PN}-ucc-bin-09192008/ucc-bin-linux-amd64 System/ucc-bin || die |
137 |
else |
138 |
- rm -f ut2004-bin-linux-amd64 || die |
139 |
+ rm System/${PN}-bin-linux-amd64 || die |
140 |
+ mv ../${PN}-ucc-bin-09192008/ucc-bin System/ucc-bin || die |
141 |
fi |
142 |
|
143 |
- cd "${WORKDIR}"/ut2004-ucc-bin-09192008 || die |
144 |
- if use amd64 ; then |
145 |
- mv -f ucc-bin-linux-amd64 "${S}"/System/ucc-bin || die |
146 |
- else |
147 |
- mv -f ucc-bin "${S}"/System/ || die |
148 |
- fi |
149 |
- |
150 |
- if use dedicated && ! use opengl ; then |
151 |
- rm -f "${S}"/System/ut2004-bin || die |
152 |
- fi |
153 |
+ # In ut2004-bonuspack-mega. |
154 |
+ rm System/{Manifest.in[it],Packages.md5} || die |
155 |
} |
156 |
|
157 |
src_install() { |
158 |
- insinto /opt/${PN} |
159 |
+ insinto "${DIR}" |
160 |
doins -r . |
161 |
- fperms +x /opt/${PN}/System/ucc-bin |
162 |
+ fperms +x "${DIR}"/System/{ucc,${PN}}-bin |
163 |
|
164 |
- if use opengl || ! use dedicated ; then |
165 |
- fperms +x /opt/${PN}/System/ut2004-bin |
166 |
+ dosym ../../../usr/$(get_libdir)/libopenal.so "${DIR}"/System/openal.so |
167 |
+ dosym ../../../usr/$(get_libdir)/libSDL-1.2.so.0 "${DIR}"/System/libSDL-1.2.so.0 |
168 |
|
169 |
- dosym ../../../usr/$(get_libdir)/libopenal.so /opt/${PN}/System/openal.so |
170 |
- dosym ../../../usr/$(get_libdir)/libSDL-1.2.so.0 /opt/${PN}/System/libSDL-1.2.so.0 |
171 |
+ make_wrapper ${PN} ./${PN}-bin "${DIR}"/System "${DIR}" |
172 |
+ make_wrapper ${PN}-ded "./ucc-bin server" "${DIR}"/System |
173 |
|
174 |
- make_wrapper ut2004 ./ut2004 /opt/${PN} /opt/${PN} |
175 |
- make_desktop_entry ut2004 "Unreal Tournament 2004" |
176 |
- fi |
177 |
+ make_desktop_entry ${PN} "Unreal Tournament 2004" |
178 |
|
179 |
- if use dedicated ; then |
180 |
- make_wrapper ut2004-ded "./ucc-bin server" /opt/${PN}/System |
181 |
- fi |
182 |
+ newconfd "${FILESDIR}"/${PN}-ded.confd ${PN}-ded |
183 |
+ newinitd "${FILESDIR}"/${PN}-ded.initd ${PN}-ded |
184 |
} |
185 |
|
186 |
pkg_postinst() { |
187 |
- # Here is where we check for the existence of a cdkey... |
188 |
- # If we don't find one, we ask the user for it |
189 |
- if [[ -f "${EROOT}"/opt/${PN}/System/cdkey ]] ; then |
190 |
- einfo "A cdkey file is already present in /opt/${PN}/System" |
191 |
+ # Here is where we check for the existence of a cdkey. |
192 |
+ # If we don't find one, we ask the user for it. |
193 |
+ if [[ -f "${EROOT}${DIR}"/System/cdkey ]] ; then |
194 |
+ einfo "A cdkey file is already present in ${EPREFIX}${DIR}/System" |
195 |
else |
196 |
ewarn "You MUST run this before playing the game:" |
197 |
ewarn "emerge --config =${CATEGORY}/${PF}" |
198 |
@@ -112,7 +94,7 @@ pkg_postinst() { |
199 |
} |
200 |
|
201 |
pkg_postrm() { |
202 |
- ewarn "This package leaves a cdkey file in ${EROOT}/opt/${PN}/System that you need" |
203 |
+ ewarn "This package leaves a cdkey file in ${EROOT}${DIR}/System that you need" |
204 |
ewarn "to remove to completely get rid of this game's files." |
205 |
} |
206 |
|
207 |
@@ -131,7 +113,7 @@ pkg_config() { |
208 |
echo "You entered a blank CD key. Try again." |
209 |
else |
210 |
if [[ ${CDKEY1} == ${CDKEY2} ]] ; then |
211 |
- echo "${CDKEY1}" | tr [:lower:] [:upper:] > "${EROOT}"/opt/${PN}/System/cdkey || die |
212 |
+ echo "${CDKEY1^^}" > "${EROOT}${DIR}"/System/cdkey || die |
213 |
einfo "Thank you!" |
214 |
break |
215 |
else |