summaryrefslogtreecommitdiff
blob: 0cfadea6e171f8ab988e2a49a78fd422b36d631f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

inherit eutils

DAT_PV=0.13.1
DESCRIPTION="Lure of the Temptress"
HOMEPAGE="http://www.revolution.co.uk/_display.php?id=10"
SRC_URI="
	https://raw.githubusercontent.com/scummvm/scummvm/266aef932a8a052df897e4d79b4572e5d169916f/dists/engine-data/lure.dat -> lure-${DAT_PV}.dat
	!l10n_en? ( !l10n_es? ( !l10n_fr? ( !l10n_de? ( !l10n_it?
		( mirror://sourceforge/scummvm/${P}.zip -> ${PN}-en-${PV}.zip ) ) ) ) )
	l10n_en? ( mirror://sourceforge/scummvm/${P}.zip  -> ${PN}-en-${PV}.zip )
	l10n_es? ( mirror://sourceforge/scummvm/${PN}-es-${PV}.zip )
	l10n_fr? ( mirror://sourceforge/scummvm/${PN}-fr-${PV}.zip )
	l10n_de? ( mirror://sourceforge/scummvm/${PN}-de-${PV}.zip )
	l10n_it? ( mirror://sourceforge/scummvm/${PN}-it-${PV}.zip )"

LICENSE="lure"
SLOT="0"
KEYWORDS="~amd64 ~x86"
LANGS_IUSE="l10n_en l10n_es l10n_de l10n_fr l10n_it"
IUSE=${LANGS_IUSE}
RESTRICT="mirror"

RDEPEND=">=games-engines/scummvm-0.13.1"
DEPEND="${RDEPEND}
	app-arch/unzip"

S=${WORKDIR}

any_l10n() {
	use l10n_en || use l10n_es || use l10n_de || use l10n_fr || use l10n_it
}

src_unpack() {
	local lang

	if any_l10n ; then
		for lang in ${LANGS_IUSE}
		do
			use ${lang} && unpack ${PN}-${lang/l10n_}-${PV}.zip
		done
		mv lure lure-en 2> /dev/null
	else
		unpack ${PN}-en-${PV}.zip
	fi
}

src_prepare() {
	local lang f

	default

	find . \
		\( -iname "*exe" \
		-o -iname "*ega" \
		-o -iname LICENSE.txt \) \
		-exec rm -f '{}' +
	mkdir docs
	if any_l10n ; then
		for lang in ${LANGS_IUSE}
		do
			mkdir docs/${lang}
			find lure-${lang/l10n_} \
				\( -iname "*pdf" \
				-o -iname README \
				-o -iname "*txt" \) \
				-exec mv '{}' docs/${lang} \; 2> /dev/null
		done
	else
		find lure \
			\( -iname "*pdf" \
			-o -iname README \
			-o -iname "*txt" \) \
			-exec mv '{}' docs \; 2> /dev/null
	fi
	for f in $(find docs -type f)
	do
		mv ${f} ${f%.*}.$(echo ${f#*.} | tr '[[:upper:]]' '[[:lower:]]') 2> /dev/null
	done
}

src_install() {
	local lang

	if any_l10n ; then
		for lang in ${LANGS_IUSE}
		do
			if use ${lang} ; then
				lang=${lang/l10n_}
				insinto "/usr/share/${PN}-${lang}"
				newins "${DISTDIR}"/lure-${DAT_PV}.dat lure.dat
				doins -r ${PN}-${lang}/*
				make_wrapper ${PN}-${lang} "scummvm -q ${lang} -f -p \"/usr/share/${PN}-${lang}\" lure" .
				make_desktop_entry ${PN}-${lang} "Lure of the Temptress (${lang})" ${PN}
				docinto l10n_${lang}
				dodoc docs/l10n_${lang}/*
			fi
		done
	else
		insinto "/usr/share/${PN}"
		newins "${DISTDIR}"/lure-${DAT_PV}.dat lure.dat
		doins -r ${PN}/*
		make_wrapper ${PN} "scummvm -f -p \"/usr/share/${PN}\" lure" .
		make_desktop_entry ${PN} "Lure of the Temptress"
	fi
}