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/descent1-data/
Date: Sat, 29 Apr 2017 20:04:45
Message-Id: 1493495948.14d0ccc985d57e82a0e8396c3b3163ef172dec65.chewi@gentoo
1 commit: 14d0ccc985d57e82a0e8396c3b3163ef172dec65
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 29 19:59:08 2017 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 29 19:59:08 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/gamerlay.git/commit/?id=14d0ccc9
7
8 games-action/descent1-data: Improved version in Gentoo repo, removing
9
10 .../descent1-data/descent1-data-1.0-r1.ebuild | 146 ---------------------
11 1 file changed, 146 deletions(-)
12
13 diff --git a/games-action/descent1-data/descent1-data-1.0-r1.ebuild b/games-action/descent1-data/descent1-data-1.0-r1.ebuild
14 deleted file mode 100644
15 index 9b0cf82..0000000
16 --- a/games-action/descent1-data/descent1-data-1.0-r1.ebuild
17 +++ /dev/null
18 @@ -1,146 +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 -# For GOG install
29 -MY_EXE="setup_descent_1_2.exe"
30 -
31 -DESCRIPTION="Data files for Descent 1"
32 -HOMEPAGE="http://www.interplay.com/games/support.php?id=263"
33 -SRC_URI="cdinstall? ( http://www.dxx-rebirth.com/download/dxx/misc/descent-game-content-10to14a-patch.zip )
34 - !cdinstall? ( $MY_EXE )"
35 -
36 -# See readme.txt
37 -LICENSE="${PN}"
38 -SLOT="0"
39 -KEYWORDS="amd64 x86"
40 -RESTRICT="!cdinstall? ( fetch )"
41 -IUSE="+cdinstall doc"
42 -
43 -RDEPEND=""
44 -DEPEND="app-arch/unzip
45 - !cdinstall? (
46 - app-arch/innoextract
47 - )"
48 -
49 -S=${WORKDIR}
50 -dir=${GAMES_DATADIR}/d1x
51 -
52 -# Function to handle copying and renaming files from installation directory;
53 -# Allows support of installation sources using capitalized file names
54 -copy_file() {
55 - local dest="${2}"
56 - local f=$(basename "${1}")
57 - if [ "${f:0:1}" == '*' ]; then
58 - return 0
59 - else
60 - echo "Copying '${f}'"
61 - local d=$(echo ${f} | tr "[:upper:]" "[:lower:]")
62 - cp -f "${1}" "${dest}/${d}" || die "copy ${1} failed"
63 - return 0
64 - fi
65 -}
66 -
67 -pkg_nofetch() {
68 - elog "You must place a copy of, or symlink to, the GOG setup package here:"
69 - elog "${DISTDIR}/${MY_EXE}"
70 - echo
71 - elog "If you wish to install from CD-ROM instead, please enable the cdinstall flag"
72 -}
73 -
74 -pkg_setup() {
75 - games_pkg_setup
76 -
77 - if use cdinstall; then
78 - # Check for Descent 1 CD or an existing install (eg., for GOG)
79 - CDROM_NAME_SET=( "CD-ROM Version" "Installed Version" "Installed Version" )
80 - cdrom_get_cds descent/descent.hog:descent.hog:DESCENT.HOG
81 - case ${CDROM_SET} in
82 - 0)
83 - F_ROOT="${CDROM_ROOT}/descent"
84 - einfo 'Found Descent I CD' ;;
85 - [12])
86 - F_ROOT="${CDROM_ROOT}"
87 - einfo 'Found Descent I Installation' ;;
88 - *)
89 - die 'Descent I CD or installation files not found' ;;
90 - esac
91 -
92 - else
93 - # Check for GOG installer
94 - if [ ! -e "${DISTDIR}/${MY_EXE}" ]; then
95 - ewarn "You must copy or symlink '${MY_EXE}' to your distfiles directory"
96 - die "GOG installer not found"
97 - fi
98 - F_ROOT="${WORKDIR}/gog/app/descent"
99 - fi
100 -}
101 -
102 -src_unpack() {
103 - mkdir "${WORKDIR}/missions" || die "mkdir missions failed"
104 -
105 - # Unpack GOG package if necessary
106 - if ! use cdinstall; then
107 - einfo "Unpacking ${MY_EXE}. This will take a while..."
108 - mkdir gog && cd gog || die "mkdir gog failed"
109 - innoextract -e -s -L "${DISTDIR}/${MY_EXE}" || die "innoextract failed"
110 - cd .. || die "cd .. failed"
111 - fi
112 -
113 - # Copy all (including optional) mission files
114 - for i in "${F_ROOT}"/*.{hog,HOG,msn,MSN,pig,PIG,txt,TXT,pdf,PDF}; do
115 - copy_file "$i" "${WORKDIR}/missions"
116 - done
117 -
118 - # Move and validate required files
119 - mv missions/descent.hog . || die 'descent.hog not found'
120 - mv missions/descent.pig . || die 'descent.pig not found'
121 -
122 - # Unpack data file patches
123 - if use cdinstall; then
124 - mkdir d1datapt && cd d1datapt
125 - unpack ../descent-game-content-10to14a-patch.zip
126 - fi
127 -
128 - mkdir doc || die "mkdir doc failed"
129 - mv missions/*.txt missions/*.pdf doc/ # ignore fail
130 -}
131 -
132 -src_prepare() {
133 - # Only try to apply patch if it's actually needed
134 - if [ "$(md5sum descent.hog | cut -f1 -d' ')" != "c792a21a30b869b1ec6d31ad64e9557e" ]; then
135 - einfo "Patching Descent 1 data files"
136 - patch -p0 descent.hog <d1datapt/descent.hog.diff
137 - patch -p0 descent.pig <d1datapt/descent.pig.diff
138 - fi
139 -}
140 -
141 -src_install() {
142 - insinto "${dir}"
143 - doins *
144 -
145 - insinto "${dir}/missions"
146 - doins missions/*
147 -
148 - if use doc; then
149 - dodoc doc/*.txt
150 - if [ $(ls doc/*.pdf 2>/dev/null | wc -l) -gt 0 ]; then
151 - insinto "/usr/share/doc/${PF}"
152 - doins doc/*.pdf
153 - fi
154 - fi
155 -
156 - prepgamesdirs
157 -}
158 -
159 -pkg_postinst() {
160 - games_pkg_postinst
161 -
162 - elog "A client is needed to run the game, e.g. games-action/d1x-rebirth."
163 - echo
164 -}