aboutsummaryrefslogtreecommitdiffstats
path: root/net/cyphesis/Makefile
blob: db17fea4e64de35e038e1772b5e4796498381ab7 (plain) (blame)
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
# Created by: Oliver Lehmann <oliver@FreeBSD.org>
# $FreeBSD$

PORTNAME=   cyphesis
PORTVERSION=    0.6.2
PORTREVISION=   2
CATEGORIES= net
MASTER_SITES=   SF/worldforge/${PORTNAME}%20%28server%29/${PORTVERSION}

MAINTAINER= oliver@FreeBSD.org
COMMENT=    Server for WorldForge games

LICENSE=    GPLv2

LIB_DEPENDS=    libAtlas-0.6.so:${PORTSDIR}/devel/atlas-devel \
        libvarconf-1.0.so:${PORTSDIR}/devel/varconf \
        libwfmath-1.0.so:${PORTSDIR}/math/wfmath \
        libmercator-0.3.so:${PORTSDIR}/devel/mercator \
        libskstream-0.3.so:${PORTSDIR}/net/skstream \
        libgcrypt.so:${PORTSDIR}/security/libgcrypt \
        libboost_regex.so:${PORTSDIR}/devel/boost-libs

CONFIGURE_ARGS= --with-python=${LOCALBASE}

GNU_CONFIGURE=  yes
USE_BZIP2=  yes
USES=       gmake pathfix pkgconfig compiler:c++11-lib
USE_LDCONFIG=   yes
USE_PGSQL=  yes
USE_PYTHON= 2

CFLAGS+=    -I${LOCALBASE}/include

MAN1=       cyclient.1 cycmd.1 cyphesis.1 cyphesis-tools.1 cyaddrules.1 \
        cyconvertrules.1 cydumprules.1 cyloadrules.1 cypasswd.1

OPTIONS_DEFINE= DOCS

.include <bsd.port.options.mk>

.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1000000
BROKEN=     Does not compile with clang
.endif

post-patch:
    @${REINPLACE_CMD} -e 's| install-dist_docDATA | |g' ${WRKSRC}/Makefile.in
    @${REINPLACE_CMD} -e 's| install-confbackupDATA | |g' \
        ${WRKSRC}/data/minimal/Makefile.in \
        ${WRKSRC}/data/mars/Makefile.in \
        ${WRKSRC}/data/Makefile.in
    @${REINPLACE_CMD} -e 's|-lpython|${PTHREAD_LIBS} &|' \
        ${WRKSRC}/configure
    @${FIND} ${WRKSRC} -name Makefile.in | ${XARGS} \
        ${REINPLACE_CMD} -e 's|$$(datadir)/cyphesis|${DATADIR}|g ; \
        s|confbackupdir = .*|confbackupdir = ${DOCSDIR}/conf|g'
    @${REINPLACE_CMD} -e 's|/bash|/sh|' ${WRKSRC}/scripts/extract_revision.sh
    @${REINPLACE_CMD} -e '1s|python|${LOCALBASE}/bin/${PYTHON_VERSION}|' ${WRKSRC}/scripts/gen_buildid.py
    @${REINPLACE_CMD} -e 's/#ifdef __APPLE__/#if defined(__APPLE__) || defined(__FreeBSD__)/g; \
        s/#ifndef __APPLE__/#if !defined(__APPLE__) \&\& !defined(__FreeBSD__)/g' \
        ${WRKSRC}/common/system.cpp \
        ${WRKSRC}/server/CommUnixListener.cpp

post-install:
.if ${PORT_OPTIONS:MDOCS}
    @${MKDIR} ${STAGEDIR}${DOCSDIR}
    @${MKDIR} ${STAGEDIR}${DOCSDIR}/conf
.for file in README COPYING AUTHORS THANKS NEWS ChangeLog TODO FIXME
    @${INSTALL_DATA} ${WRKSRC}/${file} ${STAGEDIR}${DOCSDIR}
.endfor
.for xmlfile in acorn.xml basic.xml cyphesis.vconf mason.xml werewolf.xml
    @${INSTALL_DATA} ${WRKSRC}/data/${xmlfile} ${STAGEDIR}${DOCSDIR}/conf
.endfor
.endif

.include <bsd.port.mk>