summaryrefslogtreecommitdiff
path: root/chat/ircd-hybrid/Makefile
blob: 2f8a4f43564475ba5a8d4f9b8b110a8db67e6015 (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
# $NetBSD: Makefile,v 1.44 2012/10/03 00:02:38 asau Exp $

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

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://www.ircd-hybrid.com/
COMMENT=	IRC server with many options

CONFLICTS+=	ircu-[0-9]*

USE_TOOLS+=	pax

GNU_CONFIGURE=	YES
BUILD_DEFS+=	IRCD_HYBRID_SYSLOG_FACILITY IRCD_HYBRID_NICLEN \
		IRCD_HYBRID_TOPICLEN IRCD_HYBRID_MAXCONN \
		IRCD_HYBRID_SYSLOG_EVENTS VARBASE \
		IRCD_HYBRID_IRC_USER IRCD_HYBRID_IRC_GROUP

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

PKG_SYSCONFSUBDIR=	ircd-hybrid
RCD_SCRIPTS=		ircd-hybrid

HYBRID_EG_PLACE=	share/examples/ircd-hybrid
HYBRID_DOC_PLACE=	share/doc/ircd-hybrid
HYBRID_EG=		${PREFIX}/${HYBRID_EG_PLACE}
HYBRID_DOC=		${PREFIX}/${HYBRID_DOC_PLACE}

INSTALLATION_DIRS+=	${HYBRID_EG_PLACE} ${HYBRID_DOC_PLACE}/doc
INSTALLATION_DIRS+=	share/ircd-hybrid/messages

CONF_FILES_PERMS=	${HYBRID_EG}/example.conf ${PKG_SYSCONFDIR}/ircd.conf \
			${IRCD_HYBRID_IRC_USER} ${IRCD_HYBRID_IRC_GROUP} 0640
OWN_DIRS_PERMS+=	${VARBASE}/log/ircd-hybrid \
			${IRCD_HYBRID_IRC_USER} ${IRCD_HYBRID_IRC_GROUP} 0770
OWN_DIRS_PERMS+=	${VARBASE}/log/ircd-hybrid/logs \
			${IRCD_HYBRID_IRC_USER} ${IRCD_HYBRID_IRC_GROUP} 0770
OWN_DIRS_PERMS+=	${VARBASE}/run/ircd-hybrid \
			${IRCD_HYBRID_IRC_USER} ${IRCD_HYBRID_IRC_GROUP} 0770

FILES_SUBST+=		IRCD_HYBRID_IRC_USER=${IRCD_HYBRID_IRC_USER:Q}
FILES_SUBST+=		IRCD_HYBRID_IRC_GROUP=${IRCD_HYBRID_IRC_GROUP:Q}
FILES_SUBST+=		VARBASE=${VARBASE:Q}

PKG_GROUPS=		${IRCD_HYBRID_IRC_GROUP}
PKG_USERS=		${IRCD_HYBRID_IRC_USER}:${IRCD_HYBRID_IRC_GROUP}

PKG_USERS_VARS+=	IRCD_HYBRID_IRC_USER
PKG_GROUPS_VARS+=	IRCD_HYBRID_IRC_GROUP

SUBST_CLASSES+=		paths
SUBST_MESSAGE.paths=	Fixing hardcoded paths.
SUBST_STAGE.paths=	post-patch
SUBST_FILES.paths=	etc/example.conf etc/example.efnet.conf \
			etc/example.conf.quick doc/ircd.8
SUBST_SED.paths=	-e "s|/usr/local/ircd/etc|${PKG_SYSCONFDIR}|g"
SUBST_SED.paths+=	-e "s|/usr/local/ircd/bin|${PREFIX}/bin|g"
SUBST_SED.paths+=	-e "s|/usr/local/ircd/modules|${PREFIX}/lib/ircd-hybrid/modules|g"
SUBST_SED.paths+=	-e "s|/usr/share/ircd|${PKG_SYSCONFDIR}|g"
SUBST_SED.paths+=	-e "s|/var/log|${VARBASE}/log/ircd-hybrid/logs|g"

SUBST_CLASSES+=		bpaths
SUBST_MESSAGE.bpaths=	Fixing hardcoded build paths.
SUBST_STAGE.bpaths=	post-configure
SUBST_FILES.bpaths=	include/defaults.h
SUBST_SED.bpaths=	-e "s|etc|etc/ircd-hybrid|g"
SUBST_SED.bpaths+=	-e "s|modules|lib/ircd-hybrid/modules|g"
SUBST_SED.bpaths+=	-e "s|IRCD_PREFIX \"/logs\"|\"${VARBASE}/log/ircd-hybrid/logs\"|g"
SUBST_SED.bpaths+=	-e "s|ETCPATH \"/ircd.pid\"|\"${VARBASE}/run/ircd-hybrid/ircd.pid\"|g"
SUBST_SED.bpaths+=	-e "s|messages|share/ircd-hybrid/messages|g"

CONFIGURE_ARGS+=	--with-nicklen=${IRCD_HYBRID_NICLEN:Q}
CONFIGURE_ARGS+=	--with-topiclen=${IRCD_HYBRID_TOPICLEN:Q}
CONFIGURE_ARGS+=	--enable-syslog=${IRCD_HYBRID_SYSLOG_EVENTS:Q}
CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR:Q}
CONFIGURE_ARGS+=	--localstatedir=${VARBASE}/log/ircd-hybrid
CONFIGURE_ARGS+=	--enable-clobber

