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