aboutsummaryrefslogtreecommitdiffstats
path: root/irc/anope/Makefile
blob: 802fefa0b86c0313cf388877b8e63b286f505f4f (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
# New ports collection makefile for:    anope
# Date created:     13/04/2004
# Whom:         mat
#
# $FreeBSD$
#

PORTNAME=   anope
PORTVERSION=    1.6.2
CATEGORIES= irc
MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}

MAINTAINER= mat@FreeBSD.org
COMMENT=    A set of IRC services for IRC networks

USE_GMAKE=  yes
HAS_CONFIGURE=  yes
USE_REINPLACE=  yes
USE_PERL5_BUILD=    yes

# OPTIONS --{{{
OPTIONS=    MYSQL "Use mysql" ON \
        MODULES "Use modules" ON \
        MD5 "Encrypt passwords" ON \
        THREAD "Build with threads (needed for proxy detector)" ON \
        DREAM "DreamForge 4.6.7 " OFF \
        BAHAMUT "Bahamut 1.4.27 [or later]" OFF \
        UNREAL "UnrealIRCd 3.1.1 [or later]" ON \
        ULT2 "UltimateIRCd 2.8.2 [or later]" OFF \
        ULT3 "UltimateIRCd 3.0.0 [alpha26 or later]" OFF \
        HYB "Hybrid IRCd 7.0 [experimental]" OFF \
        VIA "ViagraIRCd 1.3.x [or later]" OFF \
        PTL "PTlink 6.15.0 [experimental]" OFF
# in that case, OPTIONS are ignored, no defaults
.if defined(PACKAGE_BUILDING) || defined(BATCH)
WITH_MYSQL= yes
WITH_MODULES=   yes
WITH_MD5=   yes
WITH_THREAD=    yes
WITH_UNREAL=    yes
.endif
#}}}

ANOPEBIN?=  ${PREFIX}/libexec/anope
ANOPEDAT?=  ${DATADIR}
ANOPEMOD?=  ${PREFIX}/lib/anope/
ANOPEUMASK?=    077

.include <bsd.port.pre.mk>

.if ${ARCH} == "amd64"
BROKEN=     "Does not build on amd64 (shared libraries must be compiled with -fPIC)"
.endif

.if defined(WITH_MYSQL)
USE_MYSQL=  yes
.endif

post-patch:
    @${REINPLACE_CMD} -e "s/-D_REENTRANT/${PTHREAD_CFLAGS}/" \
        -e "s/-pthread/${PTHREAD_LIBS}/" \
        ${WRKSRC}/configure

pre-configure: #--{{{
    @${ECHO_CMD} PROGRAM="anope" > ${WRKSRC}/config.cache
    @${ECHO_CMD} BINDEST="${ANOPEBIN}" >> ${WRKSRC}/config.cache
    @${ECHO_CMD} DATDEST="${ANOPEDAT}" >> ${WRKSRC}/config.cache
    @${ECHO_CMD} UMASK="${ANOPEUMASK}" >> ${WRKSRC}/config.cache
.if defined(WITH_MYSQL)
    @${ECHO_CMD} MYSQL="USE_MYSQL" >> ${WRKSRC}/config.cache
    @${ECHO_CMD} RDB="USE_RDB" >> ${WRKSRC}/config.cache
.endif
.if defined(WITH_MODULES)
    @${ECHO_CMD} USE_MODULES="USE_MODULES" >> ${WRKSRC}/config.cache
    @${ECHO_CMD} MODULE_PATH="${ANOPEMOD}" >> ${WRKSRC}/config.cache
.endif
.if defined(WITH_MD5)
    @${ECHO_CMD} ENCRYPTION="ENCRYPT_MD5" >> ${WRKSRC}/config.cache
.endif
.if defined(WITH_THREAD)
    @${ECHO_CMD} THREAD="USE_THREADS" >> ${WRKSRC}/config.cache
.endif
.if defined(WITH_DREAM)
    @${ECHO_CMD} IRCTYPE=1 >> ${WRKSRC}/config.cache
    @${ECHO_CMD} IRCTYPE_DEF="IRC_DREAMFORGE" >> ${WRKSRC}/config.cache
.elif defined(WITH_BAHAMUT)
    @${ECHO_CMD} IRCTYPE=2 >> ${WRKSRC}/config.cache
    @${ECHO_CMD} IRCTYPE_DEF="IRC_BAHAMUT" >> ${WRKSRC}/config.cache
.elif defined(WITH_UNREAL)
    @${ECHO_CMD} IRCTYPE=3 >> ${WRKSRC}/config.cache
    @${ECHO_CMD} IRCTYPE_DEF="IRC_DREAMFORGE" >> ${WRKSRC}/config.cache
    @${ECHO_CMD} IRCTYPE_DEF2="IRC_UNREAL" >> ${WRKSRC}/config.cache
.elif defined(WITH_ULT2)
    @${ECHO_CMD} IRCTYPE=4 >> ${WRKSRC}/config.cache
    @${ECHO_CMD} IRCTYPE_DEF="IRC_DREAMFORGE" >> ${WRKSRC}/config.cache
    @${ECHO_CMD} IRCTYPE_DEF2="IRC_ULTIMATE" >> ${WRKSRC}/config.cache
.elif defined(WITH_ULT3)
    @${ECHO_CMD} IRCTYPE=5 >> ${WRKSRC}/config.cache
    @${ECHO_CMD} IRCTYPE_DEF="IRC_BAHAMUT" >> ${WRKSRC}/config.cache
    @${ECHO_CMD} IRCTYPE_DEF2="IRC_ULTIMATE3" >> ${WRKSRC}/config.cache
.elif defined(WITH_HYB)
    @${ECHO_CMD} IRCTYPE=6 >> ${WRKSRC}/config.cache
    @${ECHO_CMD} IRCTYPE_DEF="IRC_HYBRID" >> ${WRKSRC}/config.cache
.elif defined(WITH_VIA)
    @${ECHO_CMD} IRCTYPE=7 >> ${WRKSRC}/config.cache
    @${ECHO_CMD} IRCTYPE_DEF="IRC_BAHAMUT" >> ${WRKSRC}/config.cache
    @${ECHO_CMD} IRCTYPE_DEF2="IRC_VIAGRA" >> ${WRKSRC}/config.cache
.elif defined(WITH_PTL)
    @${ECHO_CMD} IRCTYPE=8 >> ${WRKSRC}/config.cache
    @${ECHO_CMD} IRCTYPE_DEF="IRC_PTLINK" >> ${WRKSRC}/config.cache
.endif
#}}}

pre-install:
    @${MKDIR} ${ANOPEBIN}
    @${MKDIR} ${ANOPEDAT}
    @${MKDIR} ${ANOPEMOD}

.include <bsd.port.post.mk>