Use https by default
[gentoo.git] / games-strategy / ja2-stracciatella / ja2-stracciatella-0.12.1_p7072.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=4
6
7 inherit eutils games
8
9 DESCRIPTION="A port of Jagged Alliance 2 to SDL"
10 HOMEPAGE="http://tron.homeunix.org/ja2/"
11 SRC_URI="https://dev.gentoo.org/~hasufell/distfiles/${P}.tar.xz
12         http://tron.homeunix.org/ja2/editor.slf.gz"
13
14 LICENSE="SFI-SCLA"
15 SLOT="0"
16 KEYWORDS="amd64 x86"
17 IUSE="cdinstall editor zlib"
18
19 RDEPEND="media-libs/libsdl[X,sound,video]
20         cdinstall? ( games-strategy/ja2-stracciatella-data )
21         zlib? ( sys-libs/zlib )"
22
23 LANGS="linguas_de +linguas_en linguas_fr linguas_it linguas_nl linguas_pl linguas_ru linguas_ru_gold"
24 IUSE="$IUSE $LANGS"
25 REQUIRED_USE="^^ ( ${LANGS//+/} )"
26
27 src_prepare() {
28         epatch "${FILESDIR}"/${P}-makefile.patch
29
30         sed \
31                 -e "s:/some/place/where/the/data/is:${GAMES_DATADIR}/ja2:" \
32                 -i sgp/FileMan.cc || die
33
34         sed \
35                 -e "s:@GAMES_DATADIR@:${GAMES_DATADIR}/ja2/data:" \
36                 "${FILESDIR}"/ja2-convert.sh > "${T}"/ja2-convert || die
37 }
38
39 src_compile() {
40         local myconf
41
42         case ${LINGUAS} in
43                 de) myconf="LNG=GERMAN" ;;
44                 nl) myconf="LNG=DUTCH" ;;
45                 fr) myconf="LNG=FRENCH" ;;
46                 it) myconf="LNG=ITALIAN" ;;
47                 pl) myconf="LNG=POLISH" ;;
48                 ru) myconf="LNG=RUSSIAN" ;;
49                 ru_gold) myconf="LNG=RUSSIAN_GOLD" ;;
50                 en) myconf="LNG=ENGLISH" ;;
51                 *) die "wat" ;;
52         esac
53         elog "Chosen language is ${myconf#LNG=}"
54
55         use editor && myconf+=" JA2EDITOR=yes JA2BETAVERSION=yes"
56         use zlib && myconf+=" WITH_ZLIB=yes"
57
58         emake ${myconf}
59 }
60
61 src_install() {
62         dogamesbin ja2 "${T}"/ja2-convert
63
64         if use editor; then
65                 insinto "${GAMES_DATADIR}"/ja2/data
66                 doins "${WORKDIR}"/editor.slf
67         fi
68
69         make_desktop_entry ja2 ${PN}
70         doman ja2.6
71
72         prepgamesdirs
73 }
74
75 pkg_postinst() {
76         games_pkg_postinst
77
78         elog "You need ja2 in the chosen language, otherwise set it in package.use!"
79
80         if ! use cdinstall ; then
81                 elog "You need to copy all files from the Data directory of"
82                 elog "Jagged Alliance 2 installation to"
83                 elog "${GAMES_DATADIR}/ja2/data "
84                 elog "Make sure the filenames are lowercase. You may want to run the"
85                 elog "script":
86                 elog "${GAMES_BINDIR}/ja2-convert"
87         fi
88 }