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