aboutsummaryrefslogtreecommitdiffstats
path: root/irc/ircd-ratbox-devel/Makefile
blob: ee4a0f7b79b6e17c670690fc0e1a7a06b4ce7fbc (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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# New ports collection makefile for:    ircd-ratbox
# Date Created:             2006-01-27
# Whom:                 Shaun Amott <shaun@inerd.com>
#
# $FreeBSD$
#
# ex: ts=8

PORTNAME=   ircd-ratbox
#PORTVERSION=   3.0.0
DISTVERSION=    3.0.0beta5
CATEGORIES= irc ipv6
MASTER_SITES=   ftp://ftp.ircd-ratbox.org/pub/ircd-ratbox/testing/  \
        ftp://ftp.demon.co.uk/pub/mirrors/ircd-ratbox/testing/  \
        http://www.ircd-ratbox.org/download/testing/        \
        ftp://ftp.parodius.com/pub/ircd-ratbox/testing/old/ \
        http://www.ircd-ratbox.org/download/testing/old/
PKGNAMESUFFIX=  -devel

MAINTAINER= moggie@elasticmind.net
COMMENT=    Advanced, stable IRC daemon, used widely on EFnet ('testing' release)

CONFLICTS=  ircd-ratbox-[0-9]*

USE_BZIP2=  yes
#MAN8=      ircd.8
USE_RC_SUBR=    ircd-ratbox.sh
#USE_SQLITE=    3
USE_LDCONFIG=   ${PREFIX}/lib/ircd-ratbox

LOGDIR?=    /var/log/${PORTNAME}
RUNDIR?=    /var/run/${PORTNAME}
DBDIR?=     /var/db/${PORTNAME}
SUB_FILES=  pkg-message pkg-install
PLIST_SUB=  LOGDIR=${LOGDIR} RUNDIR=${RUNDIR} DBDIR=${DBDIR}
SUB_LIST=   LOGDIR=${LOGDIR} RUNDIR=${RUNDIR} DBDIR=${DBDIR}

GNU_CONFIGURE=  yes
CONFIGURE_ARGS= --with-confdir=${PREFIX}/etc/${PORTNAME}        \
        --with-logdir=/var/log/${PORTNAME}          \
        --with-moduledir=${PREFIX}/lib/${PORTNAME}/modules  \
        --libexecdir=${PREFIX}/libexec              \
        --with-helpdir=${DATADIR}/help              \
        --libdir=${PREFIX}/lib/${PORTNAME}          \
        --disable-backups

PORTDOCS=   [^i]*.txt README.* technical/[^i]*.txt Tao-of-IRC.*

#-- Options ------------------------------------------------------------

OPTIONS=    OPENSSL     "Enable openssl support"            on  \
        IPV6        "Enable IPv6 support"               on  \
        ZIPLINKS    "Enable ziplinks support"           on  \
        SHARED_MODULES  "Enable shared modules support"         on  \
        ASSERT      "Enable debugging code"             off \
        SMALL_NET   "Tune server for small networks"        off \
        SERVICES    "Enable ratbox-services compatibility code" off \
        SSLONLY     "Enable SSL only chan' support (chanmode +S)"   off

#----------------------------------------------------------------------

.include <bsd.port.pre.mk>

.if defined(WITH_OPENSSL)
.include "${PORTSDIR}/Mk/bsd.openssl.mk"
CONFIGURE_ARGS+=    --enable-openssl
.else
CONFIGURE_ARGS+=    --disable-openssl
.endif

.if !defined(WITHOUT_IPV6)
CONFIGURE_ARGS+=    --enable-ipv6
.endif

.if defined(WITHOUT_ZIPLINKS)
CONFIGURE_ARGS+=    --disable-zlib
.endif

.if defined(WITHOUT_SHARED_MODULES)
CONFIGURE_ARGS+=    --disable-shared-modules
.endif

.if defined(WITH_ASSERT)
CONFIGURE_ARGS+=    --enable-assert
.else
CONFIGURE_ARGS+=    --disable-assert
.endif

.if defined(WITH_SMALL_NET)
CONFIGURE_ARGS+=    --enable-small-net
.endif

.if defined(WITH_SERVICES)
CONFIGURE_ARGS+=    --enable-services
.endif

.if defined(WITH_SSLONLY)
CONFIGURE_ARGS+=    --enable-sslonly-channels
.endif

#-- User Configuration -------------------------------------------------

.if defined(NICKLEN)
CONFIGURE_ARGS+=    --with-nicklen=${NICKLEN}
.endif

#-----------------------------------------------------------------------

pre-configure:
    @${ECHO_MSG} ""
    @${ECHO_MSG} "This port has additional options:"
    @${ECHO_MSG} "    NICKLEN     [default 9, max 50]    - Max nick length on server"
    @${ECHO_MSG} ""
    @${ECHO_MSG} "Press CTRL+C now if you wish to set them."
    @${ECHO_MSG} ""

post-patch:
    @${REINPLACE_CMD} -e "s#-O2##" ${WRKSRC}/configure
    @${REINPLACE_CMD} -e "s#%%PREFIX%%#${PREFIX}#g"       \
              ${WRKSRC}/doc/example.conf          \
              ${WRKSRC}/doc/example.efnet.conf
    @${REINPLACE_CMD} -e "s#%%LOGDIR%%#${LOGDIR}#g"     \
                ${WRKSRC}/doc/example.conf  \
                ${WRKSRC}/doc/example.efnet.conf
    @${REINPLACE_CMD} -e "s#%%RUNDIR%%#${RUNDIR}#g" ${WRKSRC}/include/config.h
    @${REINPLACE_CMD} -e "s#%%DBDIR%%#${DBDIR}#g" ${WRKSRC}/include/config.h

post-build:
    @cd ${INSTALL_WRKSRC}/contrib && ${SETENV} ${MAKE_ENV} ${MAKE} \
        ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS}

