Tweak irc/ircd-ratbox-devel version 3.0.7_3
[dports.git] / irc / ircd-ratbox-devel / Makefile
1 # Created by: Shaun Amott <shaun@inerd.com>
2 # $FreeBSD$
3
4 PORTNAME=       ircd-ratbox
5 PORTVERSION=    3.0.7
6 PORTREVISION=   3
7 CATEGORIES=     irc ipv6
8 MASTER_SITES=   http://www.ratbox.org/download/                         \
9                 http://www.ratbox.org/download/old/
10 PKGNAMESUFFIX=  -devel
11
12 MAINTAINER=     moggie@elasticmind.net
13 COMMENT=        Advanced, stable IRC daemon, used widely on EFnet ('testing' release)
14
15 LICENSE=        GPLv2
16
17 CONFLICTS=      ircd-ratbox-[0-9]* charybdis-[0-9]*
18
19 USES=           libtool perl5 sqlite tar:bzip2
20 USE_RC_SUBR=    ircd-ratbox
21 USE_PERL5=      build
22 USE_LDCONFIG=   ${PREFIX}/lib/ircd-ratbox
23
24 USERS=          ircd
25 GROUPS=         ${USERS}
26
27 LOGDIR?=        /var/log/${PORTNAME}
28 RUNDIR?=        /var/run/${PORTNAME}
29 DBDIR?=         /var/db/${PORTNAME}
30 SUB_FILES=      pkg-message
31 PLIST_SUB=      LOGDIR=${LOGDIR} RUNDIR=${RUNDIR} DBDIR=${DBDIR}
32 SUB_LIST=       LOGDIR=${LOGDIR} RUNDIR=${RUNDIR} DBDIR=${DBDIR}
33
34 GNU_CONFIGURE=  yes
35 CONFIGURE_ARGS= --with-confdir=${PREFIX}/etc/${PORTNAME}                \
36                 --with-logdir=/var/log/${PORTNAME}                      \
37                 --with-moduledir=${PREFIX}/lib/${PORTNAME}/modules      \
38                 --libexecdir=${PREFIX}/libexec                          \
39                 --with-helpdir=${DATADIR}/help                          \
40                 --libdir=${PREFIX}/lib/${PORTNAME}                      \
41                 --with-sqlite3=${LOCALBASE}                             \
42                 --disable-backups
43 INSTALL_TARGET= install-strip
44
45 PORTDOCS=       [^i]*.txt README.* technical/[^i]*.txt Tao-of-IRC.*
46
47 #-- Options ------------------------------------------------------------
48
49 OPTIONS_DEFINE= OPENSSL IPV6 ZIPLINKS SHARED_MODULES ASSERT SMALL_NET SERVICES DOCS
50 OPTIONS_DEFAULT=        OPENSSL ZIPLINKS SHARED_MODULES
51 ZIPLINKS_DESC=          ziplinks support
52 SHARED_MODULES_DESC=    shared modules support
53 ASSERT_DESC=            Enable debugging code
54 SMALL_NET_DESC=         Tune server for small networks
55 SERVICES_DESC=          ratbox-services compatibility code
56
57 #----------------------------------------------------------------------
58
59 .include <bsd.port.options.mk>
60
61 .if ${PORT_OPTIONS:MOPENSSL}
62 USE_OPENSSL=            yes
63 CONFIGURE_ARGS+=        --enable-openssl
64 .else
65 CONFIGURE_ARGS+=        --disable-openssl
66 .endif
67
68 .if ! ${PORT_OPTIONS:MIPV6}
69 CONFIGURE_ARGS+=        --disable-ipv6
70 .endif
71
72 .if ! ${PORT_OPTIONS:MZIPLINKS}
73 CONFIGURE_ARGS+=        --disable-zlib
74 .endif
75
76 .if ! ${PORT_OPTIONS:MSHARED_MODULES}
77 CONFIGURE_ARGS+=        --disable-shared-modules
78 .endif
79
80 .if ${PORT_OPTIONS:MASSERT}
81 CONFIGURE_ARGS+=        --enable-assert
82 .else
83 CONFIGURE_ARGS+=        --disable-assert
84 .endif
85
86 .if ${PORT_OPTIONS:MSMALL_NET}
87 CONFIGURE_ARGS+=        --enable-small-net
88 .endif
89
90 .if ${PORT_OPTIONS:MSERVICES}
91 CONFIGURE_ARGS+=        --enable-services
92 .endif
93
94 #-- User Configuration -------------------------------------------------
95
96 .if defined(NICKLEN)
97 CONFIGURE_ARGS+=        --with-nicklen=${NICKLEN}
98 .endif
99
100 #-----------------------------------------------------------------------
101
102 pre-configure:
103         @${ECHO_MSG} ""
104         @${ECHO_MSG} "This port has additional options:"
105         @${ECHO_MSG} "    NICKLEN     [default 9, max 50]    - Max nick length on server"
106         @${ECHO_MSG} ""
107         @${ECHO_MSG} "    SERVER_NAME [default 'services.ircd-ratbox.org'] - Name of services"
108         @${ECHO_MSG} "    USER_SERV   [default 'USERSERV'] - Name of user registration service"
109         @${ECHO_MSG} "    CHAN_SERV   [default 'CHANSERV'] - Name of channel registration serv'"
110         @${ECHO_MSG} "    NICK_SERV   [default 'NICKSERV'] - Name of nickname registration serv'"
111         @${ECHO_MSG} "    ALIS_SERV   [default 'ALIS'] - Name of channel list service"
112         @${ECHO_MSG} "    OPER_BOT    [default 'OPERBOT'] - Name of operbot service"
113         @${ECHO_MSG} "    OPER_SERV   [default 'OPERSERV'] - Name of oper command service"
114         @${ECHO_MSG} "    JUPE_SERV   [default 'JUPESERV'] - Name of jupe service"
115         @${ECHO_MSG} "    GLOBAL_SERV [default 'GLOBAL'] - Name of global announce service"
116         @${ECHO_MSG} ""
117         @${ECHO_MSG} "Press CTRL+C now if you wish to set them."
118         @${ECHO_MSG} ""
119
120 pre-build:
121         @${REINPLACE_CMD} -e "s#-O2##" ${WRKSRC}/configure
122         @${REINPLACE_CMD} -e "s#%%PREFIX%%#${PREFIX}#g"         \
123                           ${WRKSRC}/doc/example.conf            \
124                           ${WRKSRC}/doc/example.efnet.conf
125         @${REINPLACE_CMD} -e "s#%%LOGDIR%%#${LOGDIR}#g"         \
126                                 ${WRKSRC}/doc/example.conf      \
127                                 ${WRKSRC}/doc/example.efnet.conf
128         @${REINPLACE_CMD} -e "s#%%DBDIR%%#${DBDIR}#g"           \
129                                 ${WRKSRC}/doc/example.conf      \
130                                 ${WRKSRC}/doc/example.efnet.conf
131         @${REINPLACE_CMD} -e "s#%%RUNDIR%%#${RUNDIR}#g" ${WRKSRC}/include/config.h
132         @${REINPLACE_CMD} -e "s#%%DBDIR%%#${DBDIR}#g" ${WRKSRC}/include/config.h
133         @${REINPLACE_CMD} -e "s#%%WRKSRC%%#${WRKSRC}#g" ${WRKSRC}/contrib/ircd-shortcut.pl
134
135 #-- ircd-shortcut.pl ratbox-services commands --------------------------------------
136
137 .if defined(SERVER_NAME)
138         @${REINPLACE_CMD} -e "s#services.ircd-ratbox.org#${SERVER_NAME}#"       \
139         ${WRKSRC}/contrib/ircd-shortcut.pl
140 .endif
141 .if defined(USER_SERV)
142         @${REINPLACE_CMD} -e "s#USERSERV#${USER_SERV}#" \
143         ${WRKSRC}/contrib/ircd-shortcut.pl
144 .endif
145 .if defined(CHAN_SERV)
146         @${REINPLACE_CMD} -e "s#CHANSERV#${CHAN_SERV}#" \
147         ${WRKSRC}/contrib/ircd-shortcut.pl
148 .endif
149 .if defined(NICK_SERV)
150         @${REINPLACE_CMD} -e "s#NICKSERV#${NICK_SERV}#" \
151         ${WRKSRC}/contrib/ircd-shortcut.pl
152 .endif
153 .if defined(ALIS_SERV)
154         @${REINPLACE_CMD} -e "s#ALIS#${ALIS_SERV}#"     \
155         ${WRKSRC}/contrib/ircd-shortcut.pl
156 .endif
157 .if defined(OPER_BOT)
158         @${REINPLACE_CMD} -e "s#OPERBOT#${OPER_BOT}#"   \
159         ${WRKSRC}/contrib/ircd-shortcut.pl
160 .endif
161 .if defined(OPER_SERV)
162         @${REINPLACE_CMD} -e "s#OPERSERV#${OPER_SERV}#" \
163         ${WRKSRC}/contrib/ircd-shortcut.pl
164 .endif
165 .if defined(JUPE_SERV)
166         @${REINPLACE_CMD} -e "s#JUPESERV#${JUPE_SERV}#" \
167         ${WRKSRC}/contrib/ircd-shortcut.pl
168 .endif
169 .if defined(GLOBAL_SERV)
170         @${REINPLACE_CMD} -e "s#GLOBAL#${GLOBAL_SERV}#" \
171         ${WRKSRC}/contrib/ircd-shortcut.pl
172 .endif
173
174 #------ Execute ircd-shortcut perl script to generate the .c file. -----
175         @${ECHO_MSG} "Executing ircd-shortcut.pl for ircd-shortcuts generation."
176         ${PERL} ${WRKSRC}/contrib/ircd-shortcut.pl
177
178 post-build:
179         @cd ${INSTALL_WRKSRC}/contrib && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
180                 ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS}
181
182 # ----- Need to build the m_rsshortcut.so module for ircd-shortcut.pl ----
183         @${ECHO_MSG} "Building m_rsshortcut.la for ircd-shortcuts."
184         @cd ${INSTALL_WRKSRC}/contrib && ${SETENV} ${MAKE_ENV} ${MAKE} \
185                 ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} m_rsshortcut.la
186
187 pre-install:
188         ${MKDIR} ${STAGEDIR}${ETCDIR}
189         ${MKDIR} ${STAGEDIR}${DATADIR}/help
190         ${MKDIR} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/modules
191
192 post-install:
193         ${MKDIR} ${STAGEDIR}${RUNDIR}
194         ${MKDIR} ${STAGEDIR}${DBDIR}
195         ${MKDIR} ${STAGEDIR}${LOGDIR}
196         ${MKDIR} ${STAGEDIR}${DOCSDIR}
197         cd ${WRKSRC}/doc && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
198         @cd ${INSTALL_WRKSRC}/contrib && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
199                 ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET}
200         ${INSTALL_DATA} ${WRKSRC}/doc/ircd.motd ${STAGEDIR}${PREFIX}/etc/${PORTNAME}/ircd.motd.sample
201         ${INSTALL_DATA} ${WRKSRC}/doc/example.conf ${STAGEDIR}${PREFIX}/etc/${PORTNAME}/ircd.conf.sample
202         ${INSTALL_DATA} ${WRKSRC}/doc/example.efnet.conf ${STAGEDIR}${PREFIX}/etc/${PORTNAME}/ircd-efnet.conf.sample
203         ${INSTALL_DATA} ${WRKSRC}/doc/genssl.sh ${STAGEDIR}${PREFIX}/etc/${PORTNAME}/genssl.sh
204
205 # ----- We need to install the shortcut.pl module ----
206         @${ECHO_MSG} "Executing install-mod.sh for ircd-shortcuts module installation."
207         ${SH} ${WRKSRC}/install-mod.sh ${WRKSRC}/contrib/m_rsshortcut.la \
208                 ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/modules/contrib
209
210 .include <bsd.port.mk>