summaryrefslogtreecommitdiff
path: root/chat/unrealircd/Makefile
blob: 488ee440691b0228132cd20d6d9b14cfbda492de (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
# $NetBSD: Makefile,v 1.50 2017/09/06 09:03:00 wiz Exp $

DISTNAME=	Unreal3.2.10.5
PKGNAME=	${DISTNAME:tl:S/l/lircd-/1}
PKGREVISION=	6
CATEGORIES=	chat
MASTER_SITES=	http://unrealircd.org/downloads/

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://www.unrealircd.org/
COMMENT=	Advanced IRC server with IPv6 and SSL support
LICENSE=	gnu-gpl-v2

CONFLICTS+=	ircu-[0-9]*

GNU_CONFIGURE=	YES
USE_TOOLS+=	gmake gunzip pkg-config

CHECK_PORTABILITY_SKIP=	update

.include "options.mk"

CONFIGURE_ARGS+=	--with-system-cares
CONFIGURE_ARGS+=	--with-system-tre

CONFIGURE_ARGS+=	--with-dpath=${UIRCD_HOME}
CONFIGURE_ARGS+=	--with-spath=${PREFIX}/sbin/ircd
CONFIGURE_ARGS+=	--with-permissions=0660

CONFIGURE_ARGS+=	--with-listen=${UIRCD_LISTEN:Q}
CONFIGURE_ARGS+=	--with-sendq=${UIRCD_SENDQ:Q}
CONFIGURE_ARGS+=	--with-bufferpool=${UIRCD_BUFFER:Q}
CONFIGURE_ARGS+=	--with-fd-setsize=${UIRCD_FDSIZE:Q}
CONFIGURE_ARGS+=	--with-nick-history=${UIRCD_NICKHIST:Q}

IRCD_DOCS=	${PREFIX}/share/doc/unrealircd
IRCD_SHARE=	${PREFIX}/share/unrealircd
IRCD_EG=	${PREFIX}/share/examples/unrealircd

BUILD_DEFS+=	UIRCD_SENDQ UIRCD_LISTEN UIRCD_BUFFER UIRCD_HOST
BUILD_DEFS+=	UIRCD_HOME UIRCD_NICKHIST UIRCD_FDSIZE VARBASE

PTHREAD_OPTS+=	require

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

# The defaults for most of these here are from the standard Conf
# script supplied with the UnrealIRCd package.
#
UIRCD_SENDQ?=		3000000
UIRCD_LISTEN?=		5
UIRCD_BUFFER?=		18
UIRCD_NICKHIST?=	2000
UIRCD_FDSIZE?=		1024
UIRCD_USER?=		uircd
UIRCD_GROUP?=		uircd
UIRCD_HOST?=		localhost
UIRCD_HOME?=		${VARBASE}/unrealircd

DOC_FILES=		doc/Authors doc/coding-guidelines doc/tao.of.irc LICENSE

CONF_FILES_PERMS=	${IRCD_EG}/example.conf \
			${UIRCD_HOME}/unrealircd.conf \
			${UIRCD_USER} ${UIRCD_GROUP} 0660

PKG_USERS_VARS+=	UIRCD_USER
PKG_GROUPS_VARS+=	UIRCD_GROUP

PKG_GROUPS=		${UIRCD_GROUP}
PKG_USERS=		${UIRCD_USER}:${UIRCD_GROUP}

PKG_GECOS.${UIRCD_USER}=	UnrealIRCD user
PKG_HOME.${UIRCD_USER}=		${UIRCD_HOME}

RCD_SCRIPTS=	unrealircd

FILES_SUBST+=	UIRCD_HOME=${UIRCD_HOME}
FILES_SUBST+=	UIRCD_USER=${UIRCD_USER}
FILES_SUBST+=	UIRCD_GROUP=${UIRCD_GROUP}

SUBST_CLASSES+=		homedir
SUBST_STAGE.homedir=	post-patch
SUBST_FILES.homedir=	doc/example.conf
SUBST_SED.homedir=	-e "s|src/modules|${IRCD_SHARE}/modules|g"
SUBST_SED.homedir+=	-e "s|include \"|include \"${IRCD_SHARE}/|g"
SUBST_MESSAGE.homedir=	Fixing home directory of the IRC server.

.if !empty(PKG_OPTIONS:Munrealircd-chroot)
SUBST_CLASSES+=		chroot
SUBST_STAGE.chroot=	pre-install
SUBST_FILES.chroot=	${WRKDIR}/unrealircd
SUBST_SED.chroot=	-e "s|unrealircd_user=|\#unrealircd_user=|g"
SUBST_SED.chroot+=	-e "s|unrealircd_group=|\#unrealircd_group=|g"
SUBST_MESSAGE.chroot=	Fixing chroot installation.
.endif

OWN_DIRS_PERMS+=	${UIRCD_HOME}     ${UIRCD_USER} ${UIRCD_GROUP} 0770
OWN_DIRS_PERMS+=	${UIRCD_HOME}/tmp ${UIRCD_USER} ${UIRCD_GROUP} 0770
INSTALLATION_DIRS=	sbin ${IRCD_DOCS} ${IRCD_EG} ${IRCD_SHARE}/aliases \
			${IRCD_SHARE}/modules

CFLAGS.Darwin+=	-DUSE_LOCALE
CFLAGS.SunOS+=	-DUSE_LOCALE

.include "../../net/libcares/buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../devel/tre/buildlink3.mk"

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/src/ircd ${DESTDIR}${PREFIX}/sbin
	${INSTALL_DATA} ${WRKSRC}/aliases/*.conf \
		${DESTDIR}${IRCD_SHARE}/aliases
	${INSTALL_DATA} ${WRKSRC}/badwords*.conf ${DESTDIR}${IRCD_SHARE}
	${INSTALL_DATA} ${WRKSRC}/help.* ${DESTDIR}${IRCD_SHARE}
	${INSTALL_DATA} ${WRKSRC}/doc/help.* ${DESTDIR}${IRCD_SHARE}
	${INSTALL_DATA} ${WRKSRC}/spamfilter.conf ${DESTDIR}${IRCD_SHARE}
	${INSTALL_LIB} ${WRKSRC}/src/modules/*.so \
		${DESTDIR}${IRCD_SHARE}/modules
	${INSTALL_DATA} ${WRKSRC}/doc/unreal32docs.* ${DESTDIR}${IRCD_DOCS}
	${INSTALL_DATA} ${WRKSRC}/doc/example.* ${DESTDIR}${IRCD_EG}
.for f in ${DOC_FILES}
	${INSTALL_DATA} ${WRKSRC}/${f} ${DESTDIR}${IRCD_DOCS}
.endfor

.include "../../mk/bsd.pkg.mk"