1 |
commit: a5b732589937dfc6da6faff69670900a110acdb8 |
2 |
Author: Sam Jorna <wraeth <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri May 6 13:23:21 2016 +0000 |
4 |
Commit: Sam Jorna <wraeth <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri May 6 13:24:23 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5b73258 |
7 |
|
8 |
app-misc/mosquitto: new ebuild |
9 |
|
10 |
Mosquitto is an open source MQTT broker. Ebuild added with proxied |
11 |
maintainer Neil Bothwick under the Proxy Maintainers project. |
12 |
|
13 |
Gentoo-bug: 320159 |
14 |
Package-Manager: portage-2.2.28 |
15 |
|
16 |
app-misc/mosquitto/Manifest | 1 + |
17 |
app-misc/mosquitto/files/mosquitto | 24 ++++++ |
18 |
.../files/mosquitto-1.4.8-conditional-tests.patch | 41 +++++++++ |
19 |
app-misc/mosquitto/files/mosquitto.service | 12 +++ |
20 |
app-misc/mosquitto/metadata.xml | 17 ++++ |
21 |
app-misc/mosquitto/mosquitto-1.4.8.ebuild | 97 ++++++++++++++++++++++ |
22 |
6 files changed, 192 insertions(+) |
23 |
|
24 |
diff --git a/app-misc/mosquitto/Manifest b/app-misc/mosquitto/Manifest |
25 |
new file mode 100644 |
26 |
index 0000000..7e0827a |
27 |
--- /dev/null |
28 |
+++ b/app-misc/mosquitto/Manifest |
29 |
@@ -0,0 +1 @@ |
30 |
+DIST mosquitto-1.4.8.tar.gz 326120 SHA256 d96eb5610e57cc3e273f4527d3f54358ab7711459941a9e64bc4d0a85c2acfda SHA512 4bad8683e98ec858468c53f85f53b42a4166667cebf665d11d3dabe604711f5031da007c8f6d6cb49b8bc91b87eb452bc1f8bfa6adf2d439d2223180b316f9bc WHIRLPOOL b2931c55f3e70316cb57ae180f361c1dedf67e86fec9f235aa3b817884e6af13b8b9b8dc83e375a877d85b1d423ea586ee0698b08af88873a1131d58b4ed402a |
31 |
|
32 |
diff --git a/app-misc/mosquitto/files/mosquitto b/app-misc/mosquitto/files/mosquitto |
33 |
new file mode 100644 |
34 |
index 0000000..39b1eb9 |
35 |
--- /dev/null |
36 |
+++ b/app-misc/mosquitto/files/mosquitto |
37 |
@@ -0,0 +1,24 @@ |
38 |
+#!/sbin/runscript |
39 |
+ |
40 |
+depend() { |
41 |
+ need net |
42 |
+} |
43 |
+ |
44 |
+checkconfig() { |
45 |
+ if [ ! -f /etc/${SVCNAME}/${SVCNAME}.conf ] ; then |
46 |
+ eerror "No /etc/${SVCNAME}/${SVCNAME}.conf file exists!" |
47 |
+ fi |
48 |
+} |
49 |
+ |
50 |
+start() { |
51 |
+ checkconfig || return 1 |
52 |
+ ebegin "Starting ${SVCNAME}" |
53 |
+ start-stop-daemon --start --exec /usr/sbin/${SVCNAME} --background --make-pidfile --pidfile /var/run/${SVCNAME}.pid -- --config-file /etc/${SVCNAME}/${SVCNAME}.conf |
54 |
+ eend $? |
55 |
+} |
56 |
+ |
57 |
+stop() { |
58 |
+ ebegin "Stopping ${SVCNAME}" |
59 |
+ start-stop-daemon --stop --exec /usr/sbin/${SVCNAME} --pidfile /var/run/${SVCNAME}.pid |
60 |
+ eend $? |
61 |
+} |
62 |
|
63 |
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 |
64 |
new file mode 100644 |
65 |
index 0000000..811cee6 |
66 |
--- /dev/null |
67 |
+++ b/app-misc/mosquitto/files/mosquitto-1.4.8-conditional-tests.patch |
68 |
@@ -0,0 +1,41 @@ |
69 |
+--- a/test/broker/Makefile 2016-02-14 14:36:55.000000000 +0000 |
70 |
++++ b/test/broker/Makefile 2016-05-05 09:53:30.548519257 +0100 |
71 |
+@@ -63,11 +63,13 @@ |
72 |
+ ./05-clean-session-qos1.py |
73 |
+ |
74 |
+ 06 : |
75 |
++ifeq ($(WITH_BRIDGE),yes) |
76 |
+ ./06-bridge-reconnect-local-out.py |
77 |
+ ./06-bridge-br2b-disconnect-qos1.py |
78 |
+ ./06-bridge-br2b-disconnect-qos2.py |
79 |
+ ./06-bridge-b2br-disconnect-qos1.py |
80 |
+ ./06-bridge-b2br-disconnect-qos2.py |
81 |
++endif |
82 |
+ |
83 |
+ 07 : |
84 |
+ ./07-will-qos0.py |
85 |
+@@ -85,10 +87,12 @@ |
86 |
+ ./08-ssl-connect-cert-auth-crl.py |
87 |
+ ./08-ssl-connect-identity.py |
88 |
+ ./08-ssl-connect-no-identity.py |
89 |
++ifeq ($(WITH_BRIDGE),yes) |
90 |
+ ./08-ssl-bridge.py |
91 |
+ ./08-tls-psk-pub.py |
92 |
+ ./08-tls-psk-bridge.py |
93 |
+ endif |
94 |
++endif |
95 |
+ |
96 |
+ 09 : |
97 |
+ ./09-plugin-auth-unpwd-success.py |
98 |
+--- a/test/broker/c/Makefile 2016-02-14 14:36:55.000000000 +0000 |
99 |
++++ b/test/broker/c/Makefile 2016-05-05 09:40:31.440608209 +0100 |
100 |
+@@ -13,7 +13,9 @@ |
101 |
+ $(CC) ${CFLAGS} $^ -o $@ ../../../lib/libmosquitto.so.1 |
102 |
+ |
103 |
+ 08-tls-psk-bridge.test : 08-tls-psk-bridge.c |
104 |
++ifeq ($(WITH_BRIDGE),yes) |
105 |
+ $(CC) ${CFLAGS} $^ -o $@ ../../../lib/libmosquitto.so.1 |
106 |
++endif |
107 |
+ |
108 |
+ |
109 |
+ reallyclean : clean |
110 |
|
111 |
diff --git a/app-misc/mosquitto/files/mosquitto.service b/app-misc/mosquitto/files/mosquitto.service |
112 |
new file mode 100644 |
113 |
index 0000000..ebdc28e |
114 |
--- /dev/null |
115 |
+++ b/app-misc/mosquitto/files/mosquitto.service |
116 |
@@ -0,0 +1,12 @@ |
117 |
+[Unit] |
118 |
+Description=Mosquitto MQTT Broker daemon |
119 |
+ConditionPathExists=/etc/mosquitto/mosquitto.conf |
120 |
+Requires=network.target |
121 |
+ |
122 |
+[Service] |
123 |
+Type=simple |
124 |
+ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf |
125 |
+Restart=always |
126 |
+ |
127 |
+[Install] |
128 |
+WantedBy=multi-user.target |
129 |
|
130 |
diff --git a/app-misc/mosquitto/metadata.xml b/app-misc/mosquitto/metadata.xml |
131 |
new file mode 100644 |
132 |
index 0000000..da548ae |
133 |
--- /dev/null |
134 |
+++ b/app-misc/mosquitto/metadata.xml |
135 |
@@ -0,0 +1,17 @@ |
136 |
+<?xml version='1.0' encoding='UTF-8'?> |
137 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
138 |
+<pkgmetadata> |
139 |
+ <maintainer type="person"> |
140 |
+ <email>neil@××××××××××.uk</email> |
141 |
+ <name>Neil Bothwick</name> |
142 |
+ </maintainer> |
143 |
+ <maintainer type="project"> |
144 |
+ <email>proxy-maint@g.o</email> |
145 |
+ <name>Proxy Maintainers</name> |
146 |
+ </maintainer> |
147 |
+ <use> |
148 |
+ <flag name="bridge">Enable bridge support in the MQTT broker.</flag> |
149 |
+ <flag name="persistence">Store messages and subscriptions to a file.</flag> |
150 |
+ <flag name="srv">Include SRV lookup support.</flag> |
151 |
+ </use> |
152 |
+</pkgmetadata> |
153 |
|
154 |
diff --git a/app-misc/mosquitto/mosquitto-1.4.8.ebuild b/app-misc/mosquitto/mosquitto-1.4.8.ebuild |
155 |
new file mode 100644 |
156 |
index 0000000..a9ebf16 |
157 |
--- /dev/null |
158 |
+++ b/app-misc/mosquitto/mosquitto-1.4.8.ebuild |
159 |
@@ -0,0 +1,97 @@ |
160 |
+# Copyright 1999-2016 Gentoo Foundation |
161 |
+# Distributed under the terms of the GNU General Public License v2 |
162 |
+# $Id$ |
163 |
+ |
164 |
+EAPI="5" |
165 |
+PYTHON_COMPAT=( python2_7 ) |
166 |
+ |
167 |
+inherit eutils systemd user python-any-r1 |
168 |
+ |
169 |
+DESCRIPTION="An Open Source MQTT v3 Broker" |
170 |
+HOMEPAGE="http://mosquitto.org/" |
171 |
+SRC_URI="http://mosquitto.org/files/source/${P}.tar.gz" |
172 |
+LICENSE="EPL-1.0" |
173 |
+SLOT="0" |
174 |
+KEYWORDS="~amd64 ~x86" |
175 |
+IUSE="bridge examples +persistence +srv ssl tcpd" |
176 |
+ |
177 |
+RDEPEND="tcpd? ( sys-apps/tcp-wrappers ) |
178 |
+ ssl? ( dev-libs/openssl:0= )" |
179 |
+DEPEND="${RDEPEND} |
180 |
+ ${PYTHON_DEPS} |
181 |
+ srv? ( net-dns/c-ares )" |
182 |
+ |
183 |
+LIBDIR=$(get_libdir) |
184 |
+QA_PRESTRIPPED="/usr/sbin/mosquitto |
185 |
+ /usr/bin/mosquitto_passwd |
186 |
+ /usr/bin/mosquitto_sub |
187 |
+ /usr/bin/mosquitto_pub |
188 |
+ /usr/${LIBDIR}/libmosquittopp.so.1 |
189 |
+ /usr/${LIBDIR}/libmosquitto.so.1" |
190 |
+ |
191 |
+pkg_setup() { |
192 |
+ enewgroup mosquitto |
193 |
+ enewuser mosquitto -1 -1 -1 mosquitto |
194 |
+} |
195 |
+ |
196 |
+src_prepare() { |
197 |
+ epatch "${FILESDIR}/${P}-conditional-tests.patch" |
198 |
+ if use persistence; then |
199 |
+ sed -i -e "s:^#autosave_interval:autosave_interval:" \ |
200 |
+ -e "s:^#persistence false$:persistence true:" \ |
201 |
+ -e "s:^#persistence_file:persistence_file:" \ |
202 |
+ -e "s:^#persistence_location$:persistence_location /var/lib/mosquitto/:" \ |
203 |
+ mosquitto.conf || die |
204 |
+ fi |
205 |
+ python_setup |
206 |
+ python_fix_shebang test |
207 |
+} |
208 |
+ |
209 |
+src_configure() { |
210 |
+ makeopts=( |
211 |
+ "LIB_SUFFIX=${LIBDIR:3}" |
212 |
+ "WITH_BRIDGE=$(usex bridge)" |
213 |
+ "WITH_PERSISTENCE=$(usex persistence)" |
214 |
+ "WITH_SRV=$(usex srv)" |
215 |
+ "WITH_TLS=$(usex ssl)" |
216 |
+ "WITH_WRAP=$(usex tcpd)" |
217 |
+ ) |
218 |
+ einfo "${makeopts[@]}" |
219 |
+} |
220 |
+ |
221 |
+src_compile() { |
222 |
+ emake "${makeopts[@]}" |
223 |
+} |
224 |
+ |
225 |
+src_test() { |
226 |
+ emake "${makeopts[@]}" test |
227 |
+} |
228 |
+ |
229 |
+src_install() { |
230 |
+ emake "${makeopts[@]}" DESTDIR="${D}" prefix=/usr install |
231 |
+ keepdir /var/lib/mosquitto |
232 |
+ fowners mosquitto:mosquitto /var/lib/mosquitto |
233 |
+ dodoc readme.md CONTRIBUTING.md ChangeLog.txt |
234 |
+ doinitd "${FILESDIR}"/mosquitto |
235 |
+ insinto /etc/mosquitto |
236 |
+ doins mosquitto.conf |
237 |
+ systemd_dounit "${FILESDIR}/mosquitto.service" |
238 |
+ |
239 |
+ if use examples; then |
240 |
+ docompress -x "/usr/share/doc/${PF}/examples" |
241 |
+ insinto "/usr/share/doc/${PF}/examples" |
242 |
+ doins -r examples/* |
243 |
+ fi |
244 |
+} |
245 |
+ |
246 |
+pkg_postinst() { |
247 |
+ elog "" |
248 |
+ elog "The Python module has been moved out of mosquitto." |
249 |
+ elog "See http://mosquitto.org/documentation/python/" |
250 |
+ elog "" |
251 |
+ elog "To start the mosquitto daemon at boot, add it to the default runlevel with:" |
252 |
+ elog "" |
253 |
+ elog " rc-update add mosquitto default" |
254 |
+ elog " or" |
255 |
+ elog " systemctl enable mosquitto" |
256 |
+} |