summaryrefslogtreecommitdiff
path: root/chat/atheme/Makefile
blob: eacb4edc43e6fca26397bce11c254649c6fd27be (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.20 2020/01/18 21:48:48 jperkin Exp $

DISTNAME=	atheme-v7.2.10-r2
PKGNAME=	${DISTNAME:S/-v/-/1:S/-r/.r/1}
PKGREVISION=	1
CATEGORIES=	chat
MASTER_SITES=	${MASTER_SITE_GITHUB:=atheme/}
EXTRACT_SUFX=	.tar.xz
GITHUB_PROJECT=	atheme
GITHUB_RELEASE=	v${PKGVERSION_NOREV:S/.r/-r/1}

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://atheme.github.io/atheme.html
COMMENT=	Flexible IRC services system with proven scalability
LICENSE=	isc

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

GNU_CONFIGURE=	yes
USE_TOOLS+=	gmake pkg-config
USE_TOOLS+=	msgfmt msgmerge xgettext
MAKE_JOBS_SAFE=	NO

BUILD_DEFS+=	VARBASE

PKG_SYSCONFSUBDIR=	atheme

EGDIR=			${PREFIX}/share/examples/atheme
DOC_FILES=		INSTALL README.md

ATHEME_USER?=		atheme
ATHEME_GROUP?=		atheme

RCD_SCRIPTS+=		atheme

PKG_USERS_VARS=		ATHEME_USER
PKG_GROUPS_VARS=	ATHEME_GROUP
PKG_GROUPS=		${ATHEME_GROUP}
PKG_USERS=		${ATHEME_USER}:${ATHEME_GROUP}

PKG_GECOS.${ATHEME_USER}=	atheme user

FILES_SUBST+=		ATHEME_USER=${ATHEME_USER}
FILES_SUBST+=		ATHEME_GROUP=${ATHEME_GROUP}

.include "options.mk"

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

PLIST_VARS+=		posixcrypt
.if ${OPSYS} != "Darwin"
PLIST.posixcrypt=	yes
.endif

CFLAGS.SunOS+=		-Dfaultcode_t=foo_faultcode_t
CFLAGS.SunOS+=		-Dboolean_t=foo_boolean_t

CONFIGURE_ARGS+=	--enable-reproducible-builds
CONFIGURE_ARGS+=	--enable-fhs-paths
CONFIGURE_ARGS+=	--localstatedir=${VARBASE}
CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}

CONF_FILES_PERMS=	${EGDIR}/atheme.conf.example \
			${PKG_SYSCONFDIR}/atheme.conf \
			${ATHEME_USER} ${ATHEME_GROUP} 0660
CONF_FILES_PERMS+=	${EGDIR}/atheme.cron.example \
			${PKG_SYSCONFDIR}/atheme.cron \
			${ATHEME_USER} ${ATHEME_GROUP} 0660
CONF_FILES_PERMS+=	${EGDIR}/atheme.motd.example \
			${PKG_SYSCONFDIR}/atheme.motd \
			${ATHEME_USER} ${ATHEME_GROUP} 0660
CONF_FILES_PERMS+=	${EGDIR}/atheme.conf.operserv-example \
			${PKG_SYSCONFDIR}/atheme.conf.operserv \
			${ATHEME_USER} ${ATHEME_GROUP} 0660
CONF_FILES_PERMS+=	${EGDIR}/atheme.conf.userserv-example \
			${PKG_SYSCONFDIR}/atheme.conf.userserv \
			${ATHEME_USER} ${ATHEME_GROUP} 0660

MAKE_DIRS_PERMS+=	${VARBASE}/atheme \
			${ATHEME_USER} ${ATHEME_GROUP} 0770
MAKE_DIRS_PERMS+=	${VARBASE}/log/atheme \
			${ATHEME_USER} ${ATHEME_GROUP} 0770
MAKE_DIRS_PERMS+=	${VARBASE}/run/atheme \
			${ATHEME_USER} ${ATHEME_GROUP} 0770

INSTALLATION_DIRS+=	${EGDIR}

PKGCONFIG_OVERRIDE+=	atheme-services.pc.in

# It tries to use git to generate this.
pre-build:
	${ECHO} '#define SERNO "${PKGVERSION_NOREV}-pkgsrc"' > ${WRKSRC}/include/serno.h

post-install:
	${MV} ${DESTDIR}${PREFIX}/bin/dbverify \
	    ${DESTDIR}${PREFIX}/bin/atheme-dbverify
	${MV} ${DESTDIR}${PREFIX}/bin/ecdsakeygen \
	    ${DESTDIR}${PREFIX}/bin/atheme-ecdsakeygen
	${MV} ${DESTDIR}${PKG_SYSCONFDIR}/atheme.conf.example \
	    ${DESTDIR}${EGDIR}/atheme.conf.example
	${MV} ${DESTDIR}${PKG_SYSCONFDIR}/atheme.conf.operserv-example \
	    ${DESTDIR}${EGDIR}/atheme.conf.operserv-example
	${MV} ${DESTDIR}${PKG_SYSCONFDIR}/atheme.conf.userserv-example \
	    ${DESTDIR}${EGDIR}/atheme.conf.userserv-example
	${MV} ${DESTDIR}${PKG_SYSCONFDIR}/atheme.cron.example \
	    ${DESTDIR}${EGDIR}/atheme.cron.example
	${MV} ${DESTDIR}${PKG_SYSCONFDIR}/atheme.motd.example \
	    ${DESTDIR}${EGDIR}/atheme.motd.example
	${MV} ${DESTDIR}${PKG_SYSCONFDIR}/atheme.motd \
	    ${DESTDIR}${EGDIR}/atheme.motd
.for i in ${DOC_FILES}
	${INSTALL_DATA} ${WRKSRC}/${i} ${DESTDIR}${PREFIX}/share/doc/atheme/
.endfor

.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../devel/libmowgli/buildlink3.mk"
.include "../../converters/libiconv/buildlink3.mk"
.include "../../converters/qrencode/buildlink3.mk"
.include "../../mk/dlopen.buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"