aboutsummaryrefslogtreecommitdiffstats
path: root/irc/tr-ircd/Makefile
blob: fa1ce07d11ceeb0f71c6aa7c70da30e522f6d7b3 (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
# New ports collection makefile for:    tr-ircd
# Date created:         Sat May 4 15:54:47 CET 2002
# Whom:                 Alex Dupre <sysadmin@alexdupre.com>
#
# $FreeBSD$
#

PORTNAME=   tr-ircd
PORTVERSION=    5.7.3
PORTREVISION=   1
CATEGORIES= irc ipv6
MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
DISTNAME=   ${PORTNAME:S/-//}-release-${PORTVERSION}-r

MAINTAINER= mm@FreeBSD.org
COMMENT=    An irc daeemon based on Bahamut and hybrid-7

USE_GMAKE=  yes
GNU_CONFIGURE=  yes

TRIRCD_MAXCLIENTS?= 128

TRIRCD_USER?=   trircd
TRIRCD_GROUP?=  trircd
TRIRCD_RUNDIR?= /var/run/tr-ircd
TRIRCD_LOGDIR?= /var/log/tr-ircd
TRIRCD_CONFDIR?=    ${PREFIX}/etc/tr-ircd
TRIRCD_LIBDIR=  ${PREFIX}/lib/tr-ircd
TRIRCD_INCLUDEDIR=  ${PREFIX}/include/tr-ircd

CONFIGURE_ARGS= --prefix=${PREFIX} \
        --localstatedir=${TRIRCD_RUNDIR} \
        --sysconfdir=${TRIRCD_CONFDIR} \
        --libdir=${TRIRCD_LIBDIR} \
        --includedir=${TRIRCD_INCLUDEDIR} \
        --datadir=${DATADIR} \
        --enable-network-loop=kqueue \
        --with-fakehost-postfix=COM \
        --with-maxclients=${TRIRCD_MAXCLIENTS}

CONFIGURE_ENV+= MD5SUMS="\"${MD5} -r\""

USE_RC_SUBR=    trircd

SUB_LIST+=  TRIRCD_USER="${TRIRCD_USER}" TRIRCD_GROUP="${TRIRCD_GROUP}" \
        TRIRCD_RUNDIR="${TRIRCD_RUNDIR}" TRIRCD_LOGDIR="${TRIRCD_LOGDIR}" \
        TRIRCD_CONFDIR="${TRIRCD_CONFDIR}"

SUB_FILES+= pkg-install pkg-deinstall pkg-message
PKGINSTALL= ${WRKDIR}/pkg-install
PKGDEINSTALL=   ${WRKDIR}/pkg-deinstall
PKGMESSAGE= ${WRKDIR}/pkg-message

.if !defined(NO_INSTALL_MANPAGES)
MAN8=       tr-ircd.8
.endif

DOCS=       AUTHORS ChangeLog INSTALL LICENSE README.FIRST README.HTTPD \
        README.OPM RELNOTES TODO

.if !defined(WITHOUT_SSL)
USE_OPENSSL=    yes
CONFIGURE_ARGS+=--enable-openssl=${OPENSSLBASE}
.endif

.include <bsd.port.pre.mk>

PW?=        /usr/sbin/pw
SUB_LIST+=  MKDIR="${MKDIR}" PW="${PW}" CHMOD="${CHMOD}" CHOWN="${CHOWN}"

.if ${ARCH} == "amd64" || ${ARCH} == "ia64"
CFLAGS+=    -fPIC
.endif

post-patch:
    @${REINPLACE_CMD} -e "s,-O2,${CFLAGS}," ${WRKSRC}/configure
    @${REINPLACE_CMD} -e "s, ircpasswd,tr-ircpasswd," \
        -e "s,/home/ircd/lib,${TRIRCD_LIBDIR}," \
        -e "s,/home/ircd/ircd5/lib/,${TRIRCD_LIBDIR}," \
        -e "s,/home/ircd/ircd5/etc/,${TRIRCD_CONFDIR}," \
        -e "s,/home/ircd/var/run/tr-ircd,${TRIRCD_RUNDIR}," \
        ${WRKSRC}/doc/configuration/example.conf
    @${REINPLACE_CMD} -e "s,@localstatedir@/lib/tr-ircd,${TRIRCD_RUNDIR}," \
        ${WRKSRC}/tools/irandom.sh.in ${WRKSRC}/tools/isslconfig.sh.in
    @${REINPLACE_CMD} -e "s,@bindir@,${DATADIR}/tools," ${WRKSRC}/tools/Makefile.in

post-configure:
    @${REINPLACE_CMD} -e "s,/var/log/tr-ircd,${TRIRCD_LOGDIR}," ${WRKSRC}/include/ircpath.h

pre-install:
    @${SH} ${PKGINSTALL}

post-install:
    @${MKDIR} ${TRIRCD_CONFDIR}
    @${INSTALL_DATA} ${WRKSRC}/doc/configuration/example.conf ${TRIRCD_CONFDIR}/ircd.conf.sample
    @${INSTALL_DATA} ${WRKSRC}/doc/configuration/example-ihttpd.conf ${TRIRCD_CONFDIR}/ihttpd.conf.sample
    @${INSTALL_DATA} ${WRKSRC}/doc/configuration/example-maskfile.conf ${TRIRCD_CONFDIR}/maskfile.conf.sample
    @${INSTALL_DATA} ${WRKSRC}/doc/configuration/example-socks.conf ${TRIRCD_CONFDIR}/socks.conf.sample
    @${INSTALL_DATA} ${WRKSRC}/doc/configuration/ircdssl.conf ${TRIRCD_CONFDIR}/ircdssl.conf.sample
    @${INSTALL_DATA} ${WRKSRC}/doc/configuration/ircd.motd ${TRIRCD_CONFDIR}/ircd.motd.sample
    @${MKDIR} ${TRIRCD_RUNDIR}
.if !defined(NO_INSTALL_MANPAGES)
    @${INSTALL_MAN} ${WRKSRC}/doc/man/ircd.8 ${MANPREFIX}/man/man8/tr-ircd.8
.endif
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
.for FILE in ${DOCS}
    @${INSTALL_DATA} ${WRKSRC}/${FILE} ${DOCSDIR}/${FILE}
.endfor
.endif
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>