summaryrefslogtreecommitdiff
path: root/net-im/tox/Makefile
blob: 1b4e303edfa68dd06314299b9da7fbe4e7275454 (plain) (blame)
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
PORTNAME=	toxcore
DISTVERSION=	0.2.20
PORTREVISION=	2
PORTEPOCH=	1
CATEGORIES=	net-im net-p2p
MASTER_SITES=	https://github.com/TokTok/c-${PORTNAME}/releases/download/v${DISTVERSION}/
DISTNAME=	c-${PORTNAME}-${DISTVERSION}

MAINTAINER=	ports@FreeBSD.org
COMMENT=	ProjectTox-Core library, a decentralized and secure messenger
WWW=		https://tox.chat/

LICENSE=	GPLv3
LICENSE_FILES=	${WRKSRC}/LICENSE

LIB_DEPENDS=	libopus.so:audio/opus \
		libsodium.so:security/libsodium	\
		libvpx.so:multimedia/libvpx
TEST_DEPENDS=	googletest>0:devel/googletest

USES=		cmake:testing compiler:c++17-lang cpe pathfix pkgconfig
CPE_VENDOR=	toktok
PATHFIX_CMAKELISTSTXT=	ModulePackage.cmake
USE_LDCONFIG=	yes

PLIST_SUB=	VER=${DISTVERSION:C/0.//}.0 SO=2

CMAKE_TESTING_OFF=	CMAKE_DISABLE_FIND_PACKAGE_GTest
CMAKE_TESTING_ON=	UNITTEST
# AUTOTEST(s) are broken...

CMAKE_OFF=	CMAKE_DISABLE_FIND_PACKAGE_GTest \
		UNITTEST

OPTIONS_DEFINE=	DAEMON
OPTIONS_SUB=	yes

DAEMON_DESC=	Bootstrap daemon

DAEMON_LIB_DEPENDS=	libconfig.so:devel/libconfig
DAEMON_CMAKE_BOOL=	BOOTSTRAP_DAEMON

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MDAEMON}
USERS=		toxdht
USE_RC_SUBR=	tox-bootstrapd
SUB_LIST=	TOXDHT=${USERS}
PLIST_SUB+=	TOXDHT=${USERS}
KEYS_DIR=	/var/lib/tox-bootstrapd
PID_DIR=	/var/run/tox-bootstrapd
PKGMESSAGE=	${PKGDIR}/pkg-message.daemon
.endif

post-install:
.if ${PORT_OPTIONS:MDAEMON}
	${INSTALL_DATA} ${WRKSRC}/other/bootstrap_daemon/tox-bootstrapd.conf	\
		${STAGEDIR}${PREFIX}/etc/tox-bootstrapd.conf.sample
	${MKDIR} ${STAGEDIR}${KEYS_DIR}
	${MKDIR} ${STAGEDIR}${PID_DIR}
.endif

.include <bsd.port.mk>