summaryrefslogtreecommitdiff
path: root/chat/anope/Makefile
blob: 632e92ab02679f920b6b1922da8ffcd540ab51c3 (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
# $NetBSD: Makefile,v 1.36 2021/04/21 11:41:04 adam Exp $

DISTNAME=	anope-2.0.7-source
PKGNAME=	${DISTNAME:S/-source//1}
PKGREVISION=	8
CATEGORIES=	chat
MASTER_SITES=	${MASTER_SITE_GITHUB:=anope/}
GITHUB_PROJECT=	anope
GITHUB_RELEASE=	${PKGVERSION_NOREV}

MAINTAINER=	nia@NetBSD.org
HOMEPAGE=	https://www.anope.org/
COMMENT=	Modular set of IRC services
LICENSE=	gnu-gpl-v2

USE_LANGUAGES=	c c++
USE_TOOLS+=	msgfmt
USE_CMAKE=	yes

CMAKE_ARGS+=	-DPROGRAM_NAME=anope

CMAKE_ARGS+=	-DDISABLE_TOOLS=ON

CMAKE_ARGS+=	-DDB_DIR=anope/data
CMAKE_ARGS+=	-DCONF_DIR=${PKG_SYSCONFDIR}
CMAKE_ARGS+=	-DLIB_DIR=lib/anope
CMAKE_ARGS+=	-DLOCALE_DIR=${PKGLOCALEDIR}/locale
CMAKE_ARGS+=	-DLOGS_DIR=anope/logs

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

PKG_SYSCONFSUBDIR=	anope

ANOPE_USER?=		anope
ANOPE_GROUP?=		anope
PKG_GROUPS=		${ANOPE_GROUP}
PKG_USERS=		${ANOPE_USER}:${ANOPE_GROUP}
PKG_GROUPS_VARS=	ANOPE_USER
PKG_USERS_VARS=		ANOPE_GROUP

OWN_DIRS_PERMS+=	${PREFIX}/anope ${ANOPE_USER} ${ANOPE_GROUP} 0755
OWN_DIRS_PERMS+=	${PREFIX}/anope/data ${ANOPE_USER} ${ANOPE_GROUP} 0755
OWN_DIRS_PERMS+=	${PREFIX}/anope/logs ${ANOPE_USER} ${ANOPE_GROUP} 0755

FILES_SUBST+=		ANOPE_GROUP=${ANOPE_GROUP:Q}
FILES_SUBST+=		ANOPE_USER=${ANOPE_USER:Q}
FILES_SUBST+=		PKGLOCALEDIR=${PKGLOCALEDIR}

SUBST_CLASSES+=		conf
SUBST_STAGE.conf=	pre-configure
SUBST_MESSAGE.conf=	Set variables in configuration file.
SUBST_FILES.conf+=	data/example.conf
SUBST_VARS.conf=	PREFIX PKG_SYSCONFDIR

RCD_SCRIPTS=	anope

EGDIR=		${PREFIX}/share/examples/anope
DOCDIR=		${PREFIX}/share/doc/anope

USE_PKGLOCALEDIR=	yes

INSTALLATION_DIRS+=	${EGDIR}
INSTALLATION_DIRS+=	${DOCDIR}

CONF_FILES+=	${EGDIR}/botserv.conf ${PKG_SYSCONFDIR}/botserv.conf
CONF_FILES+=	${EGDIR}/chanserv.conf ${PKG_SYSCONFDIR}/chanserv.conf
CONF_FILES+=	${EGDIR}/chanstats.conf ${PKG_SYSCONFDIR}/chanstats.conf
CONF_FILES+=	${EGDIR}/services.conf ${PKG_SYSCONFDIR}/services.conf
CONF_FILES+=	${EGDIR}/global.conf ${PKG_SYSCONFDIR}/global.conf
CONF_FILES+=	${EGDIR}/hostserv.conf ${PKG_SYSCONFDIR}/hostserv.conf
CONF_FILES+=	${EGDIR}/irc2sql.conf ${PKG_SYSCONFDIR}/irc2sql.conf
CONF_FILES+=	${EGDIR}/memoserv.conf ${PKG_SYSCONFDIR}/memoserv.conf
CONF_FILES+=	${EGDIR}/modules.conf ${PKG_SYSCONFDIR}/modules.conf
CONF_FILES+=	${EGDIR}/nickserv.conf ${PKG_SYSCONFDIR}/nickserv.conf
CONF_FILES+=	${EGDIR}/operserv.conf ${PKG_SYSCONFDIR}/operserv.conf

.include "options.mk"

pre-configure:
.for srcfile in ${ANOPE_EXTRAS}
	${LN} -sf ${WRKSRC}/modules/extra/${srcfile} ${WRKSRC}/modules/${srcfile}
.endfor

post-install:
	${MV} ${DESTDIR}${EGDIR}/botserv.example.conf \
		${DESTDIR}${EGDIR}/botserv.conf
	${MV} ${DESTDIR}${EGDIR}/chanserv.example.conf \
		${DESTDIR}${EGDIR}/chanserv.conf
	${MV} ${DESTDIR}${EGDIR}/chanstats.example.conf \
		${DESTDIR}${EGDIR}/chanstats.conf
	${MV} ${DESTDIR}${EGDIR}/example.conf \
		${DESTDIR}${EGDIR}/services.conf
	${MV} ${DESTDIR}${EGDIR}/global.example.conf \
		${DESTDIR}${EGDIR}/global.conf
	${MV} ${DESTDIR}${EGDIR}/hostserv.example.conf \
		${DESTDIR}${EGDIR}/hostserv.conf
	${MV} ${DESTDIR}${EGDIR}/irc2sql.example.conf \
		${DESTDIR}${EGDIR}/irc2sql.conf
	${MV} ${DESTDIR}${EGDIR}/memoserv.example.conf \
		${DESTDIR}${EGDIR}/memoserv.conf
	${MV} ${DESTDIR}${EGDIR}/modules.example.conf \
		${DESTDIR}${EGDIR}/modules.conf
	${MV} ${DESTDIR}${EGDIR}/nickserv.example.conf \
		${DESTDIR}${EGDIR}/nickserv.conf
	${MV} ${DESTDIR}${EGDIR}/operserv.example.conf \
		${DESTDIR}${EGDIR}/operserv.conf
	${MV} ${DESTDIR}${EGDIR}/example.chk \
		${DESTDIR}${DOCDIR}/example.chk
	${MV} ${DESTDIR}${EGDIR}/stats.standalone.example.conf \
		${DESTDIR}${DOCDIR}/stats.standalone.example.conf

.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"