games-server/fbmuck-9999
[portage-squeep] / games-server / fbmuck / fbmuck-9999.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="5"
6 inherit eutils fixheadtails git-2
7
8 IUSE="ssl ipv6 +diskbase -scary_prims debug pcre"
9
10 DESCRIPTION="A database-backed multi-user chat server."
11 HOMEPAGE="http://www.belfry.com/fuzzball/"
12 EGIT_REPO_URI="git://git.code.sf.net/p/fbmuck/code"
13 EGIT_PROJECT="fbmuck.git"
14 EGIT_SOURCEDIR="${WORKDIR}/${P}"
15
16 SLOT="0"
17 LICENSE="GPL-2"
18 KEYWORDS=""
19
20 RDEPEND="
21 ssl? ( dev-libs/openssl )
22 pcre? ( dev-libs/libpcre )
23 "
24
25 DEPEND="${RDEPEND}
26 >=sys-apps/sed-4
27 "
28
29 RESTRICT="strip"
30
31 S="${WORKDIR}/${P}/fbmuck"
32
33 src_prepare() {
34 epatch "${FILESDIR}/${P}-gentoo.patch"
35
36 einfo "ensuring configure script is executable"
37 chmod +x configure
38
39 ht_fix_file game/restart.in game/resurrect
40
41 einfo "disabling DB_DOUBLING define"
42 sed -i -e 's:#define DB_DOUBLING:#undef DB_DOUBLING:' include/config.h || die "sed failed"
43
44 if use diskbase
45 then
46 einfo "enabling DISKBASE define"
47 sed -i -e 's:#undef DISKBASE:#define DISKBASE:' include/config.h || die "sed failed"
48 fi
49 if use scary_prims
50 then
51 einfo "enabling SCARY_MUF_PRIMS define"
52 sed -i -e 's:#undef SCARY_MUF_PRIMS:#define SCARY_MUF_PRIMS:' include/config.h || die "sed failed"
53 fi
54 }
55
56 src_configure() {
57 econf \
58 $(use_with ssl ssl=/usr) \
59 $(use_with pcre pcre=/usr) \
60 $(use_enable ipv6) \
61 $(use_enable debug)
62 }
63
64 src_compile() {
65 einfo "entering ${S}/src"
66 cd "${S}/src"
67
68 emake all
69 }
70
71 src_install() {
72 keepdir /usr/share/fbmuck
73
74 emake DESTDIR="${D}" install
75
76 dobin "${FILESDIR}/fbmuckctl"
77
78 doinitd "${FILESDIR}/fbmuck"
79
80 insinto /etc
81 doins "${FILESDIR}/fbmucks"
82
83 dodoc src/CHANGESfb6 INSTALLATION README
84 }