]>
Commit | Line | Data |
---|---|---|
4e9afdf1 | 1 | # TODO |
e831164d | 2 | # - initscript |
4e9afdf1 ER |
3 | Summary: An Open Source MQTT v3.1 Broker |
4 | Name: mosquitto | |
517b6e7d | 5 | Version: 1.6.9 |
11fa4df6 | 6 | Release: 2 |
4e9afdf1 ER |
7 | License: BSD |
8 | Group: Applications | |
9 | Source0: http://mosquitto.org/files/source/%{name}-%{version}.tar.gz | |
517b6e7d | 10 | # Source0-md5: 52f5078ec18aaf623b14dfb121fd534b |
4e9afdf1 ER |
11 | URL: http://mosquitto.org/ |
12 | BuildRequires: cmake | |
13 | BuildRequires: libstdc++-devel | |
14 | BuildRequires: libwrap-devel | |
15 | BuildRequires: openssl-devel | |
4e9afdf1 ER |
16 | BuildRequires: rpmbuild(macros) >= 1.219 |
17 | BuildRequires: sqlite3-devel >= 3.5 | |
e831164d ER |
18 | Requires(postun): /usr/sbin/groupdel |
19 | Requires(postun): /usr/sbin/userdel | |
20 | Requires(pre): /bin/id | |
21 | Requires(pre): /usr/bin/getgid | |
22 | Requires(pre): /usr/sbin/groupadd | |
23 | Requires(pre): /usr/sbin/useradd | |
3e97cdf8 | 24 | Suggests: %{name}-clients |
e831164d ER |
25 | Provides: group(mosquitto) |
26 | Provides: user(mosquitto) | |
4e9afdf1 ER |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
28 | ||
29 | %description | |
30 | Mosquitto is an open source (BSD licensed) message broker that | |
31 | implements the MQ Telemetry Transport protocol version 3.1. MQTT | |
32 | provides a lightweight method of carrying out messaging using a | |
33 | publish/subscribe model. This makes it suitable for "machine to | |
34 | machine" messaging such as with low power sensors or mobile devices | |
35 | such as phones, embedded computers or micro-controllers like the | |
36 | Arduino. | |
37 | ||
38 | %package clients | |
39 | Summary: Mosquitto command line pub/sub clients | |
40 | Group: Applications/Networking | |
41 | Requires: libmosquitto = %{version}-%{release} | |
42 | ||
43 | %description clients | |
44 | This is two MQTT version 3 clients. The first can publish messages to | |
45 | a broker, the second can subscribe to multiple topics on a broker. | |
46 | ||
47 | %package -n libmosquitto | |
48 | Summary: MQTT C client library | |
49 | Group: Development/Libraries | |
50 | ||
51 | %description -n libmosquitto | |
52 | This is a library that provides a means of implementing MQTT version 3 | |
53 | clients. MQTT provides a lightweight method of carrying out messaging | |
54 | using a publish/subscribe model. | |
55 | ||
56 | %package -n libmosquitto-devel | |
57 | Summary: MQTT C client library development files | |
58 | Group: Development/Libraries | |
59 | Group: Development/Libraries | |
60 | Requires: libmosquitto = %{version}-%{release} | |
61 | ||
62 | %description -n libmosquitto-devel | |
63 | This is a library that provides a means of implementing MQTT version 3 | |
64 | clients. MQTT provides a lightweight method of carrying out messaging | |
65 | using a publish/subscribe model. | |
66 | ||
67 | %package -n libmosquittopp | |
68 | Summary: MQTT C++ client library | |
69 | Group: Development/Libraries | |
70 | ||
71 | %description -n libmosquittopp | |
72 | This is a library that provides a means of implementing MQTT version 3 | |
73 | clients. MQTT provides a lightweight method of carrying out messaging | |
74 | using a publish/subscribe model. | |
75 | ||
76 | %package -n libmosquittopp-devel | |
77 | Summary: MQTT C++ client library development files | |
78 | Group: Development/Libraries | |
79 | Requires: libmosquittopp = %{version}-%{release} | |
80 | ||
81 | %description -n libmosquittopp-devel | |
82 | This is a library that provides a means of implementing MQTT version 3 | |
83 | clients. MQTT provides a lightweight method of carrying out messaging | |
84 | using a publish/subscribe model. | |
85 | ||
4e9afdf1 ER |
86 | %prep |
87 | %setup -q | |
88 | ||
89 | %build | |
90 | install -d build | |
91 | cd build | |
92 | %cmake \ | |
93 | -DUSE_LIBWRAP:BOOL=ON \ | |
517b6e7d | 94 | -DWITH_BUNDLED_DEPS:BOOL=ON \ |
4e9afdf1 ER |
95 | .. |
96 | %{__make} | |
97 | cd .. | |
98 | ||
4e9afdf1 | 99 | %install |
5ad35818 | 100 | rm -rf $RPM_BUILD_ROOT |
4e9afdf1 ER |
101 | %{__make} -C build install \ |
102 | DESTDIR=$RPM_BUILD_ROOT | |
103 | ||
5ad35818 AM |
104 | :> $RPM_BUILD_ROOT/etc/mosquitto/aclfile |
105 | :> $RPM_BUILD_ROOT/etc/mosquitto/pskfile | |
106 | :> $RPM_BUILD_ROOT/etc/mosquitto/pwfile | |
107 | ||
4e9afdf1 ER |
108 | %clean |
109 | rm -rf $RPM_BUILD_ROOT | |
110 | ||
111 | %pre | |
e831164d ER |
112 | %groupadd -g 293 -r mosquitto |
113 | %useradd -u 293 -r -g mosquitto -d %{_sysconfdir}/%{name} -s /sbin/nologin -c "Mosquitto Broker" mosquitto | |
114 | ||
115 | if [ "$1" = "0" ]; then | |
116 | %userremove mosquitto | |
117 | %groupremove mosquitto | |
118 | fi | |
4e9afdf1 ER |
119 | |
120 | %post -n libmosquitto -p /sbin/ldconfig | |
121 | %postun -n libmosquitto -p /sbin/ldconfig | |
122 | ||
123 | %post -n libmosquittopp -p /sbin/ldconfig | |
124 | %postun -n libmosquittopp -p /sbin/ldconfig | |
125 | ||
126 | %files | |
127 | %defattr(644,root,root,755) | |
f7fb75fc | 128 | %doc LICENSE.txt CONTRIBUTING.md ChangeLog.txt readme.md examples |
4e9afdf1 ER |
129 | %dir %{_sysconfdir}/%{name} |
130 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf | |
5ad35818 AM |
131 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/aclfile |
132 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/pskfile | |
133 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/pwfile | |
4e9afdf1 ER |
134 | %attr(755,root,root) %{_bindir}/mosquitto_passwd |
135 | %attr(755,root,root) %{_sbindir}/mosquitto | |
136 | %{_mandir}/man1/mosquitto_passwd.1* | |
137 | %{_mandir}/man5/mosquitto.conf.5* | |
138 | %{_mandir}/man7/mosquitto-tls.7* | |
139 | %{_mandir}/man7/mqtt.7* | |
140 | %{_mandir}/man8/mosquitto.8* | |
141 | ||
142 | %files clients | |
143 | %defattr(644,root,root,755) | |
144 | %attr(755,root,root) %{_bindir}/mosquitto_pub | |
517b6e7d | 145 | %attr(755,root,root) %{_bindir}/mosquitto_rr |
4e9afdf1 ER |
146 | %attr(755,root,root) %{_bindir}/mosquitto_sub |
147 | %{_mandir}/man1/mosquitto_pub.1* | |
517b6e7d | 148 | %{_mandir}/man1/mosquitto_rr.1* |
4e9afdf1 ER |
149 | %{_mandir}/man1/mosquitto_sub.1* |
150 | ||
151 | %files -n libmosquitto | |
152 | %defattr(644,root,root,755) | |
153 | %attr(755,root,root) %{_libdir}/libmosquitto.so.*.*.* | |
154 | %ghost %{_libdir}/libmosquitto.so.1 | |
155 | ||
156 | %files -n libmosquitto-devel | |
157 | %defattr(644,root,root,755) | |
158 | %{_mandir}/man3/libmosquitto.3* | |
159 | %{_libdir}/libmosquitto.so | |
5ad35818 | 160 | %{_includedir}/mosquitto_broker.h |
4e9afdf1 ER |
161 | %{_includedir}/mosquitto.h |
162 | %{_includedir}/mosquitto_plugin.h | |
5ad35818 AM |
163 | %{_pkgconfigdir}/libmosquitto.pc |
164 | %{_pkgconfigdir}/libmosquittopp.pc | |
4e9afdf1 ER |
165 | |
166 | %files -n libmosquittopp | |
167 | %defattr(644,root,root,755) | |
168 | %attr(755,root,root) %{_libdir}/libmosquittopp.so.*.*.* | |
169 | %ghost %{_libdir}/libmosquittopp.so.1 | |
170 | ||
171 | %files -n libmosquittopp-devel | |
172 | %defattr(644,root,root,755) | |
173 | %{_libdir}/libmosquittopp.so | |
174 | %{_includedir}/mosquittopp.h |