Merge remote-tracking branch 'github/pr/536'.
[gentoo.git] / games-rpg / coe2 / coe2-2007-r1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 inherit eutils games
7
8 DESCRIPTION="Precursor to the Dominions series"
9 HOMEPAGE="http://www.shrapnelgames.com/Illwinter/CoE2/"
10 SRC_URI="http://download.shrapnelgames.com/downloads/${PN}_${PV}.zip"
11
12 LICENSE="all-rights-reserved"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE=""
16 RESTRICT="mirror bindist"
17
18 RDEPEND="media-libs/libsdl[sound,video]"
19 DEPEND="${RDEPEND}
20         app-arch/unzip"
21
22 S=${WORKDIR}/coe
23
24 # bug #430026
25 QA_PREBUILT="${GAMES_PREFIX_OPT}/coe2/coe_linux"
26
27 src_prepare() {
28         rm -r *.{dll,exe} old || die
29         if use amd64 ; then
30                 mv -f coe_linux64bit coe_linux || die
31         fi
32 }
33
34 src_install() {
35         insinto "${GAMES_PREFIX_OPT}/${PN}"
36         doins *.{bgm,smp,trp,trs,wrl}
37         dodoc history.txt manual.txt readme.txt
38         exeinto "${GAMES_PREFIX_OPT}/${PN}"
39         doexe coe_linux
40
41         games_make_wrapper ${PN} "./coe_linux" "${GAMES_PREFIX_OPT}/${PN}"
42         make_desktop_entry ${PN} "Conquest of Elysium 2"
43
44         # Slots for saved games.
45         # The game shows e.g. "EMPTY SLOT 0?", but it works.
46         local f slot state_dir=${GAMES_STATEDIR}/${PN}
47         dodir "${state_dir}"
48         for slot in {0..4} ; do
49                 f=save${slot}
50                 dosym "${state_dir}/save${slot}" "${GAMES_PREFIX_OPT}/${PN}/${f}"
51                 echo "empty slot ${slot}" > "${D}${state_dir}/${f}" || die
52                 fperms 660 "${state_dir}/${f}"
53         done
54
55         prepgamesdirs
56 }