diff options
author | swills <swills@FreeBSD.org> | 2014-05-25 20:20:49 +0800 |
---|---|---|
committer | swills <swills@FreeBSD.org> | 2014-05-25 20:20:49 +0800 |
commit | f82dd62e911d8c94bf7fde9ace25b37a7b51101b (patch) | |
tree | 7b79d7eea255073d2420ec977666c06cb876deaf /net/mosquitto | |
parent | 01a4b0c9f472c02e80eed54c36271d60a9f0446f (diff) | |
download | freebsd-ports-gnome-f82dd62e911d8c94bf7fde9ace25b37a7b51101b.tar.gz freebsd-ports-gnome-f82dd62e911d8c94bf7fde9ace25b37a7b51101b.tar.zst freebsd-ports-gnome-f82dd62e911d8c94bf7fde9ace25b37a7b51101b.zip |
Mosquitto is an open source implementation of a server for version 3.1 of the
MQTT protocol.
WWW: http://mosquitto.org/
PR: ports/189451
Submitted by: Joseph Benden <joe@thrallingpenguin.com>
Diffstat (limited to 'net/mosquitto')
-rw-r--r-- | net/mosquitto/Makefile | 47 | ||||
-rw-r--r-- | net/mosquitto/distinfo | 2 | ||||
-rw-r--r-- | net/mosquitto/files/mosquitto.in | 41 | ||||
-rw-r--r-- | net/mosquitto/files/patch-CMakeList.txt | 17 | ||||
-rw-r--r-- | net/mosquitto/files/patch-config.mk | 12 | ||||
-rw-r--r-- | net/mosquitto/files/patch-etc-mosquitto.conf.example | 29 | ||||
-rw-r--r-- | net/mosquitto/files/patch-lib-tls_mosq.h | 10 | ||||
-rw-r--r-- | net/mosquitto/files/patch-src-CMakeList.txt | 11 | ||||
-rw-r--r-- | net/mosquitto/pkg-descr | 4 | ||||
-rw-r--r-- | net/mosquitto/pkg-plist | 39 |
10 files changed, 212 insertions, 0 deletions
diff --git a/net/mosquitto/Makefile b/net/mosquitto/Makefile new file mode 100644 index 000000000000..c40c938ca41a --- /dev/null +++ b/net/mosquitto/Makefile @@ -0,0 +1,47 @@ +# Created by: Joseph Benden <joe@thrallingpenguin.com> +# $FreeBSD$ + +PORTNAME= mosquitto +PORTVERSION= 1.3.1 +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 + +USES= cmake +USE_PYTHON= 2 +NOCONFIGURE= yes +USE_RC_SUBR= mosquitto +MANCOMPRESSED= no +NO_MANCOMPRESS= yes +USE_LDCONFIG= yes + +USERS= nobody + +PLIST_SUB= PYTHON_VER=${PYTHON_VER} + +post-patch: + ${MV} ${WRKSRC}/mosquitto.conf ${WRKSRC}/mosquitto.conf.example + +post-install: + cd ${WRKSRC}/lib/python ; \ + ${PYTHON_CMD} ${WRKSRC}/lib/python/setup.py build ; \ + ${PYTHON_CMD} ${WRKSRC}/lib/python/setup.py install --prefix=${PREFIX} --root=${STAGEDIR} + + # 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 + +.include <bsd.port.mk> diff --git a/net/mosquitto/distinfo b/net/mosquitto/distinfo new file mode 100644 index 000000000000..cd265b60fbf8 --- /dev/null +++ b/net/mosquitto/distinfo @@ -0,0 +1,2 @@ +SHA256 (mosquitto-1.3.1.tar.gz) = 1ee649cb80e0bd0aed8476349aa4c15c667507e2fc69540f18e3a1c599ed85fd +SIZE (mosquitto-1.3.1.tar.gz) = 350381 diff --git a/net/mosquitto/files/mosquitto.in b/net/mosquitto/files/mosquitto.in new file mode 100644 index 000000000000..21b58cc7f251 --- /dev/null +++ b/net/mosquitto/files/mosquitto.in @@ -0,0 +1,41 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: mosquitto +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: shutdown + +# +# Add the following lines to /etc/rc.conf to enable mosquitto: +# +# mosquitto_enable="YES" +# mosquitto_flags="<set as needed>" +# +# See mosquitto(8) for flags +# + +. /etc/rc.subr + +name=mosquitto +rcvar=mosquitto_enable + +mosquitto_enable=${mosquitto_enable:="NO"} +mosquitto_config=${mosquitto_config:="%%PREFIX%%/etc/mosquitto/mosquitto.conf"} + +command=%%PREFIX%%/sbin/mosquitto +command_args="-c ${mosquitto_config} -d" +pidfile=$(grep pidfile ${mosquitto_config} | awk '{print($2)}') +required_files=${mosquitto_config} + +extra_commands="reload" +stop_postcmd=stop_postcmd +stop_postcmd() +{ + rm -f $pidfile +} + +load_rc_config $name +run_rc_command "$1" diff --git a/net/mosquitto/files/patch-CMakeList.txt b/net/mosquitto/files/patch-CMakeList.txt new file mode 100644 index 000000000000..dc3bd23e697a --- /dev/null +++ b/net/mosquitto/files/patch-CMakeList.txt @@ -0,0 +1,17 @@ +--- CMakeLists.txt.orig 2014-05-16 15:15:44.000000000 -0700 ++++ CMakeLists.txt 2014-05-16 15:28:39.000000000 -0700 +@@ -8,6 +8,8 @@ + + set (VERSION 1.3.1) + ++link_directories(/usr/local/lib) ++ + if (WIN32) + execute_process(COMMAND cmd /c echo %DATE% %TIME% OUTPUT_VARIABLE TIMESTAMP + OUTPUT_STRIP_TRAILING_WHITESPACE) +@@ -71,4 +73,4 @@ + # Install config file + # ======================================== + +-install(FILES mosquitto.conf aclfile.example pskfile.example pwfile.example DESTINATION ${SYSCONFDIR}) ++install(FILES mosquitto.conf.example aclfile.example pskfile.example pwfile.example DESTINATION ${SYSCONFDIR}) diff --git a/net/mosquitto/files/patch-config.mk b/net/mosquitto/files/patch-config.mk new file mode 100644 index 000000000000..f529d383fe76 --- /dev/null +++ b/net/mosquitto/files/patch-config.mk @@ -0,0 +1,12 @@ +--- config.mk.orig 2014-05-07 17:09:56.000000000 -0700 ++++ config.mk 2014-05-07 17:10:31.000000000 -0700 +@@ -213,6 +213,6 @@ + + + INSTALL?=install +-prefix=/usr/local +-mandir=${prefix}/share/man +-localedir=${prefix}/share/locale ++prefix=${PREFIX} ++mandir=${PREFIX}/share/man ++localedir=${PREFIX}/share/locale diff --git a/net/mosquitto/files/patch-etc-mosquitto.conf.example b/net/mosquitto/files/patch-etc-mosquitto.conf.example new file mode 100644 index 000000000000..a93b93d46540 --- /dev/null +++ b/net/mosquitto/files/patch-etc-mosquitto.conf.example @@ -0,0 +1,29 @@ +--- mosquitto.conf 2014-05-07 16:08:10.000000000 -0700 ++++ mosquitto.conf 2014-05-07 16:13:05.000000000 -0700 +@@ -32,7 +32,7 @@ + # This should be set to /var/run/mosquitto.pid if mosquitto is + # being run automatically on boot with an init script and + # start-stop-daemon or similar. +-#pid_file ++pid_file /var/run/mosquitto.pid + + # When run as root, drop privileges to this user and its primary + # group. +@@ -40,7 +40,7 @@ + # If run as a non-root user, this setting has no effect. + # Note that on Windows this has no effect and so mosquitto should + # be started by the user you wish it to run as. +-#user mosquitto ++user nobody + + # The maximum number of QoS 1 and 2 messages currently inflight per + # client. +@@ -133,7 +133,7 @@ + #bind_address + + # Port to use for the default listener. +-#port 1883 ++port 1883 + + # The maximum number of client connections to allow. This is + # a per listener setting. diff --git a/net/mosquitto/files/patch-lib-tls_mosq.h b/net/mosquitto/files/patch-lib-tls_mosq.h new file mode 100644 index 000000000000..59fe44b6c4ce --- /dev/null +++ b/net/mosquitto/files/patch-lib-tls_mosq.h @@ -0,0 +1,10 @@ +--- lib/tls_mosq.h.orig 2014-05-07 14:39:22.000000000 -0700 ++++ lib/tls_mosq.h 2014-05-07 14:39:47.000000000 -0700 +@@ -33,6 +33,7 @@ + #ifdef WITH_TLS + + #include <openssl/ssl.h> ++#include <sys/socket.h> + #ifdef WITH_TLS_PSK + # if OPENSSL_VERSION_NUMBER >= 0x10000000 + # define REAL_WITH_TLS_PSK diff --git a/net/mosquitto/files/patch-src-CMakeList.txt b/net/mosquitto/files/patch-src-CMakeList.txt new file mode 100644 index 000000000000..bd56d1967c51 --- /dev/null +++ b/net/mosquitto/files/patch-src-CMakeList.txt @@ -0,0 +1,11 @@ +--- src/CMakeLists.txt.orig 2014-05-16 15:17:23.000000000 -0700 ++++ src/CMakeLists.txt 2014-05-16 15:18:03.000000000 -0700 +@@ -79,7 +79,7 @@ + if (APPLE) + set (MOSQ_LIBS ${MOSQ_LIBS} dl m) + else (APPLE) +- set (MOSQ_LIBS ${MOSQ_LIBS} rt dl m) ++ set (MOSQ_LIBS ${MOSQ_LIBS} rt m) + endif (APPLE) + endif (UNIX) + diff --git a/net/mosquitto/pkg-descr b/net/mosquitto/pkg-descr new file mode 100644 index 000000000000..81a7e7cb8228 --- /dev/null +++ b/net/mosquitto/pkg-descr @@ -0,0 +1,4 @@ +Mosquitto is an open source implementation of a server for version 3.1 of the +MQTT protocol. + +WWW: http://mosquitto.org/ diff --git a/net/mosquitto/pkg-plist b/net/mosquitto/pkg-plist new file mode 100644 index 000000000000..58a2d60c6009 --- /dev/null +++ b/net/mosquitto/pkg-plist @@ -0,0 +1,39 @@ +share/man/man8/mosquitto.8.gz +share/man/man7/mqtt.7.gz +share/man/man7/mosquitto-tls.7.gz +share/man/man5/mosquitto.conf.5.gz +share/man/man3/libmosquitto.3.gz +share/man/man1/mosquitto_sub.1.gz +share/man/man1/mosquitto_pub.1.gz +share/man/man1/mosquitto_passwd.1.gz +%%PYTHON_LIBDIR%%/site-packages/mosquitto.pyc +%%PYTHON_LIBDIR%%/site-packages/mosquitto.py +%%PYTHON_LIBDIR%%/site-packages/mosquitto-1.3.1-py%%PYTHON_VER%%.egg-info +lib/libmosquittopp.so.1 +lib/libmosquittopp.so +lib/libmosquitto.so.1 +lib/libmosquitto.so +lib/libmosquitto.so.1.3.1 +lib/libmosquittopp.so.1.3.1 +include/mosquittopp.h +include/mosquitto_plugin.h +include/mosquitto.h +bin/mosquitto_sub +bin/mosquitto_pub +bin/mosquitto_passwd +sbin/mosquitto +etc/mosquitto/pwfile.example +etc/mosquitto/pskfile.example +@unexec if cmp -s %D/etc/mosquitto/mosquitto.conf %D/etc/mosquitto/mosquitto.conf.example; then rm -f %D/etc/mosquitto/mosquitto.conf; fi +etc/mosquitto/mosquitto.conf.example +@exec cp -n %B/mosquitto.conf.example %B/mosquitto.conf +etc/mosquitto/aclfile.example +@dirrmtry etc/mosquitto +@dirrmtry share/man/man8 +@dirrmtry share/man/man7 +@dirrmtry share/man/man5 +@dirrmtry share/man/man3 +@dirrmtry share/man/man1 +@dirrmtry share/man +@dirrmtry %%PYTHON_LIBDIR%%/site-packages +@dirrmtry %%PYTHON_LIBDIR%% |