Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gamerlay:master commit in: games-action/descent2-data/
Date: Sat, 29 Apr 2017 20:04:45
Message-Id: 1493496031.a783818b136b5a733c6a16c67a7cc5d19e4aecf4.chewi@gentoo
1 commit: a783818b136b5a733c6a16c67a7cc5d19e4aecf4
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 29 20:00:31 2017 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 29 20:00:31 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/gamerlay.git/commit/?id=a783818b
7
8 games-action/descent2-data: Improved version in Gentoo repo, removing
9
10 .../descent2-data/descent2-data-1.0-r2.ebuild | 209 ---------------------
11 1 file changed, 209 deletions(-)
12
13 diff --git a/games-action/descent2-data/descent2-data-1.0-r2.ebuild b/games-action/descent2-data/descent2-data-1.0-r2.ebuild
14 deleted file mode 100644
15 index 6c9e548..0000000
16 --- a/games-action/descent2-data/descent2-data-1.0-r2.ebuild
17 +++ /dev/null
18 @@ -1,209 +0,0 @@
19 -# Copyright 1999-2013 Gentoo Foundation
20 -# Distributed under the terms of the GNU General Public License v2
21 -# $Header: $
22 -
23 -EAPI=5
24 -
25 -CDROM_OPTIONAL="yes"
26 -inherit cdrom eutils games
27 -
28 -# Not possible to apply official 1.2 patch under Linux, so provide our own
29 -# http://www.interplay.com/support/support.php?id=104
30 -# Should only be needed for original DOS CD-ROM release
31 -MY_PATCH="http://www.dxx-rebirth.com/download/dxx/misc/d2xptch12.tgz"
32 -
33 -# For GOG install
34 -MY_EXE="setup_descent_1_2.exe"
35 -
36 -DESCRIPTION="Data files for Descent 2"
37 -HOMEPAGE="http://www.interplay.com/games/support.php?id=104"
38 -SRC_URI="cdinstall? ( $MY_PATCH )
39 - !cdinstall? ( $MY_EXE )"
40 -
41 -# See readme.txt
42 -LICENSE="${PN}"
43 -SLOT="0"
44 -KEYWORDS="amd64 ppc x86"
45 -RESTRICT="!cdinstall? ( fetch )"
46 -IUSE="+cdinstall doc vertigo videos"
47 -
48 -# d2x-0.2.5-r2 may include the CD data itself.
49 -# d2x-0.2.5-r3 does not include the CD data.
50 -# d2x-rebirth is favoured because it is stable.
51 -#RDEPEND="|| (
52 -# games-action/d2x-rebirth
53 -# >=games-action/d2x-0.2.5-r3 )"
54 -RDEPEND="!<games-action/d2x-0.2.5-r3"
55 -DEPEND="app-arch/unarj
56 - vertigo? ( games-action/descent2-vertigo )
57 - cdinstall? (
58 - dev-util/xdelta:3
59 - )
60 - !cdinstall? (
61 - app-arch/innoextract
62 - app-arch/unzip
63 - )"
64 -
65 -S=${WORKDIR}
66 -dir=${GAMES_DATADIR}/d2x
67 -
68 -# Function to handle copying and renaming files from installation directory
69 -copy_file() {
70 - local dest="${2}"
71 - local f=$(basename "${1}")
72 - if [ "${f:0:1}" == '*' ]; then
73 - return 0
74 - else
75 - echo "Copying '${f}'"
76 - local d=$(echo ${f} | tr "[:upper:]" "[:lower:]")
77 - cp -f "${1}" "${dest}/${d}" || die "copy ${1} failed"
78 - return 0
79 - fi
80 -}
81 -
82 -pkg_nofetch() {
83 - elog "You must place a copy of, or symlink to, the GOG setup package here:"
84 - elog "${DISTDIR}/${MY_EXE}"
85 - echo
86 - elog "If you wish to install from CD-ROM instead, please enable the cdinstall flag"
87 -}
88 -
89 -pkg_setup() {
90 - games_pkg_setup
91 - local m need_cd="n"
92 -
93 - if use cdinstall; then
94 - # Check for supported CD-ROM or local install
95 - CDROM_NAME_SET=( "CD-ROM Version" "Installed Version" "Installed Version" )
96 - cdrom_get_cds d2data/descent2.sow:descent2.hog:DESCENT2.HOG
97 - case ${CDROM_SET} in
98 - 0) F_SOURCE='cd'
99 - F_ROOT="${CDROM_ROOT}/d2data"
100 - einfo 'Found Descent II CD' ;;
101 - [12]) F_SOURCE='install'
102 - F_ROOT="${CDROM_ROOT}"
103 - einfo 'Found Descent II Installation' ;;
104 - *) die 'Descent II CD or installation files not found' ;;
105 - esac
106 -
107 - else
108 - # Check for GOG installer
109 - if [ ! -e "${DISTDIR}/${MY_EXE}" ]; then
110 - ewarn "You must copy or symlink '${MY_EXE}' to your distfiles directory"
111 - die "GOG installer not found"
112 - F_SOURCE='gog'
113 - fi
114 - F_ROOT="${WORKDIR}/gog/app/descent 2"
115 - fi
116 -}
117 -
118 -src_unpack() {
119 - mkdir "${WORKDIR}"/{demos,missions} || die "mkdir {demos,missions} failed"
120 - use cdinstall && unpack ${MY_PATCH}
121 -
122 - # Extract level data if installing from CD
123 - if [ "${F_SOURCE}" == "cd" ]; then
124 - unarj e "${F_ROOT}/descent2.sow" || die "unarj '${F_ROOT}/descent2.sow' failed"
125 -
126 - # Remove files not needed by any Linux native client
127 - rm -f *.{bat,dll,exe,ini,lst} endnote.txt # ignore fail
128 -
129 - # Move missions to appropriate directory
130 - mv d2-2plyr.{hog,mn2} d2chaos.{hog,mn2} missions/ || \
131 - die "move missions failed"
132 -
133 - # Move demos to appropriate directory
134 - mv *.dem demos/ || die "move demos failed"
135 -
136 - # Othwerwise, copy files if pulling from install source
137 - else
138 - # Extract files from GOG package if necessary
139 - if ! use cdinstall; then
140 - einfo "Unpacking ${MY_EXE}. This will take a while..."
141 - mkdir gog && cd gog || die "mkdir gog failed"
142 - innoextract -e -s -p1 -L "${DISTDIR}/${MY_EXE}" || die "innoextract failed"
143 - cd .. || die "cd .. failed"
144 - fi
145 -
146 - for i in "${F_ROOT}"/*.{ham,HAM,hog,HOG,pig,PIG,s11,S11,s22,S22,txt,TXT,pdf,PDF}; do
147 - copy_file "$i" "${WORKDIR}"
148 - done
149 -
150 - # Also copy optional missions and demos if available
151 - for i in "${F_ROOT}"/{missions,MISSIONS}/*; do
152 - copy_file "$i" "${WORKDIR}/missions"
153 - done
154 - for i in "${F_ROOT}"/{demos,DEMOS}/*; do
155 - copy_file "$i" "${WORKDIR}/demos"
156 - done
157 - fi
158 -
159 - # Also copy video files if desired
160 - if use videos; then
161 - # Require high resolution movie files
162 - for i in "${F_ROOT}"/*-{h.mvl,H.MVL}; do
163 - copy_file "$i" "${WORKDIR}"
164 - done
165 - if [ ! -f "${WORKDIR}/intro-h.mvl" \
166 - -o ! -f "${WORKDIR}/other-h.mvl" \
167 - -o ! -f "${WORKDIR}/robots-h.mvl" ] ; then
168 - die "videos not found"
169 - fi
170 -
171 - # Also copy low resolution movie files (not available from GOG)
172 - # Would anyone really want low-res videos at this point? Probably not.
173 - #for i in "${F_ROOT}"/*-{l.mvl,L.MVL}; do
174 - # copy_file "$i" "${WORKDIR}"
175 - #done
176 - fi
177 -
178 -}
179 -
180 -src_prepare() {
181 - # Patch to 1.2 if necessary
182 - if use cdinstall; then
183 - if [ "$(md5sum descent2.ham)" != "7f30c3d7d4087b8584b49012a53ce022" ]; then
184 - for i in *.xdelta; do
185 - xdelta3 -d -s ${i%.*} ${i} ${i%.*}.new \
186 - || die "patch ${i%.*} failed"
187 - mv ${i%.*}.new ${i%.*} || die "patch ${i%.*} failed"
188 - done
189 - fi
190 - rm *.xdelta || die "rm *.xdelta"
191 - fi
192 -
193 - mkdir doc || die "mkdir doc failed"
194 - mv *.{txt,pdf} doc/ # ignore fail
195 -}
196 -
197 -src_install() {
198 - insinto "${dir}"
199 - doins *
200 -
201 - if [ "$(ls -A missions/)" ]; then
202 - insinto "${dir}/missions"
203 - doins missions/*
204 - fi
205 -
206 - if [ "$(ls -A demos/)" ]; then
207 - insinto "${dir}/demos"
208 - doins demos/*
209 - fi
210 -
211 - if use doc; then
212 - dodoc doc/*.txt
213 - if [ $(ls doc/*.pdf 2>/dev/null | wc -l) -gt 0 ]; then
214 - insinto "/usr/share/doc/${PF}"
215 - doins doc/*.pdf
216 - fi
217 - fi
218 -
219 - prepgamesdirs
220 -}
221 -
222 -pkg_postinst() {
223 - games_pkg_postinst
224 -
225 - elog "A client is needed to run the game, e.g. games-action/d2x-rebirth."
226 - echo
227 -}