diff options
author | Sam Jorna <wraeth@gentoo.org> | 2016-05-06 23:23:21 +1000 |
---|---|---|
committer | Sam Jorna <wraeth@gentoo.org> | 2016-05-06 23:24:23 +1000 |
commit | a5b732589937dfc6da6faff69670900a110acdb8 (patch) | |
tree | 3c3680c8200b99e5ce5463e24da8a18ce2aa6e30 /app-misc/mosquitto | |
parent | app-emacs/emacs-daemon: Version bump. (diff) | |
download | gentoo-a5b732589937dfc6da6faff69670900a110acdb8.tar.gz gentoo-a5b732589937dfc6da6faff69670900a110acdb8.tar.bz2 gentoo-a5b732589937dfc6da6faff69670900a110acdb8.zip |
app-misc/mosquitto: new ebuild
Mosquitto is an open source MQTT broker. Ebuild added with proxied
maintainer Neil Bothwick under the Proxy Maintainers project.
Gentoo-bug: 320159
Package-Manager: portage-2.2.28
Diffstat (limited to 'app-misc/mosquitto')
-rw-r--r-- | app-misc/mosquitto/Manifest | 1 | ||||
-rw-r--r-- | app-misc/mosquitto/files/mosquitto | 24 | ||||
-rw-r--r-- | app-misc/mosquitto/files/mosquitto-1.4.8-conditional-tests.patch | 41 | ||||
-rw-r--r-- | app-misc/mosquitto/files/mosquitto.service | 12 | ||||
-rw-r--r-- | app-misc/mosquitto/metadata.xml | 17 | ||||
-rw-r--r-- | app-misc/mosquitto/mosquitto-1.4.8.ebuild | 97 |
6 files changed, 192 insertions, 0 deletions
diff --git a/app-misc/mosquitto/Manifest b/app-misc/mosquitto/Manifest new file mode 100644 index 000000000000..7e0827adf306 --- /dev/null +++ b/app-misc/mosquitto/Manifest @@ -0,0 +1 @@ +DIST mosquitto-1.4.8.tar.gz 326120 SHA256 d96eb5610e57cc3e273f4527d3f54358ab7711459941a9e64bc4d0a85c2acfda SHA512 4bad8683e98ec858468c53f85f53b42a4166667cebf665d11d3dabe604711f5031da007c8f6d6cb49b8bc91b87eb452bc1f8bfa6adf2d439d2223180b316f9bc WHIRLPOOL b2931c55f3e70316cb57ae180f361c1dedf67e86fec9f235aa3b817884e6af13b8b9b8dc83e375a877d85b1d423ea586ee0698b08af88873a1131d58b4ed402a diff --git a/app-misc/mosquitto/files/mosquitto b/app-misc/mosquitto/files/mosquitto new file mode 100644 index 000000000000..39b1eb96ccc2 --- /dev/null +++ b/app-misc/mosquitto/files/mosquitto @@ -0,0 +1,24 @@ +#!/sbin/runscript + +depend() { + need net +} + +checkconfig() { + if [ ! -f /etc/${SVCNAME}/${SVCNAME}.conf ] ; then + eerror "No /etc/${SVCNAME}/${SVCNAME}.conf file exists!" + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting ${SVCNAME}" + start-stop-daemon --start --exec /usr/sbin/${SVCNAME} --background --make-pidfile --pidfile /var/run/${SVCNAME}.pid -- --config-file /etc/${SVCNAME}/${SVCNAME}.conf + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --exec /usr/sbin/${SVCNAME} --pidfile /var/run/${SVCNAME}.pid + eend $? +} diff --git a/app-misc/mosquitto/files/mosquitto-1.4.8-conditional-tests.patch b/app-misc/mosquitto/files/mosquitto-1.4.8-conditional-tests.patch new file mode 100644 index 000000000000..811cee645c9a --- /dev/null +++ b/app-misc/mosquitto/files/mosquitto-1.4.8-conditional-tests.patch @@ -0,0 +1,41 @@ +--- a/test/broker/Makefile 2016-02-14 14:36:55.000000000 +0000 ++++ b/test/broker/Makefile 2016-05-05 09:53:30.548519257 +0100 +@@ -63,11 +63,13 @@ + ./05-clean-session-qos1.py + + 06 : ++ifeq ($(WITH_BRIDGE),yes) + ./06-bridge-reconnect-local-out.py + ./06-bridge-br2b-disconnect-qos1.py + ./06-bridge-br2b-disconnect-qos2.py + ./06-bridge-b2br-disconnect-qos1.py + ./06-bridge-b2br-disconnect-qos2.py ++endif + + 07 : + ./07-will-qos0.py +@@ -85,10 +87,12 @@ + ./08-ssl-connect-cert-auth-crl.py + ./08-ssl-connect-identity.py + ./08-ssl-connect-no-identity.py ++ifeq ($(WITH_BRIDGE),yes) + ./08-ssl-bridge.py + ./08-tls-psk-pub.py + ./08-tls-psk-bridge.py + endif ++endif + + 09 : + ./09-plugin-auth-unpwd-success.py +--- a/test/broker/c/Makefile 2016-02-14 14:36:55.000000000 +0000 ++++ b/test/broker/c/Makefile 2016-05-05 09:40:31.440608209 +0100 +@@ -13,7 +13,9 @@ + $(CC) ${CFLAGS} $^ -o $@ ../../../lib/libmosquitto.so.1 + + 08-tls-psk-bridge.test : 08-tls-psk-bridge.c ++ifeq ($(WITH_BRIDGE),yes) + $(CC) ${CFLAGS} $^ -o $@ ../../../lib/libmosquitto.so.1 ++endif + + + reallyclean : clean diff --git a/app-misc/mosquitto/files/mosquitto.service b/app-misc/mosquitto/files/mosquitto.service new file mode 100644 index 000000000000..ebdc28e3448a --- /dev/null +++ b/app-misc/mosquitto/files/mosquitto.service @@ -0,0 +1,12 @@ +[Unit] +Description=Mosquitto MQTT Broker daemon +ConditionPathExists=/etc/mosquitto/mosquitto.conf +Requires=network.target + +[Service] +Type=simple +ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/app-misc/mosquitto/metadata.xml b/app-misc/mosquitto/metadata.xml new file mode 100644 index 000000000000..da548ae04a82 --- /dev/null +++ b/app-misc/mosquitto/metadata.xml @@ -0,0 +1,17 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>neil@digimed.co.uk</email> + <name>Neil Bothwick</name> + </maintainer> + <maintainer type="project"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <use> + <flag name="bridge">Enable bridge support in the MQTT broker.</flag> + <flag name="persistence">Store messages and subscriptions to a file.</flag> + <flag name="srv">Include SRV lookup support.</flag> + </use> +</pkgmetadata> diff --git a/app-misc/mosquitto/mosquitto-1.4.8.ebuild b/app-misc/mosquitto/mosquitto-1.4.8.ebuild new file mode 100644 index 000000000000..a9ebf1685599 --- /dev/null +++ b/app-misc/mosquitto/mosquitto-1.4.8.ebuild @@ -0,0 +1,97 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI="5" +PYTHON_COMPAT=( python2_7 ) + +inherit eutils systemd user python-any-r1 + +DESCRIPTION="An Open Source MQTT v3 Broker" +HOMEPAGE="http://mosquitto.org/" +SRC_URI="http://mosquitto.org/files/source/${P}.tar.gz" +LICENSE="EPL-1.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="bridge examples +persistence +srv ssl tcpd" + +RDEPEND="tcpd? ( sys-apps/tcp-wrappers ) + ssl? ( dev-libs/openssl:0= )" +DEPEND="${RDEPEND} + ${PYTHON_DEPS} + srv? ( net-dns/c-ares )" + +LIBDIR=$(get_libdir) +QA_PRESTRIPPED="/usr/sbin/mosquitto + /usr/bin/mosquitto_passwd + /usr/bin/mosquitto_sub + /usr/bin/mosquitto_pub + /usr/${LIBDIR}/libmosquittopp.so.1 + /usr/${LIBDIR}/libmosquitto.so.1" + +pkg_setup() { + enewgroup mosquitto + enewuser mosquitto -1 -1 -1 mosquitto +} + +src_prepare() { + epatch "${FILESDIR}/${P}-conditional-tests.patch" + if use persistence; then + sed -i -e "s:^#autosave_interval:autosave_interval:" \ + -e "s:^#persistence false$:persistence true:" \ + -e "s:^#persistence_file:persistence_file:" \ + -e "s:^#persistence_location$:persistence_location /var/lib/mosquitto/:" \ + mosquitto.conf || die + fi + python_setup + python_fix_shebang test +} + +src_configure() { + makeopts=( + "LIB_SUFFIX=${LIBDIR:3}" + "WITH_BRIDGE=$(usex bridge)" + "WITH_PERSISTENCE=$(usex persistence)" + "WITH_SRV=$(usex srv)" + "WITH_TLS=$(usex ssl)" + "WITH_WRAP=$(usex tcpd)" + ) + einfo "${makeopts[@]}" +} + +src_compile() { + emake "${makeopts[@]}" +} + +src_test() { + emake "${makeopts[@]}" test +} + +src_install() { + emake "${makeopts[@]}" DESTDIR="${D}" prefix=/usr install + keepdir /var/lib/mosquitto + fowners mosquitto:mosquitto /var/lib/mosquitto + dodoc readme.md CONTRIBUTING.md ChangeLog.txt + doinitd "${FILESDIR}"/mosquitto + insinto /etc/mosquitto + doins mosquitto.conf + systemd_dounit "${FILESDIR}/mosquitto.service" + + if use examples; then + docompress -x "/usr/share/doc/${PF}/examples" + insinto "/usr/share/doc/${PF}/examples" + doins -r examples/* + fi +} + +pkg_postinst() { + elog "" + elog "The Python module has been moved out of mosquitto." + elog "See http://mosquitto.org/documentation/python/" + elog "" + elog "To start the mosquitto daemon at boot, add it to the default runlevel with:" + elog "" + elog " rc-update add mosquitto default" + elog " or" + elog " systemctl enable mosquitto" +} |