Gentoo Archives: gentoo-commits

From: Amy Winston <amynka@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-roguelike/mangband/, games-roguelike/mangband/files/
Date: Sun, 29 May 2016 08:32:19
Message-Id: 1464510509.cf2dd43960ddaba7674b966b116cb0e9868043eb.amynka@gentoo
1 commit: cf2dd43960ddaba7674b966b116cb0e9868043eb
2 Author: Amy Winston <amynka <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 29 08:28:29 2016 +0000
4 Commit: Amy Winston <amynka <AT> gentoo <DOT> org>
5 CommitDate: Sun May 29 08:28:29 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf2dd439
7
8 games-roguelike/mangband: initial commit new package bug #139020
9
10 Package-Manager: portage-2.2.28
11
12 games-roguelike/mangband/Manifest | 1 +
13 .../mangband/files/mangband-1.1.3-paths.patch | 118 +++++++++++++++++++++
14 .../mangband/files/mangband-1.1.3-strchr.patch | 22 ++++
15 games-roguelike/mangband/mangband-1.1.3.ebuild | 84 +++++++++++++++
16 games-roguelike/mangband/metadata.xml | 12 +++
17 5 files changed, 237 insertions(+)
18
19 diff --git a/games-roguelike/mangband/Manifest b/games-roguelike/mangband/Manifest
20 new file mode 100644
21 index 0000000..752e404
22 --- /dev/null
23 +++ b/games-roguelike/mangband/Manifest
24 @@ -0,0 +1 @@
25 +DIST mangband-1.1.3.tar.gz 1497078 SHA256 d4917c51fc84a0626db1b09f6cf8b0ebc4522dd8ab34334e56fba8275ede9069 SHA512 5efda352607953e94a433bf9aabb496419a22c984dc9e054cebc90623682da23a90fb6cb910fcc950010d469571f2af515bfa7740c921add44ac9ea95e723130 WHIRLPOOL 28bf625bf930dff87e66ef8f500043a061b5834e830b1f377f7115c824432fc8025ab687fb6bc3bf69e73c8316ece0f4707cf6550ba3f6560d1c2b456c510bd0
26
27 diff --git a/games-roguelike/mangband/files/mangband-1.1.3-paths.patch b/games-roguelike/mangband/files/mangband-1.1.3-paths.patch
28 new file mode 100644
29 index 0000000..dd95515
30 --- /dev/null
31 +++ b/games-roguelike/mangband/files/mangband-1.1.3-paths.patch
32 @@ -0,0 +1,118 @@
33 +diff --git a/src/config.h.in b/src/config.h.in
34 +index e8efdca..9a6290a 100644
35 +--- a/config.h.in
36 ++++ a/config.h.in
37 +@@ -473,6 +473,9 @@
38 + #ifndef DEFAULT_PATH
39 + # define DEFAULT_PATH "./lib/"
40 + #endif
41 ++#ifndef DEFAULT_PATH_W
42 ++# define DEFAULT_PATH_W DEFAULT_PATH
43 ++#endif
44 +
45 +
46 + /*
47 +diff --git a/src/server/externs.h b/src/server/externs.h
48 +index 249e41b..e1a5c4f 100644
49 +--- a/server/externs.h
50 ++++ a/server/externs.h
51 +@@ -644,7 +644,7 @@ extern errr init_e_info_txt(FILE *fp, char *buf);
52 + extern errr init_r_info_txt(FILE *fp, char *buf);
53 +
54 + /* init.c */
55 +-extern void init_file_paths(char *path);
56 ++extern void init_file_paths(char *path, char *path2);
57 + extern void init_some_arrays(void);
58 + extern void load_server_cfg(void);
59 +
60 +diff --git a/src/server/init2.c b/src/server/init2.c
61 +index 00d8a01..27fd2b7 100644
62 +--- a/server/init2.c
63 ++++ a/server/init2.c
64 +@@ -63,10 +63,11 @@
65 + * to succeed even if the strings have not been allocated yet,
66 + * as long as the variables start out as "NULL".
67 + */
68 +-void init_file_paths(char *path)
69 ++void init_file_paths(char *path, char *path2)
70 + {
71 + char *tail;
72 +-
73 ++ char *tail2;
74 ++ char *tmp;
75 +
76 + /*** Free everything ***/
77 +
78 +@@ -103,6 +104,10 @@ void init_file_paths(char *path)
79 + /* Prepare to append to the Base Path */
80 + tail = path + strlen(path);
81 +
82 ++ tmp = string_make(path2);
83 ++
84 ++ /* Prepare to append to the Base Path */
85 ++ tail2 = path2 + strlen(path2);
86 +
87 + #ifdef VM
88 +
89 +@@ -123,8 +128,8 @@ void init_file_paths(char *path)
90 + /*** Build the sub-directory names ***/
91 +
92 + /* Build a path name */
93 +- strcpy(tail, "data");
94 +- ANGBAND_DIR_DATA = string_make(path);
95 ++ strcpy(tail2, "data");
96 ++ ANGBAND_DIR_DATA = string_make(path2);
97 +
98 + /* Build a path name */
99 + strcpy(tail, "edit");
100 +@@ -147,16 +152,16 @@ void init_file_paths(char *path)
101 + ANGBAND_DIR_PREF = string_make(path);
102 + #endif
103 + /* Build a path name */
104 +- strcpy(tail, "save");
105 +- ANGBAND_DIR_SAVE = string_make(path);
106 ++ strcpy(tail2, "save");
107 ++ ANGBAND_DIR_SAVE = string_make(path2);
108 +
109 + /* Build a path name */
110 + strcpy(tail, "text");
111 + ANGBAND_DIR_TEXT = string_make(path);
112 +
113 + /* Build a path name */
114 +- strcpy(tail, "user");
115 +- ANGBAND_DIR_USER = string_make(path);
116 ++ strcpy(tail2, "user");
117 ++ ANGBAND_DIR_USER = string_make(path2);
118 + #if 0
119 + /* Build a path name */
120 + strcpy(tail, "apex");
121 +diff --git a/src/server/main.c b/src/server/main.c
122 +index 4260b8d..7884b2f 100644
123 +--- a/server/main.c
124 ++++ a/server/main.c
125 +@@ -142,6 +142,7 @@ extern unsigned _ovrbuffer = 0x1500;
126 + static void init_stuff(void)
127 + {
128 + char path[1024];
129 ++ char path2[1024];
130 +
131 + #if defined(AMIGA) || defined(VM)
132 +
133 +@@ -161,10 +162,16 @@ static void init_stuff(void)
134 + /* Hack -- Add a path separator (only if needed) */
135 + if (!suffix(path, PATH_SEP)) strcat(path, PATH_SEP);
136 +
137 ++ /* Use the angband_path, or a default */
138 ++ strcpy(path2, tail ? tail : DEFAULT_PATH_W);
139 ++
140 ++ /* Hack -- Add a path separator (only if needed) */
141 ++ if (!suffix(path2, PATH_SEP)) strcat(path2, PATH_SEP);
142 ++
143 + #endif /* AMIGA / VM */
144 +
145 + /* Initialize */
146 +- init_file_paths(path);
147 ++ init_file_paths(path, path2);
148 + }
149 +
150 + /*
151
152 diff --git a/games-roguelike/mangband/files/mangband-1.1.3-strchr.patch b/games-roguelike/mangband/files/mangband-1.1.3-strchr.patch
153 new file mode 100644
154 index 0000000..f1fa19e
155 --- /dev/null
156 +++ b/games-roguelike/mangband/files/mangband-1.1.3-strchr.patch
157 @@ -0,0 +1,22 @@
158 +diff --git a/src/common/h-system.h b/src/common/h-system.h
159 +index f60bbc1..0294dd3 100644
160 +--- a/common/h-system.h
161 ++++ a/common/h-system.h
162 +@@ -104,17 +104,6 @@
163 +
164 + #ifdef SET_UID
165 +
166 +-# ifdef USG
167 +-# include <string.h>
168 +-# else
169 +-# include <strings.h>
170 +-extern char *strstr();
171 +-extern char *strchr();
172 +-extern char *strrchr();
173 +-# endif
174 +-
175 +-#else
176 +-
177 + # include <string.h>
178 +
179 + #endif
180
181 diff --git a/games-roguelike/mangband/mangband-1.1.3.ebuild b/games-roguelike/mangband/mangband-1.1.3.ebuild
182 new file mode 100644
183 index 0000000..1910e28
184 --- /dev/null
185 +++ b/games-roguelike/mangband/mangband-1.1.3.ebuild
186 @@ -0,0 +1,84 @@
187 +# Copyright 1999-2016 Gentoo Foundation
188 +# Distributed under the terms of the GNU General Public License v2
189 +# $Id$
190 +
191 +EAPI=6
192 +inherit eutils flag-o-matic user
193 +
194 +DESCRIPTION="Online multiplayer real-time roguelike game, derived from Angband."
195 +HOMEPAGE="http://www.mangband.org"
196 +SRC_URI="http://www.mangband.org/download/${P}.tar.gz"
197 +
198 +#RESTRICT=nomirror # for ebuild debugging
199 +
200 +LICENSE="Moria"
201 +SLOT="0"
202 +KEYWORDS="~amd64 ~x86"
203 +IUSE="ncurses sdl X"
204 +
205 +# Remove this once we hit MAngband 1.2:
206 +S="${WORKDIR}/${P}"/src
207 +
208 +RDEPEND="
209 + ncurses? ( sys-libs/ncurses:= )
210 + sdl? ( media-libs/libsdl )
211 + X? ( x11-libs/libX11 )"
212 +DEPEND="${RDEPEND}"
213 +
214 +PATCHES=( "${FILESDIR}/${P}-strchr.patch"
215 + "${FILESDIR}/${P}-paths.patch" )
216 +
217 +MY_DATADIR=/usr/share/"${PN}"
218 +MY_STATEDIR=/var/lib/"${PN}"
219 +MY_SYSCONFDIR=/etc
220 +
221 +src_configure() {
222 + append-cflags "-DDEFAULT_PATH='\"${MY_DATADIR}\"' -DDEFAULT_PATH_W='\"${MY_STATEDIR}\"'"
223 + econf \
224 + $(use_with ncurses gcu) \
225 + $(use_with X x11) \
226 + $(use_with sdl)
227 +}
228 +
229 +pkg_setup() {
230 + # mangband server uses own user/group:
231 + enewgroup mangband
232 + enewuser mangband -1 -1 -1 "mangband"
233 +}
234 +
235 +src_install() {
236 +# Newer versions of MAngband have "make install", so we could use..
237 +# emake DESTDIR="${D}" install
238 +# dodoc NEWS README INSTALL AUTHORS
239 +#..but not yet
240 +
241 + dobin mangband mangclient
242 +
243 + # Read-only data
244 + insinto "${MY_DATADIR}"
245 + doins -r "${WORKDIR}/${P}"/lib/{edit,file,help,text,xtra,user}
246 +
247 + # Server config
248 + insinto "${MY_SYSCONFDIR}"
249 + doins "${WORKDIR}/${P}"/mangband.cfg
250 +
251 + # Read-write data
252 + insinto "${MY_STATEDIR}"
253 + doins -r "${WORKDIR}/${P}"/lib/{data,save,user}
254 +
255 + fowners -R mangband:mangband "${MY_STATEDIR}"/{data,save,user}
256 + fperms -R 2664 "${MY_STATEDIR}"/{data,save,user}
257 + fperms 2775 "${MY_STATEDIR}"/{data,save,user}
258 +
259 + # Docs
260 + #dodoc ${WORKDIR}/${P}/LICENSE
261 +}
262 +
263 +pkg_postinst() {
264 + echo
265 + elog "Make sure LibDir is either unset in ~/.mangrc either points to"
266 + elog " ${MY_DATADIR} for 'mangclient' to pick it up."
267 + elog "Server binary is called 'mangband', and must be run under user"
268 + elog " mangband, i.e. 'sudo -u mangband mangband' "
269 + echo
270 +}
271
272 diff --git a/games-roguelike/mangband/metadata.xml b/games-roguelike/mangband/metadata.xml
273 new file mode 100644
274 index 0000000..11e4ff3
275 --- /dev/null
276 +++ b/games-roguelike/mangband/metadata.xml
277 @@ -0,0 +1,12 @@
278 +<?xml version="1.0" encoding="UTF-8"?>
279 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
280 +<pkgmetadata>
281 + <maintainer type="person">
282 + <email>flambard@××××××××.org</email>
283 + <description>Proxied Maintainer</description>
284 + </maintainer>
285 + <maintainer type="project">
286 + <email>proxy-maint@g.o</email>
287 + <name>Proxy Maintainers</name>
288 + </maintainer>
289 +</pkgmetadata>