1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
--- armagetronad-0.2.8.1.ebuild 2006-05-01 13:19:04.000000000 +0200
+++ armagetronad-0.2.8.2.ebuild 2006-08-14 00:03:10.000000000 +0200
@@ -20,6 +20,7 @@
LICENSE="GPL-2"
SLOT="0"
+GameSLOT="" #GameSLOT="-${SLOT}"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE="debug dedicated krawall opengl moviepack moviesounds"
@@ -42,20 +43,16 @@
moviesounds? ( app-arch/unzip )
linguas_es? ( !linguas_en? ( app-arch/unzip ) )"
-src_unpack() {
- unpack ${A}
- cd "${S}/batch"
- epatch "${FILESDIR}/0280_fix-sysinstall.patch"
-}
-
aabuild() {
- MyBUILDDIR="${WORKDIR}/build-$1"
- mkdir -p "${MyBUILDDIR}" || die "error creating build directory($1)" # -p to allow EEXIST scenario
- cd "${MyBUILDDIR}"
+ mkdir "${S}/$1"
+ cd "${S}/$1"
+
ln -s "${S}/configure" .
+
use debug && DEBUGLEVEL=3 || DEBUGLEVEL=0
export DEBUGLEVEL CODELEVEL=0
[ "$SLOT" == "0" ] && myconf="--disable-multiver" || myconf="--enable-multiver=${SLOT}"
+
egamesconf ${myconf} \
--srcdir="${S}" \
--disable-binreloc \
@@ -68,7 +65,8 @@
--disable-restoreold \
--disable-games \
--enable-uninstall="emerge --clean =${CATEGORY}/${PF}" \
- "${@:2}" || die "egamesconf($1) failed"
+ "${@:2}" || die "egamesconf $1 failed"
+
[ "$1" == "server" ] && ded='-dedicated' || ded=''
cat >>"config.h" <<EOF
#define DATA_DIR "${GAMES_DATADIR}/${PN}${ded}${GameSLOT}"
@@ -78,41 +76,38 @@
#define AUTORESOURCE_DIR "~/.${PN}/resource/automatic"
#define INCLUDEDRESOURCE_DIR "${GAMES_DATADIR}/${PN}${ded}${GameSLOT}/resource/included"
EOF
- emake armabindir="${GAMES_BINDIR}" || die "emake($1) failed"
+
+ emake armabindir="${GAMES_BINDIR}" || die "emake $1 failed"
}
src_compile() {
- # Assume client if they don't want a server
- use opengl || ! use dedicated && build_client=true || build_client=false
- use dedicated && build_server=true || build_server=false
-
- [ "$SLOT" == "0" ] && GameSLOT="" || GameSLOT="-${SLOT}"
filter-flags -fno-exceptions
- if ${build_client}; then
- einfo "Building game client"
- aabuild client --enable-glout --disable-initscripts --enable-desktop
+
+ # Assume client if they don't want a server
+ if use opengl || ! use dedicated; then
+ aabuild client --enable-glout --disable-initscripts --enable-desktop
fi
- if ${build_server}; then
- einfo "Building dedicated server"
- aabuild server --disable-glout --enable-initscripts --disable-desktop
+ if use dedicated; then
+ aabuild server --disable-glout --enable-initscripts --disable-desktop
fi
}
src_install() {
- if ${build_client} && ${build_server}; then
+ if [ -d "${S}/client" ] && [ -d "${S}/server" ]; then
# Setup symlink so both client and server share their common data
- dodir "${GAMES_DATADIR}"
- dosym "${PN}${GameSLOT}" "${GAMES_DATADIR}/${PN}-dedicated${GameSLOT}"
- dodir "${GAMES_SYSCONFDIR}"
- dosym "${PN}${GameSLOT}" "${GAMES_SYSCONFDIR}/${PN}-dedicated${GameSLOT}"
+ for i in ${GAMES_DATADIR} ${GAMES_SYSCONFDIR}; do
+ dodir ${i}
+ dosym ${PN}${GameSLOT} ${i}/${PN}-dedicated${GameSLOT}
+ done
fi
- if ${build_client}; then
- einfo "Installing game client"
- cd "${WORKDIR}/build-client"
- make DESTDIR="${D}" armabindir="${GAMES_BINDIR}" install || die "make(client) install failed"
+ if [ -d "${S}/client" ]; then
+ cd "${S}/client"
+
+ emake DESTDIR="${D}" armabindir=${GAMES_BINDIR} install || die "emake client install failed"
+
# copy moviepacks/sounds
cd "${WORKDIR}"
- insinto "${GAMES_DATADIR}/${PN}${GameSLOT}"
+ insinto ${GAMES_DATADIR}/${PN}${GameSLOT}
if use moviepack; then
einfo 'Installing moviepack'
doins -r moviepack || die "copying moviepack"
@@ -126,10 +121,11 @@
fi
fi
fi
- if ${build_server}; then
- einfo "Installing dedicated server"
- cd "${WORKDIR}/build-server"
- make DESTDIR="${D}" armabindir="${GAMES_BINDIR}" install || die "make(server) install failed"
+ if [ -d "${S}/server" ]; then
+ cd "${S}/server"
+
+ emake DESTDIR="${D}" armabindir=${GAMES_BINDIR} install || die "emake server install failed"
+
einfo 'Adjusting dedicated server configuration'
dosed "s,^\(user=\).*$,\1${GAMES_USER_DED},; s,^#\(VARDIR=/.*\)$,\\1," "${GAMES_SYSCONFDIR}/${PN}-dedicated${GameSLOT}/rc.config" || ewarn 'adjustments for rc.config FAILED; the defaults may not be suited for your system!'
DedHOME="$(eval echo ~${GAMES_USER_DED})"
@@ -137,9 +133,9 @@
dosym "${GAMES_STATEDIR}/${PN}-dedicated${GameSLOT}" "${DedHOME}/.${PN}"
fi
# Ok, so we screwed up on doc installation... so for now, the ebuild does this manually
- dohtml -r "${D}${GAMES_PREFIX}/share/doc/${PN}${ded}${GameSLOT}/html/"*
- dodoc "${D}${GAMES_PREFIX}/share/doc/${PN}${ded}${GameSLOT}/html/"*.txt
+ dohtml -r "${D}${GAMES_PREFIX}/share/doc"/*/html/*
+ dodoc "${D}${GAMES_PREFIX}/share/doc"/*/html/*.txt
rm -r "${D}${GAMES_PREFIX}/share/doc"
- rmdir "${D}${GAMES_PREFIX}/share" || true # Supress potential error
+ rmdir "${D}${GAMES_PREFIX}/share"
prepgamesdirs
}
|