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