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 $
9 DESCRIPTION
="OpenTTD is a clone of Transport Tycoon Deluxe"
10 HOMEPAGE
="http://www.openttd.org/"
11 SRC_URI
="http://binaries.openttd.org/releases/${PV}/${P}-source.tar.bz2"
12 SCENARIOS
="0.4.8 0.5.0"
13 for scenario
in ${SCENARIOS}; do
14 SRC_URI
="${SRC_URI} scenarios? (
15 http://binaries.openttd.org/scenarios/${PN}-${scenario}-scenarios.tar.bz2 )"
20 KEYWORDS
="amd64 ppc ppc64 x86"
21 IUSE
="alsa debug dedicated iconv +png scenarios timidity +truetype +zlib"
31 iconv? ( virtual/libiconv )
32 png? ( media-libs/libpng )
33 zlib? ( sys-libs/zlib )"
36 timidity? ( media-sound/timidity++ )
37 !timidity? ( alsa? ( media-sound/alsa-utils ) )
43 unpack
${P}-source.
tar.bz2
45 if use scenarios
; then
46 cd "${S}"/bin
/scenario
/
47 for scenario
in ${SCENARIOS}; do
48 unpack
${PN}-${scenario}-scenarios.
tar.bz2
55 use debug
&& myopts
="${myopts} --enable-debug=3"
56 if use dedicated
; then
57 myopts
="${myopts} --enable-dedicated "
59 myopts
="${myopts} --with-sdl $(use_with truetype freetype)
60 $(use_with truetype fontconfig)"
61 if ! use timidity
; then
62 use alsa
&& myopts
="${myopts} --with-midi=/usr/bin/aplaymidi"
65 # configure is a hand-written sh-script, so econf will not work
66 .
/configure
--disable-strip \
68 --binary-dir=games
/bin \
69 --data-dir=share
/games
/${PN} \
70 --install-dir="${D}" \
71 --doc-dir=share
/doc
/${P} \
72 --menu-group="Game;Simulation;" \
77 || die
"configure failed"
81 emake || die
"emake failed"
85 emake DESTDIR
="${D}" install || die
"emake install failed"
87 if use scenarios
; then
88 insinto
"${GAMES_DATADIR}"/${PN}/scenario
89 doins bin
/scenario
/*.scn || die
"doins failed (scenario)"
90 doins bin
/scenario
/*/*.scn || die
"doins failed (scenario)"
100 elog
"In order to play, you must copy the following 6 files from "
101 elog
"a version of TTD to ${GAMES_DATADIR}/${PN}/data/."
103 elog
"From the WINDOWS version you need: "
104 elog
" sample.cat trg1r.grf trgcr.grf trghr.grf trgir.grf trgtr.grf"
105 elog
"OR from the DOS version you need: "
106 elog
" SAMPLE.CAT TRG1.GRF TRGC.GRF TRGH.GRF TRGI.GRF TRGT.GRF"
108 elog
"File names are case sensitive so make sure they are "
109 elog
"correct for whichever version you have."
112 if use scenarios
; then
113 elog
"Scenarios are installed into:"
114 elog
"${GAMES_DATADIR}/${PN}/scenario,"
115 elog
"you will have to symlink them to ~/.openttd/scenario in order"
118 elog
" ln -s ${GAMES_DATADIR}/${PN}/scenario ~/.openttd/scenario"
122 if use dedicated
; then
123 ewarn
"Warning: The init script will kill all running openttd"
124 ewarn
"processes when run, including any running client sessions!"
126 if use timidity || use alsa
; then
127 elog
"If you want music, you must copy the gm/ directory to"
128 elog
"${GAMES_DATADIR}/${PN}/"
129 elog
"You can enable MIDI by running:"
130 elog
" openttd -m extmidi"
132 if use timidity
; then
133 elog
"You also need soundfonts for timidity, if you don't"
134 elog
"know what that is, do:"
136 elog
"emerge media-sound/timidity-eawpatches"
138 elog
"You have emerged with 'aplaymidi' for playing MIDI."
139 elog
"You have to set the environment variable ALSA_OUTPUT_PORTS."
140 elog
"Available ports can be listed by using 'aplaymidi -l'."
143 elog
"timidity and/or alsa not in USE so music will not be played during the game."