summaryrefslogtreecommitdiff
path: root/chat/ircd-hybrid/Makefile
blob: 0eb0aa6e0fdf31bab0e15143160782384f9cfa40 (plain)
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
# $NetBSD: Makefile,v 1.19 2005/08/23 11:48:47 rillig Exp $
#

DISTNAME=	ircd-hybrid-6.2
PKGREVISION=	3
CATEGORIES=	chat
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=ircd-hybrid/}
EXTRACT_SUFX=	.tgz

MAINTAINER=	tech-pkg@NetBSD.org
HOMEPAGE=	http://www.ircd-hybrid.net/
COMMENT=	IRC server with many options

GNU_CONFIGURE=	YES

USE_PKGINSTALL=		YES

PKG_SYSCONFSUBDIR=	ircd-hybrid
IRCD_HYBRID_DPATH=	${PKG_SYSCONFDIR}

.include "../../mk/bsd.prefs.mk"

.if ${IRCD_HYBRID_SMALL_NET} == "YES"
IRCD_HYBRID_LINK_PREALLOCATE?=		64
IRCD_HYBRID_CLIENTS_PREALLOCATE?=	64
IRCD_HYBRID_USERS_PREALLOCATE?=		64
IRCD_HYBRID_NICKNAMEHISTORYLENGTH?=	1000
IRCD_HYBRID_MAXSENDQLENGTH?=		500000
IRCD_HYBRID_INITIAL_DBUFS?=		300
IRCD_HYBRID_HARD_FDLIMIT_?=		90
IRCD_HYBRID_INIT_MAXCLIENTS?=		40
.endif

# this is not supposed to be changed
IRCD_HYBRID_SPATH=		${PREFIX}/sbin/ircd-hybrid
IRCD_HYBRID_SDIR=		${IRCD_HYBRID_SPATH:C|/[^/]*$||}

# throw all the settings in _DEFS
.for def in \
	IRCD_HYBRID_LINK_PREALLOCATE IRCD_HYBRID_CLIENTS_PREALLOCATE \
	IRCD_HYBRID_USERS_PREALLOCATE IRCD_HYBRID_NICKNAMEHISTORYLENGTH \
	IRCD_HYBRID_MAXSENDQLENGTH IRCD_HYBRID_INITIAL_DBUFS \
	IRCD_HYBRID_HARD_FDLIMIT_ IRCD_HYBRID_INIT_MAXCLIENTS
.  ifdef ${def}
_DEFS+=		-D${def:S|^IRCD_HYBRID_||}=${${def}}
.  endif
.endfor
.for def in \
	IRCD_HYBRID_NETWORK_NAME IRCD_HYBRID_NETWORK_DESC
.  ifdef ${def}
_DEFS+=		-D${def:S|^IRCD_HYBRID_||}=\"${${def}:Q}\"
.  endif
.endfor
.for def in \
	IRCD_HYBRID_DPATH IRCD_HYBRID_SPATH \
	IRCD_HYBRID_FNAME_USERLOG IRCD_HYBRID_FNAME_OPERLOG IRCD_HYBRID_PPATH \
	IRCD_HYBRID_IRC_USER IRCD_HYBRID_IRC_GROUP
_DEFS+=		-D${def:S|^IRCD_HYBRID_||}=\"${${def}}\"
.endfor
.if ${IRCD_HYBRID_USE_SYSLOG} == "YES"
_DEFS+=		-DUSE_SYSLOG=1
_DEFS+=		-DLOG_FACILITY=${IRCD_HYBRID_SYSLOG_FACILITY}
.endif
.if ${IRCD_HYBRID_USE_LOGFILE} == "YES"
_DEFS+=		-DUSE_LOGFILE=1
_DEFS+=		-DLPATH=\"${IRCD_HYBRID_LPATH}\"
.endif
_DEFS+=		-DINIT_LOG_LEVEL=${IRCD_HYBRID_INIT_LOG_LEVEL}

# and pass then down to make as DEFS
MAKE_FLAGS+=	DEFS='${_DEFS}'

# and few other things for install target
MAKE_FLAGS+=	SPATH=${IRCD_HYBRID_SPATH} SDIR=${IRCD_HYBRID_SDIR}
MAKE_FLAGS+=	PREFIX=${PREFIX} DESTDIR=${DESTDIR}