.if defined(IRCD_HYBRID_SYSLOG_EVENTS) && !empty(IRCD_HYBRID_SYSLOG_EVENTS:M[Yy][Ee][Ss])
CONFIGURE_ARGS+=	--enable-syslog-facility=${IRCD_HYBRID_SYSLOG_FACILITY:Q}
.endif

.if defined(IRCD_HYBRID_MAXCONN) && !empty(IRCD_HYBRID_MAXCONN:M[Yy][Ee][Ss])
CONFIGURE_ARGS+=	--with-maxconn=${IRCD_HYBRID_MAXCONN:Q}
.endif

.include "options.mk"

post-install:
	${INSTALL_DATA} ${WRKSRC}/etc/example.conf ${DESTDIR}${HYBRID_EG}
	${INSTALL_DATA} ${WRKSRC}/etc/example.efnet.conf ${DESTDIR}${HYBRID_EG}
	${INSTALL_DATA} ${WRKSRC}/etc/example.conf.quick ${DESTDIR}${HYBRID_EG}
	${INSTALL_DATA} ${WRKSRC}/etc/simple.conf ${DESTDIR}${HYBRID_EG}

	${INSTALL_DATA} ${WRKSRC}/BUGS ${DESTDIR}${HYBRID_DOC}
	${INSTALL_DATA} ${WRKSRC}/INSTALL ${DESTDIR}${HYBRID_DOC}
	${INSTALL_DATA} ${WRKSRC}/README.FIRST ${DESTDIR}${HYBRID_DOC}
	${INSTALL_DATA} ${WRKSRC}/README.PLATFORMS ${DESTDIR}${HYBRID_DOC}
	${INSTALL_DATA} ${WRKSRC}/RELNOTES ${DESTDIR}${HYBRID_DOC}
	${INSTALL_DATA} ${WRKSRC}/messages/README \
		${DESTDIR}${HYBRID_DOC}/README.messages
	${INSTALL_DATA} ${WRKSRC}/tools/README.mkpasswd \
		${DESTDIR}${HYBRID_DOC}/README.ircd-hybrid-mkpasswd

	${RM} ${WRKSRC}/doc/Makefile
	${RM} ${WRKSRC}/doc/Makefile.in
	cd ${WRKSRC}/doc && pax -rwppm . ${DESTDIR}${HYBRID_DOC}/doc

	cd ${WRKSRC}/messages && \
		${SETENV} ${INSTALL_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} install

	${INSTALL_PROGRAM} ${WRKSRC}/tools/encspeed \
		${DESTDIR}${PREFIX}/bin/encspeed
	${INSTALL_PROGRAM} ${WRKSRC}/tools/mkpasswd \
		${DESTDIR}${PREFIX}/bin/ircd-hybrid-mkpasswd

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