186 lines
6 KiB
Makefile
186 lines
6 KiB
Makefile
# $NetBSD: Makefile,v 1.3 2002/10/10 09:40:07 wiz Exp $
|
|
#
|
|
|
|
DISTNAME= ircd-hybrid-6.2
|
|
CATEGORIES= chat
|
|
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ircd-hybrid/}
|
|
EXTRACT_SUFX= .tgz
|
|
|
|
MAINTAINER= seb@pbox.org
|
|
HOMEPAGE= http://www.ircd-hybrid.net/
|
|
COMMENT= Irc server with many options
|
|
|
|
GNU_CONFIGURE= YES
|
|
|
|
USE_BUILDLINK2= # defined
|
|
|
|
DEINSTALL_FILE= ${WRKDIR}/DEINSTALL
|
|
INSTALL_FILE= ${WRKDIR}/INSTALL
|
|
|
|
.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_DPATH \
|
|
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
|
|
|
|
# to handle user and group creation...
|
|
.if ${OPSYS} == "NetBSD"
|
|
.if exists(/usr/sbin/user)
|
|
ADDUSER= /usr/sbin/useradd
|
|
ADDGROUP= /usr/sbin/groupadd
|
|
.else
|
|
DEPENDS+= user>=20000313:../../sysutils/user
|
|
ADDUSER= ${LOCALBASE}/sbin/useradd
|
|
ADDGROUP= ${LOCALBASE}/sbin/groupadd
|
|
.endif
|
|
.elif ${OPSYS} == "SunOS"
|
|
ADDUSER= useradd
|
|
ADDGROUP= groupadd
|
|
.endif
|
|
|
|
# tuning of INSTALL and DEINSTALL scripts
|
|
INSTALL_SUBST+= USER=${IRCD_HYBRID_IRC_USER}
|
|
INSTALL_SUBST+= GROUP=${IRCD_HYBRID_IRC_GROUP}
|
|
INSTALL_SUBST+= DPATH=${IRCD_HYBRID_DPATH}
|
|
INSTALL_SUBST+= LPATH=${IRCD_HYBRID_LPATH}
|
|
INSTALL_SUBST+= USERLOG=${IRCD_HYBRID_FNAME_USERLOG}
|
|
INSTALL_SUBST+= OPERLOG=${IRCD_HYBRID_FNAME_OPERLOG}
|
|
|
|
INSTALL_SUBST+= ADDUSER=${ADDUSER:Q}
|
|
INSTALL_SUBST+= ADDGROUP=${ADDGROUP:Q}
|
|
INSTALL_SUBST+= CAT=${CAT:Q}
|
|
INSTALL_SUBST+= CHGRP=${CHGRP:Q}
|
|
INSTALL_SUBST+= ID=${ID:Q}
|
|
INSTALL_SUBST+= RM=${RM:Q}
|
|
INSTALL_SUBST+= TOUCH=${TOUCH:Q}
|
|
|
|
INSTALL_SUBST_SED= ${INSTALL_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}
|
|
|
|
# tuning of "etc script"
|
|
SCRIPT_SUBST+= PPATH=${IRCD_HYBRID_PPATH:Q}
|
|
SCRIPT_SUBST+= SPATH=${IRCD_HYBRID_SPATH:Q}
|
|
SCRIPT_SUBST+= USER=${IRCD_HYBRID_IRC_USER:Q}
|
|
SCRIPT_SUBST+= DPATH=${IRCD_HYBRID_DPATH:Q}
|
|
|
|
SCRIPT_SUBST+= TOUCH=${TOUCH:Q}
|
|
SCRIPT_SUBST+= CHOWN=${CHOWN:Q}
|
|
SCRIPT_SUBST+= CHMOD=${CHMOD:Q}
|
|
|
|
SCRIPT_SUBST_SED= ${SCRIPT_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}
|
|
|
|
# tuning of document file
|
|
DOC_SUBST= PREFIX=${PREFIX}
|
|
DOC_SUBST+= USER=${IRCD_HYBRID_IRC_USER}
|
|
DOC_SUBST+= GROUP=${IRCD_HYBRID_IRC_GROUP}
|
|
DOC_SUBST+= DPATH=${IRCD_HYBRID_DPATH}
|
|
DOC_SUBST+= LPATH=${IRCD_HYBRID_LPATH}
|
|
DOC_SUBST+= OPERLOG=${IRCD_HYBRID_FNAME_OPERLOG}
|
|
DOC_SUBST+= USERLOG=${IRCD_HYBRID_FNAME_USERLOG}
|
|
DOC_SUBST+= SYSLOG_FACILITY=${IRCD_HYBRID_SYSLOG_FACILITY}
|
|
|
|
post-build:
|
|
${SED} ${SCRIPT_SUBST_SED} ${FILESDIR}/ircd-hybrid > ${WRKDIR}/ircd-hybrid
|
|
${CP} ${FILESDIR}/pkg-setup.txt ${WRKDIR}/pkg-setup.txt
|
|
.if (${IRCD_HYBRID_USE_LOGFILE} != "YES")
|
|
${MV} ${WRKDIR}/pkg-setup.txt ${WRKDIR}/.pkg-setup.txt
|
|
${SED} -e '/LPATH/d' -e '/USERLOG/d' ${WRKDIR}/.pkg-setup.txt > ${WRKDIR}/pkg-setup.txt
|
|
cp ${WRKDIR}/pkg-setup.txt ${WRKDIR}/pkg-setup.txt.1
|
|
.endif
|
|
.if (${IRCD_HYBRID_USE_SYSLOG} != "YES")
|
|
${MV} ${WRKDIR}/pkg-setup.txt ${WRKDIR}/.pkg-setup.txt
|
|
${SED} -e '/SYSLOG_FACILITY/d' ${WRKDIR}/.pkg-setup.txt > ${WRKDIR}/pkg-setup.txt
|
|
cp ${WRKDIR}/pkg-setup.txt ${WRKDIR}/pkg-setup.txt.2
|
|
.endif
|
|
${MV} ${WRKDIR}/pkg-setup.txt ${WRKDIR}/.pkg-setup.txt
|
|
${SED} ${DOC_SUBST:S/=/}!/:S/$/!g/:S/^/ -e s!\\\${/}\
|
|
${WRKDIR}/.pkg-setup.txt > ${WRKDIR}/pkg-setup.txt
|
|
|
|
pre-install:
|
|
${SED} ${INSTALL_SUBST_SED} ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}
|
|
${SED} ${INSTALL_SUBST_SED} ${PKGDIR}/INSTALL > ${INSTALL_FILE}
|
|
PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL
|
|
|
|
post-install:
|
|
${INSTALL_SCRIPT} ${WRKDIR}/ircd-hybrid ${PREFIX}/etc/rc.d/ircd-hybrid
|
|
${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/buildlink2.mk"
|
|
.include "../../mk/bsd.pkg.mk"
|