1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/games-simulation/openttd/openttd-0.6.3.ebuild,v 1.6 2009/02/02 15:14:49 ranger Exp $
12 DESCRIPTION
="OpenTTD is a clone of Transport Tycoon Deluxe"
13 HOMEPAGE
="http://www.openttd.org/"
14 SRC_URI
="http://binaries.openttd.org/releases/${MY_PV}/${MY_P}-source.tar.bz2"
15 SCENARIOS
="0.4.8 0.5.0"
16 for scenario
in ${SCENARIOS}; do
17 SRC_URI
="${SRC_URI} scenarios? (
18 http://binaries.openttd.org/scenarios/${PN}-${scenario}-scenarios.tar.bz2 )"
23 KEYWORDS
="amd64 ppc ppc64 x86"
24 IUSE
="alsa debug dedicated iconv +png scenarios timidity +truetype +zlib"
34 iconv? ( virtual/libiconv )
35 png? ( media-libs/libpng )
36 zlib? ( sys-libs/zlib )"
39 timidity? ( media-sound/timidity++ )
40 !timidity? ( alsa? ( media-sound/alsa-utils ) )
46 unpack
${MY_P}-source.
tar.bz2
48 if use scenarios
; then
49 cd "${S}"/bin
/scenario
/
50 for scenario
in ${SCENARIOS}; do
51 unpack
${PN}-${scenario}-scenarios.
tar.bz2
58 use debug
&& myopts
="${myopts} --enable-debug=3"
59 if use dedicated
; then
60 myopts
="${myopts} --enable-dedicated "
62 myopts
="${myopts} --with-sdl $(use_with truetype freetype)
63 $(use_with truetype fontconfig)"
64 if ! use timidity
; then
65 use alsa
&& myopts
="${myopts} --with-midi=/usr/bin/aplaymidi"
68 # configure is a hand-written sh-script, so econf will not work
69 .
/configure
--disable-strip \
71 --binary-dir=games
/bin \
72 --data-dir=share
/games
/${PN} \
73 --install-dir="${D}" \
74 --doc-dir=share
/doc
/${P} \
75 --menu-group="Game;Simulation;" \
80 || die
"configure failed"
84 emake || die
"emake failed"
88 emake DESTDIR
="${D}" install || die
"emake install failed"
90 if use scenarios
; then
91 insinto
"${GAMES_DATADIR}"/${PN}/scenario
92 doins bin
/scenario
/*.scn || die
"doins failed (scenario)"
93 doins bin
/scenario
/*/*.scn || die
"doins failed (scenario)"
103 elog
"In order to play, you must copy the following 6 files from "
104 elog
"a version of TTD to ${GAMES_DATADIR}/${PN}/data/."
106 elog
"From the WINDOWS version you need: "
107 elog
" sample.cat trg1r.grf trgcr.grf trghr.grf trgir.grf trgtr.grf"
108 elog
"OR from the DOS version you need: "
109 elog
" SAMPLE.CAT TRG1.GRF TRGC.GRF TRGH.GRF TRGI.GRF TRGT.GRF"
111 elog
"File names are case sensitive so make sure they are "
112 elog
"correct for whichever version you have."
115 if use scenarios
; then
116 elog
"Scenarios are installed into:"
117 elog
"${GAMES_DATADIR}/${PN}/scenario,"
118 elog
"you will have to symlink them to ~/.openttd/scenario in order"
121 elog
" ln -s ${GAMES_DATADIR}/${PN}/scenario ~/.openttd/scenario"
125 if use dedicated
; then
126 ewarn
"Warning: The init script will kill all running openttd"
127 ewarn
"processes when run, including any running client sessions!"
129 if use timidity || use alsa
; then
130 elog
"If you want music, you must copy the gm/ directory to"
131 elog
"${GAMES_DATADIR}/${PN}/"
132 elog
"You can enable MIDI by running:"
133 elog
" openttd -m extmidi"
135 if use timidity
; then
136 elog
"You also need soundfonts for timidity, if you don't"
137 elog
"know what that is, do:"
139 elog
"emerge media-sound/timidity-eawpatches"
141 elog
"You have emerged with 'aplaymidi' for playing MIDI."
142 elog
"You have to set the environment variable ALSA_OUTPUT_PORTS."
143 elog
"Available ports can be listed by using 'aplaymidi -l'."
146 elog
"timidity and/or alsa not in USE so music will not be played during the game."