]>
Commit | Line | Data |
---|---|---|
4e9afdf1 | 1 | # TODO |
e831164d | 2 | # - initscript |
4e9afdf1 ER |
3 | Summary: An Open Source MQTT v3.1 Broker |
4 | Name: mosquitto | |
5ad35818 | 5 | Version: 1.5.1 |
b3fef442 | 6 | Release: 1 |
4e9afdf1 ER |
7 | License: BSD |
8 | Group: Applications | |
9 | Source0: http://mosquitto.org/files/source/%{name}-%{version}.tar.gz | |
5ad35818 | 10 | # Source0-md5: f98c99998a36a234f3a9d9b402b991db |
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 \ | |
94 | .. | |
95 | %{__make} | |
96 | cd .. | |
97 | ||
4e9afdf1 | 98 | %install |
5ad35818 | 99 | rm -rf $RPM_BUILD_ROOT |
4e9afdf1 ER |
100 | %{__make} -C build install \ |
101 | DESTDIR=$RPM_BUILD_ROOT | |
102 | ||
5ad35818 AM |
103 | :> $RPM_BUILD_ROOT/etc/mosquitto/aclfile |
104 | :> $RPM_BUILD_ROOT/etc/mosquitto/pskfile | |
105 | :> $RPM_BUILD_ROOT/etc/mosquitto/pwfile | |
106 | ||
4e9afdf1 ER |
107 | %clean |
108 | rm -rf $RPM_BUILD_ROOT | |
109 | ||
110 | %pre | |
e831164d ER |
111 | %groupadd -g 293 -r mosquitto |
112 | %useradd -u 293 -r -g mosquitto -d %{_sysconfdir}/%{name} -s /sbin/nologin -c "Mosquitto Broker" mosquitto | |
113 | ||
114 | if [ "$1" = "0" ]; then | |
115 | %userremove mosquitto | |
116 | %groupremove mosquitto | |
117 | fi | |
4e9afdf1 ER |
118 | |
119 | %post -n libmosquitto -p /sbin/ldconfig | |
120 | %postun -n libmosquitto -p /sbin/ldconfig | |
121 | ||
122 | %post -n libmosquittopp -p /sbin/ldconfig | |
123 | %postun -n libmosquittopp -p /sbin/ldconfig | |
124 | ||
125 | %files | |
126 | %defattr(644,root,root,755) | |
f7fb75fc | 127 | %doc LICENSE.txt CONTRIBUTING.md ChangeLog.txt readme.md examples |
4e9afdf1 ER |
128 | %dir %{_sysconfdir}/%{name} |
129 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf | |
5ad35818 AM |
130 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/aclfile |
131 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/pskfile | |
132 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/pwfile | |
4e9afdf1 ER |
133 | %attr(755,root,root) %{_bindir}/mosquitto_passwd |
134 | %attr(755,root,root) %{_sbindir}/mosquitto | |
135 | %{_mandir}/man1/mosquitto_passwd.1* | |
136 | %{_mandir}/man5/mosquitto.conf.5* | |
137 | %{_mandir}/man7/mosquitto-tls.7* | |
138 | %{_mandir}/man7/mqtt.7* | |
139 | %{_mandir}/man8/mosquitto.8* | |
140 | ||
141 | %files clients | |
142 | %defattr(644,root,root,755) | |
143 | %attr(755,root,root) %{_bindir}/mosquitto_pub | |
144 | %attr(755,root,root) %{_bindir}/mosquitto_sub | |
145 | %{_mandir}/man1/mosquitto_pub.1* | |
146 | %{_mandir}/man1/mosquitto_sub.1* | |
147 | ||
148 | %files -n libmosquitto | |
149 | %defattr(644,root,root,755) | |
150 | %attr(755,root,root) %{_libdir}/libmosquitto.so.*.*.* | |
151 | %ghost %{_libdir}/libmosquitto.so.1 | |
152 | ||
153 | %files -n libmosquitto-devel | |
154 | %defattr(644,root,root,755) | |
155 | %{_mandir}/man3/libmosquitto.3* | |
156 | %{_libdir}/libmosquitto.so | |
5ad35818 | 157 | %{_includedir}/mosquitto_broker.h |
4e9afdf1 ER |
158 | %{_includedir}/mosquitto.h |
159 | %{_includedir}/mosquitto_plugin.h | |
5ad35818 AM |
160 | %{_pkgconfigdir}/libmosquitto.pc |
161 | %{_pkgconfigdir}/libmosquittopp.pc | |
4e9afdf1 ER |
162 | |
163 | %files -n libmosquittopp | |
164 | %defattr(644,root,root,755) | |
165 | %attr(755,root,root) %{_libdir}/libmosquittopp.so.*.*.* | |
166 | %ghost %{_libdir}/libmosquittopp.so.1 | |
167 | ||
168 | %files -n libmosquittopp-devel | |
169 | %defattr(644,root,root,755) | |
170 | %{_libdir}/libmosquittopp.so | |
171 | %{_includedir}/mosquittopp.h |