1 # Created by: Shaun Amott <shaun@inerd.com>
7 MASTER_SITES= http://www.ratbox.org/download/ \
8 http://www.ratbox.org/download/old/
11 MAINTAINER= moggie@elasticmind.net
12 COMMENT= Advanced, stable IRC daemon, used widely on EFnet ('testing' release)
16 CONFLICTS= ircd-ratbox-[0-9]* charybdis-[0-9]*
21 USE_RC_SUBR= ircd-ratbox
24 USE_LDCONFIG= ${PREFIX}/lib/ircd-ratbox
29 LOGDIR?= /var/log/${PORTNAME}
30 RUNDIR?= /var/run/${PORTNAME}
31 DBDIR?= /var/db/${PORTNAME}
32 SUB_FILES= pkg-message pkg-install
33 PLIST_SUB= LOGDIR=${LOGDIR} RUNDIR=${RUNDIR} DBDIR=${DBDIR}
34 SUB_LIST= LOGDIR=${LOGDIR} RUNDIR=${RUNDIR} DBDIR=${DBDIR}
37 CONFIGURE_ARGS= --with-confdir=${PREFIX}/etc/${PORTNAME} \
38 --with-logdir=/var/log/${PORTNAME} \
39 --with-moduledir=${PREFIX}/lib/${PORTNAME}/modules \
40 --libexecdir=${PREFIX}/libexec \
41 --with-helpdir=${DATADIR}/help \
42 --libdir=${PREFIX}/lib/${PORTNAME} \
43 --with-sqlite3=${LOCALBASE} \
46 PORTDOCS= [^i]*.txt README.* technical/[^i]*.txt Tao-of-IRC.*
48 #-- Options ------------------------------------------------------------
50 OPTIONS_DEFINE= OPENSSL IPV6 ZIPLINKS SHARED_MODULES ASSERT SMALL_NET SERVICES DOCS
51 OPTIONS_DEFAULT= OPENSSL ZIPLINKS SHARED_MODULES
52 ZIPLINKS_DESC= ziplinks support
53 SHARED_MODULES_DESC= shared modules support
54 ASSERT_DESC= Enable debugging code
55 SMALL_NET_DESC= Tune server for small networks
56 SERVICES_DESC= ratbox-services compatibility code
58 #----------------------------------------------------------------------
61 .include <bsd.port.options.mk>
63 .if ${PORT_OPTIONS:MOPENSSL}
65 CONFIGURE_ARGS+= --enable-openssl
67 CONFIGURE_ARGS+= --disable-openssl
70 .if ! ${PORT_OPTIONS:MIPV6}
71 CONFIGURE_ARGS+= --disable-ipv6
74 .if ! ${PORT_OPTIONS:MZIPLINKS}
75 CONFIGURE_ARGS+= --disable-zlib
78 .if ! ${PORT_OPTIONS:MSHARED_MODULES}
79 CONFIGURE_ARGS+= --disable-shared-modules
82 .if ${PORT_OPTIONS:MASSERT}
83 CONFIGURE_ARGS+= --enable-assert
85 CONFIGURE_ARGS+= --disable-assert
88 .if ${PORT_OPTIONS:MSMALL_NET}
89 CONFIGURE_ARGS+= --enable-small-net
92 .if ${PORT_OPTIONS:MSERVICES}
93 CONFIGURE_ARGS+= --enable-services
96 #-- User Configuration -------------------------------------------------
99 CONFIGURE_ARGS+= --with-nicklen=${NICKLEN}
102 #-----------------------------------------------------------------------
106 @${ECHO_MSG} "This port has additional options:"
107 @${ECHO_MSG} " NICKLEN [default 9, max 50] - Max nick length on server"
109 @${ECHO_MSG} " SERVER_NAME [default 'services.ircd-ratbox.org'] - Name of services"
110 @${ECHO_MSG} " USER_SERV [default 'USERSERV'] - Name of user registration service"
111 @${ECHO_MSG} " CHAN_SERV [default 'CHANSERV'] - Name of channel registration serv'"
112 @${ECHO_MSG} " NICK_SERV [default 'NICKSERV'] - Name of nickname registration serv'"
113 @${ECHO_MSG} " ALIS_SERV [default 'ALIS'] - Name of channel list service"
114 @${ECHO_MSG} " OPER_BOT [default 'OPERBOT'] - Name of operbot service"
115 @${ECHO_MSG} " OPER_SERV [default 'OPERSERV'] - Name of oper command service"
116 @${ECHO_MSG} " JUPE_SERV [default 'JUPESERV'] - Name of jupe service"
117 @${ECHO_MSG} " GLOBAL_SERV [default 'GLOBAL'] - Name of global announce service"
119 @${ECHO_MSG} "Press CTRL+C now if you wish to set them."
123 @${REINPLACE_CMD} -e "s#-O2##" ${WRKSRC}/configure
124 @${REINPLACE_CMD} -e "s#%%PREFIX%%#${PREFIX}#g" \
125 ${WRKSRC}/doc/example.conf \
126 ${WRKSRC}/doc/example.efnet.conf
127 @${REINPLACE_CMD} -e "s#%%LOGDIR%%#${LOGDIR}#g" \
128 ${WRKSRC}/doc/example.conf \
129 ${WRKSRC}/doc/example.efnet.conf
130 @${REINPLACE_CMD} -e "s#%%DBDIR%%#${DBDIR}#g" \
131 ${WRKSRC}/doc/example.conf \
132 ${WRKSRC}/doc/example.efnet.conf
133 @${REINPLACE_CMD} -e "s#%%RUNDIR%%#${RUNDIR}#g" ${WRKSRC}/include/config.h
134 @${REINPLACE_CMD} -e "s#%%DBDIR%%#${DBDIR}#g" ${WRKSRC}/include/config.h
135 @${REINPLACE_CMD} -e "s#%%WRKSRC%%#${WRKSRC}#g" ${WRKSRC}/contrib/ircd-shortcut.pl
137 #-- ircd-shortcut.pl ratbox-services commands --------------------------------------
139 .if defined(SERVER_NAME)
140 @${REINPLACE_CMD} -e "s#services.ircd-ratbox.org#${SERVER_NAME}#" \
141 ${WRKSRC}/contrib/ircd-shortcut.pl
143 .if defined(USER_SERV)
144 @${REINPLACE_CMD} -e "s#USERSERV#${USER_SERV}#" \
145 ${WRKSRC}/contrib/ircd-shortcut.pl
147 .if defined(CHAN_SERV)
148 @${REINPLACE_CMD} -e "s#CHANSERV#${CHAN_SERV}#" \
149 ${WRKSRC}/contrib/ircd-shortcut.pl
151 .if defined(NICK_SERV)
152 @${REINPLACE_CMD} -e "s#NICKSERV#${NICK_SERV}#" \
153 ${WRKSRC}/contrib/ircd-shortcut.pl
155 .if defined(ALIS_SERV)
156 @${REINPLACE_CMD} -e "s#ALIS#${ALIS_SERV}#" \
157 ${WRKSRC}/contrib/ircd-shortcut.pl
159 .if defined(OPER_BOT)
160 @${REINPLACE_CMD} -e "s#OPERBOT#${OPER_BOT}#" \
161 ${WRKSRC}/contrib/ircd-shortcut.pl
163 .if defined(OPER_SERV)
164 @${REINPLACE_CMD} -e "s#OPERSERV#${OPER_SERV}#" \
165 ${WRKSRC}/contrib/ircd-shortcut.pl
167 .if defined(JUPE_SERV)
168 @${REINPLACE_CMD} -e "s#JUPESERV#${JUPE_SERV}#" \
169 ${WRKSRC}/contrib/ircd-shortcut.pl
171 .if defined(GLOBAL_SERV)
172 @${REINPLACE_CMD} -e "s#GLOBAL#${GLOBAL_SERV}#" \
173 ${WRKSRC}/contrib/ircd-shortcut.pl
176 #------ Execute ircd-shortcut perl script to generate the .c file. -----
177 @${ECHO_MSG} "Executing ircd-shortcut.pl for ircd-shortcuts generation."
178 ${PERL} ${WRKSRC}/contrib/ircd-shortcut.pl
181 @cd ${INSTALL_WRKSRC}/contrib && ${SETENV} ${MAKE_ENV} ${MAKE} \
182 ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS}
184 # ----- Need to build the m_rsshortcut.so module for ircd-shortcut.pl ----
185 @${ECHO_MSG} "Building m_rsshortcut.la for ircd-shortcuts."
186 @cd ${INSTALL_WRKSRC}/contrib && ${SETENV} ${MAKE_ENV} ${MAKE} \
187 ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} m_rsshortcut.la
190 ${MKDIR} ${PREFIX}/etc/${PORTNAME}
191 ${MKDIR} ${DATADIR}/help
192 ${MKDIR} ${PREFIX}/lib/${PORTNAME}/modules
195 .if ${PORT_OPTIONS:MDOCS}
197 cd ${WRKSRC}/doc && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
199 @cd ${INSTALL_WRKSRC}/contrib && ${SETENV} ${MAKE_ENV} ${MAKE} \
200 ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install
201 ${INSTALL_DATA} ${WRKSRC}/doc/ircd.motd ${PREFIX}/etc/${PORTNAME}/ircd.motd.sample
202 ${INSTALL_DATA} ${WRKSRC}/doc/example.conf ${PREFIX}/etc/${PORTNAME}/ircd.conf.sample
203 ${INSTALL_DATA} ${WRKSRC}/doc/example.efnet.conf ${PREFIX}/etc/${PORTNAME}/ircd-efnet.conf.sample
204 ${INSTALL_DATA} ${WRKSRC}/doc/genssl.sh ${PREFIX}/etc/${PORTNAME}/genssl.sh
206 # ----- We need to install the shortcut.pl module ----
207 @${ECHO_MSG} "Executing install-mod.sh for ircd-shortcuts module installation."
208 ${SH} ${WRKSRC}/install-mod.sh ${WRKSRC}/contrib/m_rsshortcut.la \
209 ${PREFIX}/lib/${PORTNAME}/modules/contrib
211 @if [ ! -f ${PREFIX}/etc/${PORTNAME}/ircd.conf ]; then \
212 ${ECHO} "Installing default configuration file."; \
213 ${CP} -p ${PREFIX}/etc/${PORTNAME}/ircd.conf.sample ${PREFIX}/etc/${PORTNAME}/ircd.conf ; \
216 @if [ ! -f ${PREFIX}/etc/${PORTNAME}/ircd.motd ]; then \
217 ${ECHO} "Installing default motd file."; \
218 ${CP} -p ${PREFIX}/etc/${PORTNAME}/ircd.motd.sample ${PREFIX}/etc/${PORTNAME}/ircd.motd ; \
221 @${SETENV} "PKG_PREFIX=${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
222 @${CAT} ${PKGMESSAGE}
224 #-----------------------------------------------------------------------
226 .include <bsd.port.mk>