1 |
commit: 0e138de8646fa2fc25c81e038f32a62d3b675bb0 |
2 |
Author: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name> |
3 |
AuthorDate: Sun Jun 22 21:41:15 2014 +0000 |
4 |
Commit: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name> |
5 |
CommitDate: Sun Jun 22 21:41:15 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gamerlay.git;a=commit;h=0e138de8 |
7 |
|
8 |
[games-arcade/metalslug3] Added |
9 |
|
10 |
Signed-off-by: Vadim A. Misbakh-Soloviov <mva <AT> mva.name> |
11 |
|
12 |
--- |
13 |
eclass/unpacker.eclass | 524 +++++++++++++++++++++ |
14 |
.../worms-reloaded/worms-reloaded-20131016.ebuild | 71 --- |
15 |
2 files changed, 524 insertions(+), 71 deletions(-) |
16 |
|
17 |
diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass |
18 |
new file mode 100644 |
19 |
index 0000000..b377ae7 |
20 |
--- /dev/null |
21 |
+++ b/eclass/unpacker.eclass |
22 |
@@ -0,0 +1,524 @@ |
23 |
+# Copyright 1999-2014 Gentoo Foundation |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/unpacker.eclass,v 1.17 2014/05/01 19:27:14 ottxor Exp $ |
26 |
+ |
27 |
+# @ECLASS: unpacker.eclass |
28 |
+# @MAINTAINER: |
29 |
+# base-system@g.o |
30 |
+# @BLURB: helpers for extraneous file formats and consistent behavior across EAPIs |
31 |
+# @DESCRIPTION: |
32 |
+# Some extraneous file formats are not part of PMS, or are only in certain |
33 |
+# EAPIs. Rather than worrying about that, support the crazy cruft here |
34 |
+# and for all EAPI versions. |
35 |
+ |
36 |
+# Possible todos: |
37 |
+# - merge rpm unpacking |
38 |
+# - support partial unpacks? |
39 |
+ |
40 |
+if [[ ${___ECLASS_ONCE_UNPACKER} != "recur -_+^+_- spank" ]] ; then |
41 |
+___ECLASS_ONCE_UNPACKER="recur -_+^+_- spank" |
42 |
+ |
43 |
+# @ECLASS-VARIABLE: UNPACKER_BZ2 |
44 |
+# @DEFAULT_UNSET |
45 |
+# @DESCRIPTION: |
46 |
+# Utility to use to decompress bzip2 files. Will dynamically pick between |
47 |
+# `pbzip2` and `bzip2`. Make sure your choice accepts the "-dc" options. |
48 |
+# Note: this is meant for users to set, not ebuilds. |
49 |
+ |
50 |
+# @ECLASS-VARIABLE: UNPACKER_LZIP |
51 |
+# @DEFAULT_UNSET |
52 |
+# @DESCRIPTION: |
53 |
+# Utility to use to decompress lzip files. Will dynamically pick between |
54 |
+# `plzip`, `pdlzip` and `lzip`. Make sure your choice accepts the "-dc" options. |
55 |
+# Note: this is meant for users to set, not ebuilds. |
56 |
+ |
57 |
+# for internal use only (unpack_pdv and unpack_makeself) |
58 |
+find_unpackable_file() { |
59 |
+ local src=$1 |
60 |
+ if [[ -z ${src} ]] ; then |
61 |
+ src=${DISTDIR}/${A} |
62 |
+ else |
63 |
+ if [[ ${src} == ./* ]] ; then |
64 |
+ : # already what we want |
65 |
+ elif [[ -e ${DISTDIR}/${src} ]] ; then |
66 |
+ src=${DISTDIR}/${src} |
67 |
+ elif [[ -e ${PWD}/${src} ]] ; then |
68 |
+ src=${PWD}/${src} |
69 |
+ elif [[ -e ${src} ]] ; then |
70 |
+ src=${src} |
71 |
+ fi |
72 |
+ fi |
73 |
+ [[ ! -e ${src} ]] && return 1 |
74 |
+ echo "${src}" |
75 |
+} |
76 |
+ |
77 |
+unpack_banner() { |
78 |
+ echo ">>> Unpacking ${1##*/} to ${PWD}" |
79 |
+} |
80 |
+ |
81 |
+# @FUNCTION: unpack_pdv |
82 |
+# @USAGE: <file to unpack> <size of off_t> |
83 |
+# @DESCRIPTION: |
84 |
+# Unpack those pesky pdv generated files ... |
85 |
+# They're self-unpacking programs with the binary package stuffed in |
86 |
+# the middle of the archive. Valve seems to use it a lot ... too bad |
87 |
+# it seems to like to segfault a lot :(. So lets take it apart ourselves. |
88 |
+# |
89 |
+# You have to specify the off_t size ... I have no idea how to extract that |
90 |
+# information out of the binary executable myself. Basically you pass in |
91 |
+# the size of the off_t type (in bytes) on the machine that built the pdv |
92 |
+# archive. |
93 |
+# |
94 |
+# One way to determine this is by running the following commands: |
95 |
+# |
96 |
+# @CODE |
97 |
+# strings <pdv archive> | grep lseek |
98 |
+# strace -elseek <pdv archive> |
99 |
+# @CODE |
100 |
+# |
101 |
+# Basically look for the first lseek command (we do the strings/grep because |
102 |
+# sometimes the function call is _llseek or something) and steal the 2nd |
103 |
+# parameter. Here is an example: |
104 |
+# |
105 |
+# @CODE |
106 |
+# $ strings hldsupdatetool.bin | grep lseek |
107 |
+# lseek |
108 |
+# $ strace -elseek ./hldsupdatetool.bin |
109 |
+# lseek(3, -4, SEEK_END) = 2981250 |
110 |
+# @CODE |
111 |
+# |
112 |
+# Thus we would pass in the value of '4' as the second parameter. |
113 |
+unpack_pdv() { |
114 |
+ local src=$(find_unpackable_file "$1") |
115 |
+ local sizeoff_t=$2 |
116 |
+ |
117 |
+ [[ -z ${src} ]] && die "Could not locate source for '$1'" |
118 |
+ [[ -z ${sizeoff_t} ]] && die "No idea what off_t size was used for this pdv :(" |
119 |
+ |
120 |
+ unpack_banner "${src}" |
121 |
+ |
122 |
+ local metaskip=$(tail -c ${sizeoff_t} "${src}" | hexdump -e \"%i\") |
123 |
+ local tailskip=$(tail -c $((${sizeoff_t}*2)) "${src}" | head -c ${sizeoff_t} | hexdump -e \"%i\") |
124 |
+ |
125 |
+ # grab metadata for debug reasons |
126 |
+ local metafile="${T}/${FUNCNAME}.meta" |
127 |
+ tail -c +$((${metaskip}+1)) "${src}" > "${metafile}" |
128 |
+ |
129 |
+ # rip out the final file name from the metadata |
130 |
+ local datafile=$(tail -c +$((${metaskip}+1)) "${src}" | strings | head -n 1) |
131 |
+ datafile=$(basename "${datafile}") |
132 |
+ |
133 |
+ # now lets uncompress/untar the file if need be |
134 |
+ local tmpfile="${T}/${FUNCNAME}" |
135 |
+ tail -c +$((${tailskip}+1)) ${src} 2>/dev/null | head -c 512 > "${tmpfile}" |
136 |
+ |
137 |
+ local iscompressed=$(file -b "${tmpfile}") |
138 |
+ if [[ ${iscompressed:0:8} == "compress" ]] ; then |
139 |
+ iscompressed=1 |
140 |
+ mv "${tmpfile}"{,.Z} |
141 |
+ gunzip "${tmpfile}" |
142 |
+ else |
143 |
+ iscompressed=0 |
144 |
+ fi |
145 |
+ local istar=$(file -b "${tmpfile}") |
146 |
+ if [[ ${istar:0:9} == "POSIX tar" ]] ; then |
147 |
+ istar=1 |
148 |
+ else |
149 |
+ istar=0 |
150 |
+ fi |
151 |
+ |
152 |
+ #for some reason gzip dies with this ... dd cant provide buffer fast enough ? |
153 |
+ #dd if=${src} ibs=${metaskip} count=1 \ |
154 |
+ # | dd ibs=${tailskip} skip=1 \ |
155 |
+ # | gzip -dc \ |
156 |
+ # > ${datafile} |
157 |
+ if [ ${iscompressed} -eq 1 ] ; then |
158 |
+ if [ ${istar} -eq 1 ] ; then |
159 |
+ tail -c +$((${tailskip}+1)) "${src}" 2>/dev/null \ |
160 |
+ | head -c $((${metaskip}-${tailskip})) \ |
161 |
+ | tar -xzf - |
162 |
+ else |
163 |
+ tail -c +$((${tailskip}+1)) "${src}" 2>/dev/null \ |
164 |
+ | head -c $((${metaskip}-${tailskip})) \ |
165 |
+ | gzip -dc \ |
166 |
+ > ${datafile} |
167 |
+ fi |
168 |
+ else |
169 |
+ if [ ${istar} -eq 1 ] ; then |
170 |
+ tail -c +$((${tailskip}+1)) "${src}" 2>/dev/null \ |
171 |
+ | head -c $((${metaskip}-${tailskip})) \ |
172 |
+ | tar --no-same-owner -xf - |
173 |
+ else |
174 |
+ tail -c +$((${tailskip}+1)) "${src}" 2>/dev/null \ |
175 |
+ | head -c $((${metaskip}-${tailskip})) \ |
176 |
+ > ${datafile} |
177 |
+ fi |
178 |
+ fi |
179 |
+ true |
180 |
+ #[ -s "${datafile}" ] || die "failure unpacking pdv ('${metaskip}' '${tailskip}' '${datafile}')" |
181 |
+ #assert "failure unpacking pdv ('${metaskip}' '${tailskip}' '${datafile}')" |
182 |
+} |
183 |
+ |
184 |
+# @FUNCTION: unpack_makeself |
185 |
+# @USAGE: [file to unpack] [offset] [tail|dd] |
186 |
+# @DESCRIPTION: |
187 |
+# Unpack those pesky makeself generated files ... |
188 |
+# They're shell scripts with the binary package tagged onto |
189 |
+# the end of the archive. Loki utilized the format as does |
190 |
+# many other game companies. |
191 |
+# |
192 |
+# If the file is not specified, then ${A} is used. If the |
193 |
+# offset is not specified then we will attempt to extract |
194 |
+# the proper offset from the script itself. |
195 |
+unpack_makeself() { |
196 |
+ local src_input=${1:-${A}} |
197 |
+ local src=$(find_unpackable_file "${src_input}") |
198 |
+ local skip=$2 |
199 |
+ local exe=$3 |
200 |
+ |
201 |
+ [[ -z ${src} ]] && die "Could not locate source for '${src_input}'" |
202 |
+ |
203 |
+ unpack_banner "${src}" |
204 |
+ |
205 |
+ if [[ -z ${skip} ]] ; then |
206 |
+ local ver=$(grep -m1 -a '#.*Makeself' "${src}" | awk '{print $NF}') |
207 |
+ local skip=0 |
208 |
+ exe=tail |
209 |
+ case ${ver} in |
210 |
+ 1.5.*|1.6.0-nv*) # tested 1.5.{3,4,5} ... guessing 1.5.x series is same |
211 |
+ skip=$(grep -a ^skip= "${src}" | cut -d= -f2) |
212 |
+ ;; |
213 |
+ 2.0|2.0.1) |
214 |
+ skip=$(grep -a ^$'\t'tail "${src}" | awk '{print $2}' | cut -b2-) |
215 |
+ ;; |
216 |
+ 2.1.1) |
217 |
+ skip=$(grep -a ^offset= "${src}" | awk '{print $2}' | cut -b2-) |
218 |
+ (( skip++ )) |
219 |
+ ;; |
220 |
+ 2.1.2) |
221 |
+ skip=$(grep -a ^offset= "${src}" | awk '{print $3}' | head -n 1) |
222 |
+ (( skip++ )) |
223 |
+ ;; |
224 |
+ 2.1.3) |
225 |
+ skip=`grep -a ^offset= "${src}" | awk '{print $3}'` |
226 |
+ (( skip++ )) |
227 |
+ ;; |
228 |
+ 2.1.4|2.1.5|2.1.6|2.2.0) |
229 |
+ skip=$(grep -a offset=.*head.*wc "${src}" | awk '{print $3}' | head -n 1) |
230 |
+ skip=$(head -n ${skip} "${src}" | wc -c) |
231 |
+ exe="dd" |
232 |
+ ;; |
233 |
+ *) |
234 |
+ eerror "I'm sorry, but I was unable to support the Makeself file." |
235 |
+ eerror "The version I detected was '${ver}'." |
236 |
+ eerror "Please file a bug about the file ${src##*/} at" |
237 |
+ eerror "http://bugs.gentoo.org/ so that support can be added." |
238 |
+ die "makeself version '${ver}' not supported" |
239 |
+ ;; |
240 |
+ esac |
241 |
+ debug-print "Detected Makeself version ${ver} ... using ${skip} as offset" |
242 |
+ fi |
243 |
+ case ${exe} in |
244 |
+ tail) exe="tail -n +${skip} '${src}'";; |
245 |
+ dd) exe="dd ibs=${skip} skip=1 if='${src}'";; |
246 |
+ *) die "makeself cant handle exe '${exe}'" |
247 |
+ esac |
248 |
+ |
249 |
+ # lets grab the first few bytes of the file to figure out what kind of archive it is |
250 |
+ local filetype tmpfile="${T}/${FUNCNAME}" |
251 |
+ eval ${exe} 2>/dev/null | head -c 512 > "${tmpfile}" |
252 |
+ filetype=$(file -b "${tmpfile}") || die |
253 |
+ case ${filetype} in |
254 |
+ *tar\ archive*) |
255 |
+ eval ${exe} | tar --no-same-owner -xf - |
256 |
+ ;; |
257 |
+ bzip2*) |
258 |
+ eval ${exe} | bzip2 -dc | tar --no-same-owner -xf - |
259 |
+ ;; |
260 |
+ gzip*) |
261 |
+ eval ${exe} | tar --no-same-owner -xzf - |
262 |
+ ;; |
263 |
+ compress*) |
264 |
+ eval ${exe} | gunzip | tar --no-same-owner -xf - |
265 |
+ ;; |
266 |
+ XZ*) |
267 |
+ eval ${exe} | unxz | tar --no-same-owner -xf - |
268 |
+ ;; |
269 |
+ *) |
270 |
+ eerror "Unknown filetype \"${filetype}\" ?" |
271 |
+ false |
272 |
+ ;; |
273 |
+ esac |
274 |
+ assert "failure unpacking (${filetype}) makeself ${src##*/} ('${ver}' +${skip})" |
275 |
+} |
276 |
+ |
277 |
+# @FUNCTION: unpack_nixstaller |
278 |
+# @USAGE: [installer files to unpack] |
279 |
+# @DESCRIPTION: |
280 |
+# Unpack those pesky makeself+Nixstaller generated files ... |
281 |
+# They're shell scripts with the binary package tagged onto |
282 |
+# the end of the archive. |
283 |
+# |
284 |
+# If the file is not specified, then ${A} is used. If the |
285 |
+# offset is not specified then we will attempt to extract |
286 |
+# the proper offset from the script itself. |
287 |
+ |
288 |
+unpack_nixstaller() { |
289 |
+ local src=$(find_unpackable_file "${1}") |
290 |
+ |
291 |
+ mkdir tmp; |
292 |
+ cd tmp; |
293 |
+ |
294 |
+ unpack_makeself ${src} |
295 |
+ |
296 |
+ for f in $NIXSTALLER_TARGETS ; do |
297 |
+ unpack_banner "$f" |
298 |
+ local unp=$(find_unpackable_file "${f}") |
299 |
+ # Make sure that file exists |
300 |
+ [[ -f "${unp}" ]] && ( |
301 |
+ local type=$(file -b ${unp}) |
302 |
+ case ${type} in |
303 |
+ data|LZMA*) |
304 |
+ tar -xJf "${unp}" -C .. |
305 |
+ ;; |
306 |
+ gzip*) |
307 |
+ tar -xzf "${unp}" -C .. |
308 |
+ ;; |
309 |
+ esac |
310 |
+ ) || die "Failed to unpack ${f}" |
311 |
+ done |
312 |
+ cd ..; |
313 |
+} |
314 |
+ |
315 |
+# @FUNCTION: unpack_mojosetup |
316 |
+# @USAGE: [file to unpack] |
317 |
+# @DESCRIPTION: |
318 |
+# Unpack those pesky makeself+mojosetup generated files ... |
319 |
+# They're shell scripts with the binary package tagged onto |
320 |
+# the end of the archive. |
321 |
+# |
322 |
+# (!!!) |
323 |
+# Fortunately, currently, unpack_zip can handle it fine. |
324 |
+# |
325 |
+# If the file is not specified, then ${A} is used. If the |
326 |
+# offset is not specified then we will attempt to extract |
327 |
+# the proper offset from the script itself. |
328 |
+ |
329 |
+unpack_mojosetup() { |
330 |
+ local src=$(find_unpackable_file "${1}") |
331 |
+ unpack_zip ${src} |
332 |
+} |
333 |
+ |
334 |
+ |
335 |
+# @FUNCTION: unpack_deb |
336 |
+# @USAGE: <one deb to unpack> |
337 |
+# @DESCRIPTION: |
338 |
+# Unpack a Debian .deb archive in style. |
339 |
+unpack_deb() { |
340 |
+ [[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} <file>" |
341 |
+ |
342 |
+ local deb=$(find_unpackable_file "$1") |
343 |
+ |
344 |
+ unpack_banner "${deb}" |
345 |
+ |
346 |
+ # on AIX ar doesn't work out as their ar used a different format |
347 |
+ # from what GNU ar (and thus what .deb files) produce |
348 |
+ if [[ -n ${EPREFIX} ]] ; then |
349 |
+ { |
350 |
+ read # global header |
351 |
+ [[ ${REPLY} = "!<arch>" ]] || die "${deb} does not seem to be a deb archive" |
352 |
+ local f timestamp uid gid mode size magic |
353 |
+ while read f timestamp uid gid mode size magic ; do |
354 |
+ [[ -n ${f} && -n ${size} ]] || continue # ignore empty lines |
355 |
+ if [[ ${f} = "data.tar"* ]] ; then |
356 |
+ head -c "${size}" > "${f}" |
357 |
+ else |
358 |
+ head -c "${size}" > /dev/null # trash it |
359 |
+ fi |
360 |
+ done |
361 |
+ } < "${deb}" |
362 |
+ else |
363 |
+ ar x "${deb}" |
364 |
+ fi |
365 |
+ |
366 |
+ unpacker ./data.tar* |
367 |
+ |
368 |
+ # Clean things up #458658. No one seems to actually care about |
369 |
+ # these, so wait until someone requests to do something else ... |
370 |
+ rm -f debian-binary {control,data}.tar* |
371 |
+} |
372 |
+ |
373 |
+# @FUNCTION: unpack_cpio |
374 |
+# @USAGE: <one cpio to unpack> |
375 |
+# @DESCRIPTION: |
376 |
+# Unpack a cpio archive, file "-" means stdin. |
377 |
+unpack_cpio() { |
378 |
+ [[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} <file>" |
379 |
+ |
380 |
+ # needed as cpio always reads from stdin |
381 |
+ local cpio_cmd=( cpio --make-directories --extract --preserve-modification-time ) |
382 |
+ if [[ $1 == "-" ]] ; then |
383 |
+ unpack_banner "stdin" |
384 |
+ "${cpio_cmd[@]}" |
385 |
+ else |
386 |
+ local cpio=$(find_unpackable_file "$1") |
387 |
+ unpack_banner "${cpio}" |
388 |
+ "${cpio_cmd[@]}" <"${cpio}" |
389 |
+ fi |
390 |
+} |
391 |
+ |
392 |
+# @FUNCTION: unpack_zip |
393 |
+# @USAGE: <zip file> |
394 |
+# @DESCRIPTION: |
395 |
+# Unpack zip archives. |
396 |
+# This function ignores all non-fatal errors (i.e. warnings). |
397 |
+# That is useful for zip archives with extra crap attached |
398 |
+# (e.g. self-extracting archives). |
399 |
+unpack_zip() { |
400 |
+ [[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} <file>" |
401 |
+ |
402 |
+ local zip=$(find_unpackable_file "$1") |
403 |
+ unpack_banner "${zip}" |
404 |
+ unzip -qo "${zip}" |
405 |
+ |
406 |
+ [[ $? -le 1 ]] || die "unpacking ${zip} failed (arch=unpack_zip)" |
407 |
+} |
408 |
+ |
409 |
+# @FUNCTION: _unpacker |
410 |
+# @USAGE: <one archive to unpack> |
411 |
+# @INTERNAL |
412 |
+# @DESCRIPTION: |
413 |
+# Unpack the specified archive. We only operate on one archive here |
414 |
+# to keep down on the looping logic (that is handled by `unpacker`). |
415 |
+_unpacker() { |
416 |
+ [[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} <file>" |
417 |
+ |
418 |
+ local a=$1 |
419 |
+ local m=$(echo "${a}" | tr '[:upper:]' '[:lower:]') |
420 |
+ a=$(find_unpackable_file "${a}") |
421 |
+ |
422 |
+ # first figure out the decompression method |
423 |
+ case ${m} in |
424 |
+ *.bz2|*.tbz|*.tbz2) |
425 |
+ local bzcmd=${PORTAGE_BZIP2_COMMAND:-$(type -P pbzip2 || type -P bzip2)} |
426 |
+ local bzuncmd=${PORTAGE_BUNZIP2_COMMAND:-${bzcmd} -d} |
427 |
+ : ${UNPACKER_BZ2:=${bzuncmd}} |
428 |
+ comp="${UNPACKER_BZ2} -c" |
429 |
+ ;; |
430 |
+ *.z|*.gz|*.tgz) |
431 |
+ comp="gzip -dc" ;; |
432 |
+ *.lzma|*.xz|*.txz) |
433 |
+ comp="xz -dc" ;; |
434 |
+ *.lz) |
435 |
+ : ${UNPACKER_LZIP:=$(type -P plzip || type -P pdlzip || type -P lzip)} |
436 |
+ comp="${UNPACKER_LZIP} -dc" ;; |
437 |
+ *) comp="" ;; |
438 |
+ esac |
439 |
+ |
440 |
+ # then figure out if there are any archiving aspects |
441 |
+ arch="" |
442 |
+ case ${m} in |
443 |
+ *.tgz|*.tbz|*.tbz2|*.txz|*.tar.*|*.tar) |
444 |
+ arch="tar --no-same-owner -xof" ;; |
445 |
+ *.cpio.*|*.cpio) |
446 |
+ arch="unpack_cpio" ;; |
447 |
+ *.deb) |
448 |
+ arch="unpack_deb" ;; |
449 |
+ *.run) |
450 |
+ arch="unpack_makeself" ;; |
451 |
+ *.sh) |
452 |
+ if head -n 5 "${a}" | grep -qs '#.*Nixstaller' ; then |
453 |
+ arch="unpack_nixstaller" |
454 |
+ elif head -n 5 "${a}" | grep -qs '#.*mojosetup' ; then |
455 |
+ arch="unpack_mojosetup" |
456 |
+ elif head -n 30 "${a}" | grep -qs '#.*Makeself' ; then |
457 |
+ arch="unpack_makeself" |
458 |
+ fi |
459 |
+ # Not all shell scripts are makeself |
460 |
+ ;; |
461 |
+ *.bin) |
462 |
+ # Makeself archives can be annoyingly named |
463 |
+ if head -c 100 "${a}" | grep -qs '#.*Makeself' ; then |
464 |
+ arch="unpack_makeself" |
465 |
+ fi |
466 |
+ ;; |
467 |
+ *.zip) |
468 |
+ arch="unpack_zip" ;; |
469 |
+ esac |
470 |
+ |
471 |
+ # finally do the unpack |
472 |
+ if [[ -z ${arch}${comp} ]] ; then |
473 |
+ unpack "$1" |
474 |
+ return $? |
475 |
+ fi |
476 |
+ |
477 |
+ [[ ${arch} != unpack_* ]] && unpack_banner "${a}" |
478 |
+ |
479 |
+ if [[ -z ${arch} ]] ; then |
480 |
+ # Need to decompress the file into $PWD #408801 |
481 |
+ local _a=${a%.*} |
482 |
+ ${comp} "${a}" > "${_a##*/}" |
483 |
+ elif [[ -z ${comp} ]] ; then |
484 |
+ ${arch} "${a}" |
485 |
+ else |
486 |
+ ${comp} "${a}" | ${arch} - |
487 |
+ fi |
488 |
+ |
489 |
+ assert "unpacking ${a} failed (comp=${comp} arch=${arch})" |
490 |
+} |
491 |
+ |
492 |
+# @FUNCTION: unpacker |
493 |
+# @USAGE: [archives to unpack] |
494 |
+# @DESCRIPTION: |
495 |
+# This works in the same way that `unpack` does. If you don't specify |
496 |
+# any files, it will default to ${A}. |
497 |
+unpacker() { |
498 |
+ local a |
499 |
+ [[ $# -eq 0 ]] && set -- ${A} |
500 |
+ for a ; do _unpacker "${a}" ; done |
501 |
+} |
502 |
+ |
503 |
+# @FUNCTION: unpacker_src_unpack |
504 |
+# @DESCRIPTION: |
505 |
+# Run `unpacker` to unpack all our stuff. |
506 |
+unpacker_src_unpack() { |
507 |
+ unpacker |
508 |
+} |
509 |
+ |
510 |
+# @FUNCTION: unpacker_src_uri_depends |
511 |
+# @USAGE: [archives that we will unpack] |
512 |
+# @RETURN: Dependencies needed to unpack all the archives |
513 |
+# @DESCRIPTION: |
514 |
+# Walk all the specified files (defaults to $SRC_URI) and figure out the |
515 |
+# dependencies that are needed to unpack things. |
516 |
+# |
517 |
+# Note: USE flags are not yet handled. |
518 |
+unpacker_src_uri_depends() { |
519 |
+ local uri deps d |
520 |
+ |
521 |
+ [[ $# -eq 0 ]] && set -- ${SRC_URI} |
522 |
+ |
523 |
+ for uri in "$@" ; do |
524 |
+ case ${uri} in |
525 |
+ *.cpio.*|*.cpio) |
526 |
+ d="app-arch/cpio" ;; |
527 |
+ *.rar|*.RAR) |
528 |
+ d="app-arch/unrar" ;; |
529 |
+ *.7z) |
530 |
+ d="app-arch/p7zip" ;; |
531 |
+ *.xz) |
532 |
+ d="app-arch/xz-utils" ;; |
533 |
+ *.zip) |
534 |
+ d="app-arch/unzip" ;; |
535 |
+ *.lz) |
536 |
+ d="|| ( app-arch/plzip app-arch/pdlzip app-arch/lzip )" ;; |
537 |
+ esac |
538 |
+ deps+=" ${d}" |
539 |
+ done |
540 |
+ |
541 |
+ echo "${deps}" |
542 |
+} |
543 |
+ |
544 |
+EXPORT_FUNCTIONS src_unpack |
545 |
+ |
546 |
+fi |
547 |
|
548 |
diff --git a/games-strategy/worms-reloaded/worms-reloaded-20131016.ebuild b/games-strategy/worms-reloaded/worms-reloaded-20131016.ebuild |
549 |
deleted file mode 100644 |
550 |
index 8d59026..0000000 |
551 |
--- a/games-strategy/worms-reloaded/worms-reloaded-20131016.ebuild |
552 |
+++ /dev/null |
553 |
@@ -1,71 +0,0 @@ |
554 |
-# Copyright 1999-2012 Gentoo Foundation |
555 |
-# Distributed under the terms of the GNU General Public License v2 |
556 |
-# $Header: $ |
557 |
- |
558 |
-EAPI="5" |
559 |
- |
560 |
-inherit eutils games unpacker |
561 |
- |
562 |
-TS="1381858841" |
563 |
- |
564 |
-DESCRIPTION="Legendary Worms™ Game. SinglePlayer-only." |
565 |
-HOMEPAGE="http://www.team17.com/games/worms/worms-reloaded/" |
566 |
-SRC_URI="WormsReloaded_Linux_${TS}.sh" |
567 |
- |
568 |
-RESTRICT="fetch strip" |
569 |
-LICENSE="as-is" |
570 |
- |
571 |
-SLOT="0" |
572 |
-KEYWORDS="amd64 x86" |
573 |
-IUSE="" |
574 |
- |
575 |
-DEPEND="" |
576 |
-RDEPEND=" |
577 |
- amd64? ( |
578 |
- app-emulation/emul-linux-x86-baselibs |
579 |
- app-emulation/emul-linux-x86-sdl |
580 |
- ) |
581 |
- x86? ( |
582 |
- media-libs/openal |
583 |
- sys-libs/zlib |
584 |
- ) |
585 |
-" |
586 |
- |
587 |
-S="${WORKDIR}/data" |
588 |
- |
589 |
-GAMEDIR="${GAMES_PREFIX_OPT}/${PN}" |
590 |
- |
591 |
-pkg_nofetch() { |
592 |
- einfo "" |
593 |
- einfo "Please buy and download \"${SRC_URI}\" from" |
594 |
- einfo "HumbleIndieBundle or ${HOMEPAGE}" |
595 |
- einfo "and move/link it to \"${DISTDIR}\"" |
596 |
- einfo "" |
597 |
-} |
598 |
- |
599 |
-src_unpack() { |
600 |
- unpack_zip "${A}"; |
601 |
-} |
602 |
- |
603 |
-src_prepare() { |
604 |
- rm -r "${S}/x86/lib/libopenal.so.1" |
605 |
-} |
606 |
- |
607 |
-src_install() { |
608 |
- # Install documentation |
609 |
- dodoc noarch/README.linux |
610 |
- rm noarch/README.linux |
611 |
- |
612 |
- # Install data |
613 |
- insinto "${GAMEDIR}" |
614 |
- doins -r noarch/* x86/lib |
615 |
- exeinto "${GAMEDIR}" |
616 |
- doexe x86/WormsReloaded.bin.x86 |
617 |
- |
618 |
- # Install icon and desktop file |
619 |
- newicon "x86/WormsReloaded.png" "${PN}.png" |
620 |
- make_desktop_entry "${PN}" "Worms Reloaded" "${PN}" |
621 |
- |
622 |
- # Setting permissions. |
623 |
- prepgamesdirs |
624 |
-} |
625 |
\ No newline at end of file |