Tweak editors/scribes version 0.4.b954_1
[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 CATEGORIES=     irc ipv6
7 MASTER_SITES=   http://www.ratbox.org/download/                         \
8                 http://www.ratbox.org/download/old/
9 PKGNAMESUFFIX=  -devel
10
11 MAINTAINER=     moggie@elasticmind.net
12 COMMENT=        Advanced, stable IRC daemon, used widely on EFnet ('testing' release)
13
14 LICENSE=        GPLv2
15
16 CONFLICTS=      ircd-ratbox-[0-9]* charybdis-[0-9]*
17
18 USES=           perl5
19 USE_BZIP2=      yes
20 #MAN8=          ircd.8
21 USE_RC_SUBR=    ircd-ratbox
22 USE_SQLITE=     3
23 USE_PERL5=      build
24 USE_LDCONFIG=   ${PREFIX}/lib/ircd-ratbox
25
26 USERS=          ircd
27 GROUPS=         ${USERS}
28
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}
35
36 GNU_CONFIGURE=  yes
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}                             \
44                 --disable-backups
45
46 PORTDOCS=       [^i]*.txt README.* technical/[^i]*.txt Tao-of-IRC.*
47
48 #-- Options ------------------------------------------------------------
49
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
57
58 #----------------------------------------------------------------------
59
60 NO_STAGE=       yes
61 .include <bsd.port.options.mk>
62
63 .if ${PORT_OPTIONS:MOPENSSL}
64 USE_OPENSSL=            yes
65 CONFIGURE_ARGS+=        --enable-openssl
66 .else
67 CONFIGURE_ARGS+=        --disable-openssl
68 .endif
69
70 .if ! ${PORT_OPTIONS:MIPV6}
71 CONFIGURE_ARGS+=        --disable-ipv6
72 .endif
73
74 .if ! ${PORT_OPTIONS:MZIPLINKS}
75 CONFIGURE_ARGS+=        --disable-zlib
76 .endif
77
78 .if ! ${PORT_OPTIONS:MSHARED_MODULES}
79 CONFIGURE_ARGS+=        --disable-shared-modules
80 .endif
81
82 .if ${PORT_OPTIONS:MASSERT}
83 CONFIGURE_ARGS+=        --enable-assert
84 .else
85 CONFIGURE_ARGS+=        --disable-assert
86 .endif
87
88 .if ${PORT_OPTIONS:MSMALL_NET}
89 CONFIGURE_ARGS+=        --enable-small-net
90 .endif
91
92 .if ${PORT_OPTIONS:MSERVICES}
93 CONFIGURE_ARGS+=        --enable-services
94 .endif
95
96 #-- User Configuration -------------------------------------------------
97
98 .if defined(NICKLEN)
99 CONFIGURE_ARGS+=        --with-nicklen=${NICKLEN}
100 .endif
101
102 #-----------------------------------------------------------------------
103
104 pre-configure:
105         @${ECHO_MSG} ""
106         @${ECHO_MSG} "This port has additional options:"
107         @${ECHO_MSG} "    NICKLEN     [default 9, max 50]    - Max nick length on server"
108         @${ECHO_MSG} ""
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"
118         @${ECHO_MSG} ""
119         @${ECHO_MSG} "Press CTRL+C now if you wish to set them."
120         @${ECHO_MSG} ""
121
122 pre-build:
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
136
137 #-- ircd-shortcut.pl ratbox-services commands --------------------------------------
138
139 .if defined(SERVER_NAME)
140         @${REINPLACE_CMD} -e "s#services.ircd-ratbox.org#${SERVER_NAME}#"       \
141         ${WRKSRC}/contrib/ircd-shortcut.pl
142 .endif
143 .if defined(USER_SERV)
144         @${REINPLACE_CMD} -e "s#USERSERV#${USER_SERV}#" \
145         ${WRKSRC}/contrib/ircd-shortcut.pl
146 .endif
147 .if defined(CHAN_SERV)
148         @${REINPLACE_CMD} -e "s#CHANSERV#${CHAN_SERV}#" \
149         ${WRKSRC}/contrib/ircd-shortcut.pl
150 .endif
151 .if defined(NICK_SERV)
152         @${REINPLACE_CMD} -e "s#NICKSERV#${NICK_SERV}#" \
153         ${WRKSRC}/contrib/ircd-shortcut.pl
154 .endif
155 .if defined(ALIS_SERV)
156         @${REINPLACE_CMD} -e "s#ALIS#${ALIS_SERV}#"     \
157         ${WRKSRC}/contrib/ircd-shortcut.pl
158 .endif
159 .if defined(OPER_BOT)
160         @${REINPLACE_CMD} -e "s#OPERBOT#${OPER_BOT}#"   \
161         ${WRKSRC}/contrib/ircd-shortcut.pl
162 .endif
163 .if defined(OPER_SERV)
164         @${REINPLACE_CMD} -e "s#OPERSERV#${OPER_SERV}#" \
165         ${WRKSRC}/contrib/ircd-shortcut.pl
166 .endif
167 .if defined(JUPE_SERV)
168         @${REINPLACE_CMD} -e "s#JUPESERV#${JUPE_SERV}#" \
169         ${WRKSRC}/contrib/ircd-shortcut.pl
170 .endif
171 .if defined(GLOBAL_SERV)
172         @${REINPLACE_CMD} -e "s#GLOBAL#${GLOBAL_SERV}#" \
173         ${WRKSRC}/contrib/ircd-shortcut.pl
174 .endif
175
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
179
180 post-build:
181         @cd ${INSTALL_WRKSRC}/contrib && ${SETENV} ${MAKE_ENV} ${MAKE} \
182                 ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS}
183
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
188
189 pre-su-install:
190         ${MKDIR} ${PREFIX}/etc/${PORTNAME}
191         ${MKDIR} ${DATADIR}/help
192         ${MKDIR} ${PREFIX}/lib/${PORTNAME}/modules
193
194 post-install:
195 .if ${PORT_OPTIONS:MDOCS}
196         ${MKDIR} ${DOCSDIR}
197         cd ${WRKSRC}/doc && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
198 .endif
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
205
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
210
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 ; \
214         fi
215
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 ; \
219         fi
220
221         @${SETENV} "PKG_PREFIX=${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
222         @${CAT} ${PKGMESSAGE}
223
224 #-----------------------------------------------------------------------
225
226 .include <bsd.port.mk>