summaryrefslogtreecommitdiff
blob: d48aee4c81c6757f5813b9d34a56f42a4515e24d (plain)
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
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-server/halflife-metamod/halflife-metamod-1.16.2.ebuild,v 1.2 2003/09/10 06:01:04 vapier Exp $

inherit games gcc

DESCRIPTION="plugin manager for Half-Life server"
HOMEPAGE="http://www.metamod.org/"
SRC_URI="http://www.metamod.org/files/metamod-${PV}.tgz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86"
IUSE="src"

DEPEND="src? ( dev-games/hlsdk )
	>=sys-apps/sed-4"
RDEPEND="games-server/halflife-server"

S=${WORKDIR}/metamod-${PV}

src_unpack() {
	unpack ${A}
	[ `use src` ] && [ `gcc-major-version` -eq 3 ] \
		&& sed -i 's:-malign:-falign:g' `find -name Makefile`
}

src_compile() {
	[ `use src` ] || return 0
	make \
		SDKTOP=${GAMES_LIBDIR}/hlsdk \
		CCO="${CFLAGS}" \
		CC="$(gcc-getCC)" \
		opt \
		|| die
}

src_install() {
	local dir=${GAMES_PREFIX_OPT}/halflife/addons/metamod
	dodir ${dir}

	if [ `use src` ] ; then
		make \
			SDKTOP=${GAMES_LIBDIR}/hlsdk \
			INST_DIR=${D}/${dir} \
			OPT=opt \
			install \
			|| die
	else
		insinto ${dir}
		doins dlls/*.so
	fi
	insinto ${dir}
	doins doc/metamod.ini

	insinto /usr/include/metamod
	doins metamod/*.h

	dodoc doc/* doc/txt/*
	dohtml -r doc/html/*

	prepgamesdirs
}