1 # Created by: Shaun Amott <shaun@inerd.com>
8 MASTER_SITES= http://www.ratbox.org/download/ \
9 http://www.ratbox.org/download/old/
12 MAINTAINER= moggie@elasticmind.net
13 COMMENT= Advanced, stable IRC daemon, used widely on EFnet ('testing' release)
17 CONFLICTS= ircd-ratbox-[0-9]* charybdis-[0-9]*
19 USES= libtool perl5 sqlite tar:bzip2
20 USE_RC_SUBR= ircd-ratbox
22 USE_LDCONFIG= ${PREFIX}/lib/ircd-ratbox
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}
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} \
43 INSTALL_TARGET= install-strip
45 PORTDOCS= [^i]*.txt README.* technical/[^i]*.txt Tao-of-IRC.*
47 #-- Options ------------------------------------------------------------
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
57 #----------------------------------------------------------------------
59 .include <bsd.port.options.mk>
61 .if ${PORT_OPTIONS:MOPENSSL}
63 CONFIGURE_ARGS+= --enable-openssl
65 CONFIGURE_ARGS+= --disable-openssl
68 .if ! ${PORT_OPTIONS:MIPV6}
69 CONFIGURE_ARGS+= --disable-ipv6
72 .if ! ${PORT_OPTIONS:MZIPLINKS}
73 CONFIGURE_ARGS+= --disable-zlib
76 .if ! ${PORT_OPTIONS:MSHARED_MODULES}
77 CONFIGURE_ARGS+= --disable-shared-modules
80 .if ${PORT_OPTIONS:MASSERT}
81 CONFIGURE_ARGS+= --enable-assert
83 CONFIGURE_ARGS+= --disable-assert
86 .if ${PORT_OPTIONS:MSMALL_NET}
87 CONFIGURE_ARGS+= --enable-small-net
90 .if ${PORT_OPTIONS:MSERVICES}
91 CONFIGURE_ARGS+= --enable-services
94 #-- User Configuration -------------------------------------------------
97 CONFIGURE_ARGS+= --with-nicklen=${NICKLEN}
100 #-----------------------------------------------------------------------
104 @${ECHO_MSG} "This port has additional options:"
105 @${ECHO_MSG} " NICKLEN [default 9, max 50] - Max nick length on server"
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"
117 @${ECHO_MSG} "Press CTRL+C now if you wish to set them."
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
135 #-- ircd-shortcut.pl ratbox-services commands --------------------------------------
137 .if defined(SERVER_NAME)
138 @${REINPLACE_CMD} -e "s#services.ircd-ratbox.org#${SERVER_NAME}#" \
139 ${WRKSRC}/contrib/ircd-shortcut.pl
141 .if defined(USER_SERV)
142 @${REINPLACE_CMD} -e "s#USERSERV#${USER_SERV}#" \
143 ${WRKSRC}/contrib/ircd-shortcut.pl
145 .if defined(CHAN_SERV)
146 @${REINPLACE_CMD} -e "s#CHANSERV#${CHAN_SERV}#" \
147 ${WRKSRC}/contrib/ircd-shortcut.pl
149 .if defined(NICK_SERV)
150 @${REINPLACE_CMD} -e "s#NICKSERV#${NICK_SERV}#" \
151 ${WRKSRC}/contrib/ircd-shortcut.pl
153 .if defined(ALIS_SERV)
154 @${REINPLACE_CMD} -e "s#ALIS#${ALIS_SERV}#" \
155 ${WRKSRC}/contrib/ircd-shortcut.pl
157 .if defined(OPER_BOT)
158 @${REINPLACE_CMD} -e "s#OPERBOT#${OPER_BOT}#" \
159 ${WRKSRC}/contrib/ircd-shortcut.pl
161 .if defined(OPER_SERV)
162 @${REINPLACE_CMD} -e "s#OPERSERV#${OPER_SERV}#" \
163 ${WRKSRC}/contrib/ircd-shortcut.pl
165 .if defined(JUPE_SERV)
166 @${REINPLACE_CMD} -e "s#JUPESERV#${JUPE_SERV}#" \
167 ${WRKSRC}/contrib/ircd-shortcut.pl
169 .if defined(GLOBAL_SERV)
170 @${REINPLACE_CMD} -e "s#GLOBAL#${GLOBAL_SERV}#" \
171 ${WRKSRC}/contrib/ircd-shortcut.pl
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
179 @cd ${INSTALL_WRKSRC}/contrib && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
180 ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS}
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
188 ${MKDIR} ${STAGEDIR}${ETCDIR}
189 ${MKDIR} ${STAGEDIR}${DATADIR}/help
190 ${MKDIR} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/modules
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
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
210 .include <bsd.port.mk>