aboutsummaryrefslogtreecommitdiffstats
path: root/irc/unreal/Makefile
blob: abafc5f1fda2dc591923b0a9cba9a8d09d2f6ef4 (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
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
137
138
139
140
141
142
143
144
# Created by: Gerrit Beine (<tux@pinguru.net>)
# $FreeBSD$

PORTNAME=   Unreal
PORTVERSION=    3.2.10.5
PORTREVISION=   1
CATEGORIES= irc ipv6
MASTER_SITES=   http://www.unrealircd.com/downloads/
DISTNAME=   ${PORTNAME}${PORTVERSION}

MAINTAINER= mat@FreeBSD.org
COMMENT=    Unreal - the next generation ircd

LICENSE=    GPLv2
LICENSE_FILE=   ${WRKSRC}/LICENSE

LIB_DEPENDS=    libcares.so:dns/c-ares

WRKSRC=     ${WRKDIR}/${PORTNAME}${PORTVERSION}

MODULESDIR= ${PREFIX}/lib/${PORTNAME}
CONFIGDIR=  ${PREFIX}/etc/${PORTNAME}
RUNDIR=     /var/run/ircd
LOGDIR=     /var/log/ircd

HAS_CONFIGURE=  yes
USE_RC_SUBR=    unrealircd

USERS=      ircd
GROUPS=     ircd
CPE_VENDOR= unrealircd
CPE_PRODUCT=    unrealircd

USES=       pkgconfig cpe

SUB_LIST+=  RUNDIR=${RUNDIR}
SUB_LIST+=  USERS=${USERS}
SUB_LIST+=  GROUPS=${GROUPS}

CPPFLAGS+=  -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib
CFLAGS+=    ${CPPFLAGS}
CONFIGURE_ARGS= --with-listen=5 \
        --with-dpath=${CONFIGDIR} \
        --with-spath=${PREFIX}/libexec/ircd \
        --with-nick-history=2000 \
        --with-sendq=3000000 \
        --with-bufferpool=18 \
        --with-permissions=0600 \
        --with-fd-setsize=1024 \
        --with-system-cares \
        --enable-dynamic-linking

OPTIONS_DEFINE= HUB NOSPOOF ZIPLINKS SSL IPV6 PREFIXAQ REMOTE DOCS
OPTIONS_DEFAULT=    HUB SSL
HUB_DESC=   Configure as a hub (otherwise configure as a leaf)
NOSPOOF_DESC=   Enable anti-spoof protection
ZIPLINKS_DESC=  Enable ziplinks support
PREFIXAQ_DESC=  Enable prefixes for chanadmin and chanowner
REMOTE_DESC=    Enable remote includes

PORTDOCS=   *
DOCS=       Donation doc/Authors doc/coding-guidelines \
        doc/example.conf doc/tao.of.irc \
        doc/translations.txt doc/unreal32docs.html \
        doc/technical/005.txt doc/technical/base64.txt \
        doc/technical/protoctl.txt doc/technical/token.txt \
        doc/technical/vl.txt

HUB_CONFIGURE_ENABLE=   hub
NOSPOOF_CONFIGURE_ENABLE=   nospoof
ZIPLINKS_CONFIGURE_ENABLE=  ziplinks
IPV6_CONFIGURE_ENABLE=  inet6
SSL_CONFIGURE_ENABLE=   ssl
SSL_USE=    OPENSSL=yes
REMOTE_LIB_DEPENDS= libcurl.so:ftp/curl
REMOTE_CONFIGURE_ENABLE=    --enable-libcurl=${LOCALBASE}
PREFIXAQ_CONFIGURE_ENABLE=  prefixaq

SQLMOD=     ${PORTNAME}/SQLMod.tar.gz

.if exists(${DISTDIR}/${SQLMOD})
USE_MYSQL=  yes
WITH_SQLMOD=    yes
MAKE_ARGS=  all custommodule MODULEFILE=m_sqlmod
PLIST_SUB+= SQLMOD=""
.else
PLIST_SUB+= SQLMOD="@comment "
.endif

post-extract:
.if defined(WITH_SQLMOD)
    @${TAR} xfz ${DISTDIR}/${SQLMOD} -C ${WRKSRC}
    @${MV} ${WRKSRC}/SQLMod* ${WRKSRC}/SQLMod
    @${CP} -r ${WRKSRC}/SQLMod/m_sqlmod.c ${WRKSRC}/src/modules
.endif

post-patch:
    @${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX}," \
        -e "s,%%RUNDIR%%,${RUNDIR}," \
        -e "s,%%USERS%%,${USERS}," \
        -e "s,%%GROUPS%%,${GROUPS}," \
        -e "s,%%LOGDIR%%,${LOGDIR}," ${WRKSRC}/include/config.h
    @${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX}," \
        -e "s,%%LOGDIR%%,${LOGDIR}," ${WRKSRC}/doc/example.conf
    @${REINPLACE_CMD} -e "s,%%RUNDIR%%,${RUNDIR}," ${WRKSRC}/src/ircd.c
    @${REINPLACE_CMD} -e "s,%%RUNDIR%%,${RUNDIR}," ${WRKSRC}/src/modules.c
    @${REINPLACE_CMD} -e "s,%%RUNDIR%%,${RUNDIR}," ${WRKSRC}/src/s_conf.c
    @${REINPLACE_CMD} -e "s,%%RUNDIR%%,${RUNDIR}," ${WRKSRC}/src/url.c
.if defined(WITH_SQLMOD)
    @${PATCH} -d ${WRKSRC} < ${WRKSRC}/SQLMod/patch
.endif
    @${REINPLACE_CMD} -e "/Your system does not support IPv6/ s|as_fn_error|echo|" ${WRKSRC}/configure

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/src/ircd ${STAGEDIR}${PREFIX}/libexec/ircd
    ${MKDIR} ${STAGEDIR}${MODULESDIR}
    ${MKDIR} ${STAGEDIR}${CONFIGDIR} || true
    ${MKDIR} ${STAGEDIR}${CONFIGDIR}/aliases || true
    ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/aliases
    ${MKDIR} ${STAGEDIR}${RUNDIR}/tmp
    ${MKDIR} ${STAGEDIR}${LOGDIR}
    ${TOUCH} ${STAGEDIR}${CONFIGDIR}/ircd.motd
    ${TOUCH} ${STAGEDIR}${CONFIGDIR}/ircd.rules
    ${INSTALL_DATA} ${WRKSRC}/badwords.*.conf ${STAGEDIR}${EXAMPLESDIR}
    ${INSTALL_DATA} ${WRKSRC}/help.conf ${STAGEDIR}${EXAMPLESDIR}
    ${INSTALL_DATA} ${WRKSRC}/spamfilter.conf ${STAGEDIR}${EXAMPLESDIR}
    ${INSTALL_DATA} ${WRKSRC}/doc/example.conf ${STAGEDIR}${EXAMPLESDIR}/unrealircd.conf
    ${INSTALL_DATA} ${WRKSRC}/aliases/*.conf ${STAGEDIR}${EXAMPLESDIR}/aliases
    ${INSTALL} ${WRKSRC}/src/modules/*.so ${STAGEDIR}${MODULESDIR}
    ${MKDIR} ${STAGEDIR}${DOCSDIR}
.for file in ${DOCS}
    ${INSTALL_DATA} ${WRKSRC}/${file} ${STAGEDIR}${DOCSDIR}
.endfor

post-install:
.if defined(WITH_SQLMOD)
    @${CP} ${WRKSRC}/SQLMod/sample.conf ${STAGEDIR}${CONFIGDIR}/m_sqlmod.conf
    @${CP} ${WRKSRC}/SQLMod/Changes ${STAGEDIR}${DOCSDIR}/Changes.sqlmod
    @${CP} ${WRKSRC}/SQLMod/README ${STAGEDIR}${DOCSDIR}/README.sqlmod
    @${CP} ${WRKSRC}/SQLMod/LICENSE ${STAGEDIR}${DOCSDIR}/LICENSE.sqlmod
.endif

.include <bsd.port.mk>