/[gentoo-x86]/games-action/armagetronad/armagetronad-0.2.8.1.ebuild
Gentoo

Contents of /games-action/armagetronad/armagetronad-0.2.8.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Mon May 1 03:21:03 2006 UTC (14 years, 7 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
not yet ready
(Portage version: 2.1_pre10)
 (Signed Manifest commit)

1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/games-action/armagetronad/armagetronad-0.2.8.1.ebuild,v 1.3 2006/05/01 02:51:37 mr_bones_ Exp $
4
5 inherit flag-o-matic eutils games
6
7 DESCRIPTION="\"A Tron clone in 3D\""
8 HOMEPAGE="http://armagetronad.net/"
9 SRC_URI="mirror://sourceforge/armagetronad/${P}.src.tar.bz2
10 moviesounds? (
11 http://armagetron.sourceforge.net/addons/moviesounds_fq.zip
12 linguas_es? ( !linguas_en? (
13 http://usuario.tiscalinet.es/hgctiscali/naflat/downloads/spanishvoices.zip
14 ) )
15 )
16 moviepack? (
17 http://armagetron.sourceforge.net/addons/moviepack.zip
18 )"
19
20 LICENSE="GPL-2"
21 SLOT="0"
22 KEYWORDS="~amd64 ~ppc ~x86"
23 IUSE="debug dedicated krawall opengl moviepack moviesounds"
24
25 GLDEPS="|| (
26 x11-libs/libX11
27 virtual/x11
28 )
29 virtual/glu
30 virtual/opengl
31 media-libs/libsdl
32 media-libs/sdl-image
33 media-libs/jpeg
34 media-libs/libpng"
35 RDEPEND="
36 >=dev-libs/libxml2-2.6.12
37 sys-libs/zlib
38 opengl? ( ${GLDEPS} )
39 !dedicated? ( ${GLDEPS} )"
40 DEPEND="${RDEPEND}
41 moviepack? ( app-arch/unzip )
42 moviesounds? ( app-arch/unzip )
43 linguas_es? ( !linguas_en? ( app-arch/unzip ) )"
44
45 pkg_setup() {
46 if use debug; then
47 ewarn
48 ewarn 'The "debug" USE flag will enable debugging code. This will cause AI'
49 ewarn ' players to chat debugging information, debugging lines to be drawn'
50 ewarn ' on the grid and at wall angles, and probably most relevant to your'
51 ewarn ' decision to keep the USE flag:'
52 ewarn ' FULL SCREEN MODE AND SOUND WILL BE DISABLED'
53 ewarn
54 ewarn "If you don't like this, add this line to /etc/portage/package.use:"
55 ewarn ' games-action/armagetronad -debug'
56 ewarn
57 ewarn 'If you ignore this warning and complain about any of the above'
58 ewarn ' effects, the Armagetron Advanced team will either ignore you or'
59 ewarn ' delete your complaint.'
60 ewarn
61 ebeep 5
62 fi
63 # Assume client if they don't want a server
64 use opengl || ! use dedicated && build_client=true || build_client=false
65 use dedicated && build_server=true || build_server=false
66
67 MyEMAKE="armabindir=${GAMES_BINDIR}" # we have a broken build system, I guess
68 # Note: Music isn't there yet
69 COMMON_CONFIG="--disable-master --enable-main --disable-memmanager --disable-music $(use_enable krawall) --enable-sysinstall --disable-useradd --enable-etc --disable-restoreold --disable-games"
70 if [ "$SLOT" == "0" ]; then
71 COMMON_CONFIG="${COMMON_CONFIG} --disable-multiver"
72 GameSLOT=""
73 else
74 COMMON_CONFIG="${COMMON_CONFIG} --enable-multiver=${SLOT}"
75 GameSLOT="-${SLOT}"
76 fi
77 UNINSTALL_CONFIG=--enable-uninstall="emerge --clean =${CATEGORY}/${PF}"
78 if use debug; then
79 DEBUGLEVEL=3
80 else
81 DEBUGLEVEL=0
82 fi
83 CODELEVEL=0
84 }
85
86 src_unpack() {
87 unpack ${A}
88 cd "${S}/batch"
89 epatch "${FILESDIR}/0280_fix-sysinstall.patch"
90 }
91
92 aabuild() {
93 MyBUILDDIR="${WORKDIR}/build-$1"
94 mkdir -p "${MyBUILDDIR}" || die "error creating build directory($1)" # -p to allow EEXIST scenario
95 cd "${MyBUILDDIR}"
96 cat >configure <<EOF
97 #!/bin/sh
98 "${S}/configure" "\$@"
99 EOF
100 chmod +x configure
101 export DEBUGLEVEL CODELEVEL
102 egamesconf ${COMMON_CONFIG} "${UNINSTALL_CONFIG}" "${@:2}" || die "egamesconf($1) failed"
103 if [ "$1" == "server" ]; then
104 ded='-dedicated'
105 else
106 ded=''
107 fi
108 cat >>"config.h" <<EOF
109 #undef ENABLE_BINRELOC
110 #define DATA_DIR "${GAMES_DATADIR}/${PN}${ded}${GameSLOT}"
111 #define CONFIG_DIR "${GAMES_SYSCONFDIR}/${PN}${ded}${GameSLOT}"
112 #define RESOURCE_DIR "${GAMES_DATADIR}/${PN}${ded}${GameSLOT}/resource"
113 #define USER_DATA_DIR "~/.${PN}"
114 #define AUTORESOURCE_DIR "~/.${PN}/resource/automatic"
115 #define INCLUDEDRESOURCE_DIR "${GAMES_DATADIR}/${PN}${ded}${GameSLOT}/resource/included"
116 EOF
117 emake ${MyEMAKE} || die "emake($1) failed"
118 }
119
120 src_compile() {
121 filter-flags -fno-exceptions
122 if ${build_client}; then
123 einfo "Building game client"
124 aabuild client --enable-glout --disable-initscripts --enable-desktop
125 fi
126 if ${build_server}; then
127 einfo "Building dedicated server"
128 aabuild server --disable-glout --enable-initscripts --disable-desktop
129 fi
130 }
131
132 src_install() {
133 if ${build_client} && ${build_server}; then
134 # Setup symlink so both client and server share their common data
135 mkdir -p "${D}${GAMES_DATADIR}"
136 dosym "${PN}${GameSLOT}" "${GAMES_DATADIR}/${PN}-dedicated${GameSLOT}"
137 fi
138 if ${build_client}; then
139 einfo "Installing game client"
140 cd "${WORKDIR}/build-client"
141 emake install DESTDIR="${D}" ${MyEMAKE} || die "emake(client) install failed"
142 # copy moviepacks/sounds
143 cd "${WORKDIR}"
144 insinto "${GAMES_DATADIR}/${PN}${GameSLOT}"
145 if use moviepack; then
146 einfo 'Installing moviepack'
147 doins -r moviepack || die "copying moviepack"
148 fi
149 if use moviesounds; then
150 einfo 'Installing moviesounds'
151 doins -r moviesounds || die "copying moviesounds"
152 if use linguas_es && ! use linguas_en; then
153 einfo 'Installing Spanish moviesounds'
154 doins -r ArmageTRON/moviesounds || die "copying spanish moviesounds"
155 fi
156 fi
157 fi
158 if ${build_server}; then
159 einfo "Installing dedicated server"
160 cd "${WORKDIR}/build-server"
161 emake install DESTDIR="${D}" ${MyEMAKE} || die "emake(server) install failed"
162 einfo 'Adjusting dedicated server configuration'
163 sed -i "s,\(^user=\).*$,\1${GAMES_USER_DED},; s,^#VARDIR=\$HOME/./armagetronad-dedicated$,\\0\\nVARDIR=${GAMES_STATEDIR}/${PN}-dedicated${GameSLOT}," "${D}${GAMES_SYSCONFDIR}/${PN}-dedicated${GameSLOT}/rc.config"
164 DedHOME="$(eval echo ~${GAMES_USER_DED})"
165 mkdir -p "${D}${DedHOME}"
166 dosym "${GAMES_STATEDIR}/${PN}-dedicated${GameSLOT}" "${DedHOME}/.${PN}"
167 fi
168 # Ok, so we screwed up on doc installation... so for now, the ebuild does this manually
169 dohtml -r "${D}${GAMES_PREFIX}/share/doc/${PN}${ded}${GameSLOT}/html/"*
170 dodoc "${D}${GAMES_PREFIX}/share/doc/${PN}${ded}${GameSLOT}/html/"*.txt
171 rm -r "${D}${GAMES_PREFIX}/share/doc"
172 rmdir "${D}${GAMES_PREFIX}/share" || true # Supress potential error
173 prepgamesdirs
174 }

  ViewVC Help
Powered by ViewVC 1.1.20