aboutsummaryrefslogtreecommitdiff
path: root/security/i2pd/Makefile
blob: 4964e542bf50e94cdb6da3245e59ff5590ade5ea (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
64
65
66
67
68
69
70
71
72
73
74
75
PORTNAME=	i2pd
DISTVERSION=	2.49.0
CATEGORIES=	security net-p2p

MAINTAINER=	driesm@FreeBSD.org
COMMENT=	C++ implementation of I2P client
WWW=		https://i2pd.website/

LICENSE=	BSD3CLAUSE
LICENSE_FILE=	${WRKSRC}/LICENSE

BUILD_DEPENDS=	boost-libs>=1.72.0_5:devel/boost-libs
LIB_DEPENDS=	libboost_thread.so:devel/boost-libs

USES=		cmake:insource compiler:c++11-lib ssl
USE_GITHUB=	yes
GH_ACCOUNT=	PurpleI2P
USE_RC_SUBR=	${PORTNAME}

CMAKE_SOURCE_PATH=	${WRKSRC}/build

SUB_FILES=	i2pd.newsyslog.conf pkg-message
SUB_LIST=	CERTSDIR=${_CERTSDIR} \
		GROUP="${GROUPS}" \
		USER="${USERS}" \
		WRITEDATADIR=${_WRITEDATADIR}

USERS=		_i2pd
GROUPS=		_i2pd

PLIST_SUB=	GROUP="${GROUPS}" \
		USER="${USERS}"

PORTDOCS=	README.md

OPTIONS_DEFINE=		AESNI DOCS HARDENING UPNP
OPTIONS_DEFAULT=	AESNI

AESNI_DESC=	Use AES-NI instructions set
HARDENING_DESC=	Use hardening compiler flags
UPNP_DESC=	Include support for UPnP client

AESNI_CMAKE_BOOL=	WITH_AESNI

HARDENING_CMAKE_BOOL=	WITH_HARDENING

UPNP_LIB_DEPENDS=	libminiupnpc.so:net/miniupnpc
UPNP_CMAKE_BOOL=	WITH_UPNP

_CERTSDIR=	${DATADIR}/certificates
_WRITEDATADIR=	/var/db/${PORTNAME}

post-patch: # fix config file
	@${REINPLACE_CMD} -e 's|%%ETCDIR%%|${ETCDIR}|g' ${WRKSRC}/contrib/i2pd.conf
	@${REINPLACE_CMD} -e 's|%%CERTSDIR%%|${_CERTSDIR}|g' ${WRKSRC}/contrib/i2pd.conf
	@${REINPLACE_CMD} -e 's|/var/lib/${PORTNAME}|${_WRITEDATADIR}|g' ${WRKSRC}/contrib/i2pd.conf

post-install:
	${INSTALL_MAN} ${WRKSRC}/debian/${PORTNAME}.1 ${STAGEDIR}${MAN1PREFIX}/man/man1
	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d
	${INSTALL_DATA} ${WRKDIR}/i2pd.newsyslog.conf ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d/i2pd.conf.sample
	@${MKDIR} ${STAGEDIR}${ETCDIR}
	${INSTALL_DATA} ${WRKSRC}/contrib/i2pd.conf ${STAGEDIR}${ETCDIR}/i2pd.conf.sample
	${INSTALL_DATA} ${WRKSRC}/contrib/tunnels.conf ${STAGEDIR}${ETCDIR}/tunnels.conf.sample
	@(cd ${WRKSRC}/contrib/certificates && ${COPYTREE_SHARE} . ${STAGEDIR}${_CERTSDIR})
	@${MKDIR} ${STAGEDIR}/var/run/i2pd
	@${MKDIR} ${STAGEDIR}/var/log/i2pd
	@${MKDIR} ${STAGEDIR}/var/db/i2pd
	@${MKDIR} ${STAGEDIR}${ETCDIR}/tunnels.d

post-install-DOCS-on:
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>