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