# for the records
.for def in \
	IRCD_HYBRID_LINK_PREALLOCATE IRCD_HYBRID_CLIENTS_PREALLOCATE \
	IRCD_HYBRID_USERS_PREALLOCATE IRCD_HYBRID_NICKNAMEHISTORYLENGTH \
	IRCD_HYBRID_MAXSENDQLENGTH IRCD_HYBRID_INITIAL_DBUFS \
	IRCD_HYBRID_HARD_FDLIMIT_ IRCD_HYBRID_INIT_MAXCLIENTS \
	IRCD_HYBRID_NETWORK_NAME IRCD_HYBRID_NETWORK_DESC \
	IRCD_HYBRID_FNAME_OPERLOG IRCD_HYBRID_PPATH \
	IRCD_HYBRID_IRC_USER IRCD_HYBRID_IRC_GROUP
.  ifdef ${def}
BUILD_DEFS+=	${def}
.  endif
.endfor
.ifdef ${IRCD_HYBRID_USE_SYSLOG} == "YES"
BUILD_DEFS+=	IRCD_HYBRID_USE_SYSLOG
BUILD_DEFS+=	IRCD_HYBRID_SYSLOG_FACILITY
.else
BUILD_DEFS+=	IRCD_HYBRID_FNAME_USERLOG
.endif
.if ${IRCD_HYBRID_USE_LOGFILE} == "YES"
BUILD_DEFS+=	IRCD_HYBRID_USE_LOGFILE
BUILD_DEFS+=	IRCD_HYBRID_LPATH
.endif

FILES_SUBST+=		PPATH=${IRCD_HYBRID_PPATH:Q}
FILES_SUBST+=		SPATH=${IRCD_HYBRID_SPATH:Q}
FILES_SUBST+=		USER=${IRCD_HYBRID_IRC_USER:Q}
FILES_SUBST+=		DPATH=${IRCD_HYBRID_DPATH:Q}
FILES_SUBST+=		GROUP=${IRCD_HYBRID_IRC_GROUP}
FILES_SUBST+=		SYSLOG_FACILITY=${IRCD_HYBRID_SYSLOG_FACILITY}

RCD_SCRIPTS=		ircd-hybrid

PKG_USERS=		${IRCD_HYBRID_IRC_USER}:${IRCD_HYBRID_IRC_GROUP}::IRC\ User::${NOLOGIN}
PKG_GROUPS=		${IRCD_HYBRID_IRC_GROUP}

CONF_FILES=		${PREFIX}/share/examples/ircd-hybrid/opers.txt \
			${IRCD_HYBRID_DPATH}/opers.txt
CONF_FILES_PERMS=	/dev/null ${IRCD_HYBRID_FNAME_OPERLOG} \
			${IRCD_HYBRID_IRC_USER} ${IRCD_HYBRID_IRC_GROUP} 600
CONF_FILES_PERMS+=	/dev/null ${IRCD_HYBRID_FNAME_USERLOG} \
			${IRCD_HYBRID_IRC_USER} ${IRCD_HYBRID_IRC_GROUP} 600
.if ${IRCD_HYBRID_USE_LOGFILE} == "YES"
CONF_FILES_PERMS+=	/dev/null ${IRCD_HYBRID_LPATH} \
			${IRCD_HYBRID_IRC_USER} ${IRCD_HYBRID_IRC_GROUP} 600
.endif

post-build:
	${_PKG_SILENT}${_PKG_DEBUG}					\
		${CP} ${FILESDIR}/pkg-setup.txt ${WRKDIR}/pkg-setup.txt
.if ${IRCD_HYBRID_USE_SYSLOG} != "YES"
	${_PKG_SILENT}${_PKG_DEBUG}					\
		${MV} ${WRKDIR}/pkg-setup.txt ${WRKDIR}/.pkg-setup.txt
	${_PKG_SILENT}${_PKG_DEBUG}					\
		${SED} -e '/SYSLOG_FACILITY/d' ${WRKDIR}/.pkg-setup.txt	\
		> ${WRKDIR}/pkg-setup.txt
.endif
	${_PKG_SILENT}${_PKG_DEBUG}					\
		${MV} ${WRKDIR}/pkg-setup.txt ${WRKDIR}/.pkg-setup.txt
	${_PKG_SILENT}${_PKG_DEBUG}					\
		${SED} ${FILES_SUBST_SED} ${WRKDIR}/.pkg-setup.txt	\
		> ${WRKDIR}/pkg-setup.txt

post-install:
	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/ircd-hybrid
	${INSTALL_DATA} ${WRKDIR}/pkg-setup.txt ${PREFIX}/share/doc/ircd-hybrid/pkg-setup.txt
	for f in operguide.txt opermyth.txt; do \
		${INSTALL_DATA} ${WRKDIR}/ircd-hybrid-6.2/doc/$$f  ${PREFIX}/share/doc/ircd-hybrid/$$f ; \
	done

.include "../../devel/zlib/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"