aboutsummaryrefslogtreecommitdiffstats
path: root/irc/anope/Makefile
blob: fedbd8e3ac39fee552a63fe17ffe8973f9d6ef59 (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
145
146
147
148
149
150
151
152
153
# Created by: mat
# $FreeBSD$

PORTNAME=   anope
PORTVERSION=    2.0.2
PORTREVISION=   2
CATEGORIES= irc

MAINTAINER= feld@FreeBSD.org
COMMENT=    Set of IRC services for IRC networks

LICENSE=    GPLv2

USES=       cmake:outsource shebangfix
CMAKE_ARGS+=    -DINSTDIR:STRING="${LOCALBASE}/anope"
CPPFLAGS+=  "-I${LOCALBASE}/include"
LDFLAGS+=   "-L${LOCALBASE}/lib"
SHEBANG_FILES=  ${WRKSRC}/src/tools/*.sh

USE_GITHUB= yes

USE_RC_SUBR=    anope

SUB_FILES=  pkg-message

OPTIONS_DEFINE= GNUTLS LDAP MYSQL NLS OPENSSL PCRE POSIX SASL SQLITE STATS TRE
OPTIONS_DEFAULT=    MYSQL OPENSSL POSIX
POSIX_DESC= POSIX Regex Module
STATS_DESC= Channel Statistics Module
TRE_DESC=   Tre Regex Module

NLS_USES=   gettext

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MGNUTLS}
PLIST_SUB+= GNUTLS=""
LIB_DEPENDS+=   libgnutls.so:${PORTSDIR}/security/gnutls
.else
PLIST_SUB+= GNUTLS="@comment "
.endif

.if ${PORT_OPTIONS:MLDAP}
PLIST_SUB+= LDAP=""
USE_OPENLDAP=   yes
.else
PLIST_SUB+= LDAP="@comment "
.endif

.if ${PORT_OPTIONS:MMYSQL}
PLIST_SUB+= MYSQL=""
USE_MYSQL=  yes
.else
PLIST_SUB+= MYSQL="@comment "
.endif

.if ${PORT_OPTIONS:MOPENSSL}
PLIST_SUB+= OPENSSL=""
OPENSSL_USE=    openssl=yes
.else
PLIST_SUB+= OPENSSL="@comment "
.endif

.if ${PORT_OPTIONS:MPCRE}
PLIST_SUB+= PCRE=""
LIB_DEPENDS+=   libpcre.so:${PORTSDIR}/devel/pcre
.else
PLIST_SUB+= PCRE="@comment "
.endif

.if ${PORT_OPTIONS:MPOSIX}
PLIST_SUB+= POSIX=""
.else
PLIST_SUB+= POSIX="@comment "
.endif

.if ${PORT_OPTIONS:MSASL}
PLIST_SUB+= SASL=""
LIB_DEPENDS+=   libsasl2.so:${PORTSDIR}/security/cyrus-sasl2
.else
PLIST_SUB+= SASL="@comment "
.endif

.if ${PORT_OPTIONS:MSQLITE}
PLIST_SUB+= SQLITE=""
USES+=      sqlite
.else
PLIST_SUB+= SQLITE="@comment "
.endif

.if ${PORT_OPTIONS:MSTATS}
PLIST_SUB+= STATS=""
.else
PLIST_SUB+= STATS="@comment "
.endif

.if ${PORT_OPTIONS:MTRE}
PLIST_SUB+= TRE=""
LIB_DEPENDS+=   libtre.so:${PORTSDIR}/textproc/libtre
.else
PLIST_SUB+= TRE="@comment "
.endif

.include <bsd.port.pre.mk>

# XXX Add here other arch which needs -fPIC :-)
.if ${ARCH} == "amd64" || ${ARCH} == "ia64"
CFLAGS+=    -fPIC
.endif

post-patch:
.if ${PORT_OPTIONS:MGNUTLS}
    ${LN} -s ${WRKSRC}/modules/extra/m_ssl_gnutls.cpp ${WRKSRC}/modules/
.endif
.if ${PORT_OPTIONS:MLDAP}
    ${LN} -s ${WRKSRC}/modules/extra/m_ldap.cpp ${WRKSRC}/modules/
    ${LN} -s ${WRKSRC}/modules/extra/m_ldap_authentication.cpp ${WRKSRC}/modules/
    ${LN} -s ${WRKSRC}/modules/extra/m_ldap_oper.cpp ${WRKSRC}/modules/
.endif
.if ${PORT_OPTIONS:MMYSQL}
    ${LN} -s ${WRKSRC}/modules/extra/m_mysql.cpp ${WRKSRC}/modules/
    ${LN} -s ${WRKSRC}/modules/extra/m_sql_authentication.cpp ${WRKSRC}/modules/
    ${LN} -s ${WRKSRC}/modules/extra/m_sql_log.cpp ${WRKSRC}/modules/
    ${LN} -s ${WRKSRC}/modules/extra/m_sql_oper.cpp ${WRKSRC}/modules/
.endif
.if ${PORT_OPTIONS:MOPENSSL}
    ${LN} -s ${WRKSRC}/modules/extra/m_ssl_openssl.cpp ${WRKSRC}/modules/
.endif
.if ${PORT_OPTIONS:MSQLITE}
    ${LN} -s ${WRKSRC}/modules/extra/m_sqlite.cpp ${WRKSRC}/modules/
.endif
.if ${PORT_OPTIONS:MPCRE}
    ${LN} -s ${WRKSRC}/modules/extra/m_regex_pcre.cpp ${WRKSRC}/modules/
.endif
.if ${PORT_OPTIONS:MPOSIX}
    ${LN} -s ${WRKSRC}/modules/extra/m_regex_posix.cpp ${WRKSRC}/modules/
.endif
.if ${PORT_OPTIONS:MSASL}
    ${LN} -s ${WRKSRC}/modules/extra/m_sasl_dh-aes.cpp ${WRKSRC}/modules/
    ${LN} -s ${WRKSRC}/modules/extra/m_sasl_dh-blowfish.cpp ${WRKSRC}/modules/
.endif
.if ${PORT_OPTIONS:MSTATS}
    ${LN} -s ${WRKSRC}/modules/extra/stats ${WRKSRC}/modules/
.endif
.if ${PORT_OPTIONS:MTRE}
    ${LN} -s ${WRKSRC}/modules/extra/m_regex_tre.cpp ${WRKSRC}/modules/
.endif

post-install:
    ${MKDIR} ${STAGEDIR}/${LOCALBASE}/anope/data/backups
    ${MKDIR} ${STAGEDIR}/${LOCALBASE}/anope/logs

.include <bsd.port.post.mk>