summaryrefslogtreecommitdiffstats
path: root/net/mosquitto/Makefile
blob: 40e506ec104e594d3b188cff925bc2544aa17466 (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
# Created by: Joseph Benden <joe@thrallingpenguin.com>
# $FreeBSD$

PORTNAME=	mosquitto
PORTVERSION=	1.3.2
CATEGORIES=	net
MASTER_SITES=	http://mosquitto.org/files/source/

MAINTAINER=	joe@thrallingpenguin.com
COMMENT=	Open-Source MQTT Broker

LICENSE=	BSD3CLAUSE

LIB_DEPENDS=	libcares.so:${PORTSDIR}/dns/c-ares
BUILD_DEPENDS=	xsltproc:${PORTSDIR}/textproc/libxslt

OPTIONS_DEFAULT=PYTHON
OPTIONS_DEFINE=	PYTHON

PYTHON_DESC=	Build python driver

USES=		cmake
USE_PYTHON=	2
NOCONFIGURE=	yes
USE_RC_SUBR=	mosquitto
MANCOMPRESSED=	no
NO_MANCOMPRESS=	yes
USE_LDCONFIG=	yes

USERS=		nobody

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MPYTHON}
PLIST_SUB=	PYTHON_VER=${PYTHON_VER} NOPYTHON=""
.else
PLIST_SUB=	NOPYTHON="@comment "
.endif

post-patch:
	${MV} ${WRKSRC}/mosquitto.conf ${WRKSRC}/mosquitto.conf.example

post-install:
.if ${PORT_OPTIONS:MPYTHON}
	cd ${WRKSRC}/lib/python ; \
	${PYTHON_CMD} ${WRKSRC}/lib/python/setup.py build ; \
	${PYTHON_CMD} ${WRKSRC}/lib/python/setup.py install --prefix=${PREFIX} --root=${STAGEDIR}
.endif
	# Compress Man Pages
	${GZIP_CMD} ${STAGEDIR}${PREFIX}/share/man/man8/mosquitto.8
	${GZIP_CMD} ${STAGEDIR}${PREFIX}/share/man/man7/mqtt.7
	${GZIP_CMD} ${STAGEDIR}${PREFIX}/share/man/man7/mosquitto-tls.7
	${GZIP_CMD} ${STAGEDIR}${PREFIX}/share/man/man5/mosquitto.conf.5
	${GZIP_CMD} ${STAGEDIR}${PREFIX}/share/man/man3/libmosquitto.3
	${GZIP_CMD} ${STAGEDIR}${PREFIX}/share/man/man1/mosquitto_sub.1
	${GZIP_CMD} ${STAGEDIR}${PREFIX}/share/man/man1/mosquitto_pub.1
	${GZIP_CMD} ${STAGEDIR}${PREFIX}/share/man/man1/mosquitto_passwd.1
	# Adjust configuration files
	${MV} ${STAGEDIR}${PREFIX}/etc/mosquitto/mosquitto.conf.example ${STAGEDIR}${PREFIX}/etc/mosquitto/mosquitto.conf.sample
	${MV} ${STAGEDIR}${PREFIX}/etc/mosquitto/pwfile.example ${STAGEDIR}${PREFIX}/etc/mosquitto/pwfile.sample
	${MV} ${STAGEDIR}${PREFIX}/etc/mosquitto/pskfile.example ${STAGEDIR}${PREFIX}/etc/mosquitto/pskfile.sample
	${MV} ${STAGEDIR}${PREFIX}/etc/mosquitto/aclfile.example ${STAGEDIR}${PREFIX}/etc/mosquitto/aclfile.sample

.include <bsd.port.mk>
OpenPOWER on IntegriCloud