pre-su-install:
    @${SETENV} "PKG_PREFIX=${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
    ${MKDIR}  ${PREFIX}/etc/${PORTNAME}
    ${MKDIR}  ${DATADIR}/help
    ${MKDIR}  ${PREFIX}/lib/${PORTNAME}/modules

post-install:
.if !defined(NOPORTDOCS)
    ${MKDIR} ${DOCSDIR}
    cd ${WRKSRC}/doc && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
.endif
    @cd ${INSTALL_WRKSRC}/contrib && ${SETENV} ${MAKE_ENV} ${MAKE} \
        ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install
    ${INSTALL_DATA} ${WRKSRC}/doc/ircd.motd ${PREFIX}/etc/${PORTNAME}/ircd.motd.sample
    ${INSTALL_DATA} ${WRKSRC}/doc/example.conf ${PREFIX}/etc/${PORTNAME}/ircd.conf.sample
    ${INSTALL_DATA} ${WRKSRC}/doc/example.efnet.conf ${PREFIX}/etc/${PORTNAME}/ircd-efnet.conf.sample
    ${INSTALL_DATA} ${WRKSRC}/doc/genssl.sh ${PREFIX}/etc/${PORTNAME}/genssl.sh

    @if [ ! -f ${PREFIX}/etc/${PORTNAME}/ircd.conf ]; then \
        ${ECHO} "Installing default configuration file."; \
        ${CP} -p ${PREFIX}/etc/${PORTNAME}/ircd.conf.sample ${PREFIX}/etc/${PORTNAME}/ircd.conf ; \
    fi

    @if [ ! -f ${PREFIX}/etc/${PORTNAME}/ircd.motd ]; then \
        ${ECHO} "Installing default motd file."; \
        ${CP} -p ${PREFIX}/etc/${PORTNAME}/ircd.motd.sample ${PREFIX}/etc/${PORTNAME}/ircd.motd ; \
    fi

    @${SETENV} "PKG_PREFIX=${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
    @${CAT} ${PKGMESSAGE}

#-----------------------------------------------------------------------

.include <bsd.port.post.mk>