games-action/descent2-vertigo: [QA] inherit estack.eclass directly
[gentoo.git] / games-action / descent2-vertigo / descent2-vertigo-1.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit cdrom estack eutils
7
8 DESCRIPTION="Data files for Descent 2: The Vertigo Series"
9 HOMEPAGE="http://www.interplay.com/games/descent.php"
10
11 LICENSE="descent-data"
12 SLOT="0"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="videos"
15 RESTRICT="bindist"
16
17 S="${WORKDIR}"
18
19 src_unpack() {
20         cdrom_get_cds vertigo/d2x.hog:hoard.ham
21
22         case ${CDROM_SET} in
23                 0) einfo "Found Descent 2 Vertigo Series CD" ;;
24                 1) einfo "Found Descent 2 Vertigo Series installation" ;;
25         esac
26
27         cd "${CDROM_ABSMATCH%/*}" || die
28         eshopts_push -s globstar nocaseglob nullglob
29
30         # Strip directories
31         # Lowercase
32         # *.{hog,mn2} into data/missions
33         # Remainder into data
34
35         tar c \
36                 --mode=u+w \
37                 --ignore-case \
38                 --xform='s:.*/::xg' \
39                 --xform='s:.*:\L\0:x' \
40                 --xform='s:.*\.(hog|mn2)$:data/missions/\0:x' \
41                 --xform='s:^[^/]+$:data/\0:x' \
42                 --exclude="$(use videos || echo '*.mvl')" \
43                 **/{hoard.ham,d2x-h.mvl,{d2x,panic}.{hog,mn2}}* \
44                 | tar x -C "${WORKDIR}"
45
46         assert "tar failed"
47         eshopts_pop
48 }
49
50 src_install() {
51         insinto /usr/share/games/d2x
52         doins -r data/*
53 }
54
55 pkg_postinst() {
56         elog "A client is needed to run the game, e.g. games-action/dxx-rebirth."
57         echo
58 }