]>
Commit | Line | Data |
---|---|---|
beed1a42 AM |
1 | # TODO: |
2 | # - package all deps (tarballs 10-29) into separate spec files | |
3 | # (like in fedora) | |
e9f604ed | 4 | # Conditional build: |
5 | %bcond_with pam # PAM authentication support | |
046546ef | 6 | %bcond_without logdb # enable mod_logdb (server-side message logging) |
c4f8aa56 | 7 | %bcond_with weaker_crypto # enable SSLv3 |
eddf5b64 | 8 | |
fb70a56e | 9 | Summary: Fault-tolerant distributed Jabber/XMPP server |
7abad569 | 10 | Summary(pl.UTF-8): Odporny na awarie rozproszony serwer Jabbera/XMPP |
d798517a | 11 | Name: ejabberd |
98471d6b | 12 | Version: 17.04 |
bb18ce72 | 13 | Release: 0.3 |
fb70a56e JK |
14 | License: GPL |
15 | Group: Applications/Communications | |
d798517a | 16 | Source0: http://www.process-one.net/downloads/ejabberd/%{version}/%{name}-%{version}.tgz |
98471d6b | 17 | # Source0-md5: 70b761fb8327bc8653b12e2bf20fb0d1 |
d798517a JK |
18 | Source1: %{name}.init |
19 | Source2: %{name}.sysconfig | |
20 | Source3: %{name}.service | |
f20002e6 | 21 | Source4: %{name}.logrotate |
e2bda3a7 JK |
22 | # |
23 | # Archives created with the ejabberd-pack_deps.sh script (in this repo) | |
4a4da908 | 24 | Source10: ejabberd-cache_tab-20170322.tar.gz |
98471d6b | 25 | # Source10-md5: 5a5dcf4b1d557d15cc0c4b666116acf7 |
4a4da908 | 26 | Source11: ejabberd-elixir-20160606.tar.gz |
98471d6b | 27 | # Source11-md5: 23a6672b27b2051f00be16b3ea1b24dd |
4a4da908 | 28 | Source12: ejabberd-esip-20170322.tar.gz |
98471d6b | 29 | # Source12-md5: cb4809d69accbee7cc93978ab5860642 |
4a4da908 | 30 | Source13: ejabberd-ezlib-20170110.tar.gz |
98471d6b | 31 | # Source13-md5: 01dcf2e0d42859b24013819cde57eee0 |
4a4da908 | 32 | Source14: ejabberd-fast_tls-20170320.tar.gz |
98471d6b | 33 | # Source14-md5: 9b87963d6a219bc1a88994affadfa3f6 |
4a4da908 | 34 | Source15: ejabberd-fast_xml-20170214.tar.gz |
98471d6b | 35 | # Source15-md5: da8a6c6b9fbe566bc2445368f098511e |
4a4da908 | 36 | Source16: ejabberd-fast_yaml-20170322.tar.gz |
98471d6b | 37 | # Source16-md5: afacf731efffdae424791365752d55a3 |
4a4da908 | 38 | Source17: ejabberd-goldrush-20151116.tar.gz |
98471d6b | 39 | # Source17-md5: 5a94b1dc7a102e30259c5caaa40722c8 |
4a4da908 | 40 | Source18: ejabberd-iconv-20170322.tar.gz |
98471d6b | 41 | # Source18-md5: 093db5827c56fe67f7036902b6a01e4c |
4a4da908 | 42 | Source19: ejabberd-jiffy-20160331.tar.gz |
98471d6b | 43 | # Source19-md5: 598b3f0bc0db83d9e7e50fedfecb3977 |
4a4da908 | 44 | Source20: ejabberd-lager-20160610.tar.gz |
98471d6b | 45 | # Source20-md5: 90f9a92699ba0a18cadaebf7dde4f81e |
4a4da908 | 46 | Source21: ejabberd-luerl-20151210.tar.gz |
98471d6b | 47 | # Source21-md5: ede0306e7b28a0dd99f1948f0f8dde45 |
4a4da908 | 48 | Source22: ejabberd-p1_mysql-20161125.tar.gz |
98471d6b | 49 | # Source22-md5: 803bc540b14afc7579cfb7f2b2a9ca91 |
4a4da908 | 50 | Source23: ejabberd-p1_oauth2-20160123.tar.gz |
98471d6b | 51 | # Source23-md5: d5671f08c043734138c54c3a33d2033f |
4a4da908 | 52 | Source24: ejabberd-p1_pgsql-20170110.tar.gz |
98471d6b AM |
53 | # Source24-md5: b9f19498dabeaf796a9a0cd3cb782dd0 |
54 | Source25: ejabberd-p1_utils-20170411.tar.gz | |
55 | # Source25-md5: f645c6b1789ba435daa26cb16843855a | |
4a4da908 | 56 | Source26: ejabberd-rebar_elixir_plugin-20160105.tar.gz |
98471d6b | 57 | # Source26-md5: 36b4996aa60cf9a70e3484f4804ebda1 |
4a4da908 | 58 | Source27: ejabberd-stringprep-20170322.tar.gz |
98471d6b | 59 | # Source27-md5: d7e905548974743c03b5d66f7d9aba33 |
4a4da908 | 60 | Source28: ejabberd-stun-20170322.tar.gz |
98471d6b | 61 | # Source28-md5: 9909596a875824b3ef517ca53d7c5358 |
4a4da908 | 62 | Source29: ejabberd-xmpp-20170322.tar.gz |
98471d6b | 63 | # Source29-md5: 467ec3065ffd7b8d2387505b91b85e2b |
e2bda3a7 | 64 | # |
d798517a JK |
65 | Patch0: %{name}-paths.patch |
66 | Patch1: %{name}-config.patch | |
bb18ce72 | 67 | # https://github.com/paleg/ejabberd/tree/16.04-mod_logdb |
d798517a | 68 | Patch3: %{name}-mod_logdb.patch |
c4f8aa56 | 69 | Patch4: %{name}-no_sslv3_or_3des.patch |
3f2196e7 | 70 | URL: http://www.ejabberd.im/ |
fb70a56e | 71 | BuildRequires: autoconf |
1a2644b6 | 72 | BuildRequires: automake |
a306e2ac | 73 | BuildRequires: erlang >= 1:R16B03 |
6f0d08c1 | 74 | BuildRequires: expat-devel >= 1.95 |
75 | BuildRequires: openssl-devel | |
e9f604ed | 76 | %if %{with pam} |
77 | BuildRequires: pam-devel | |
78 | %endif | |
126fba49 | 79 | BuildRequires: git-core |
67271627 | 80 | BuildRequires: rpmbuild(macros) >= 1.671 |
60c3a68c | 81 | BuildRequires: yaml-devel |
01f61704 | 82 | BuildRequires: zlib-devel |
27b10c8b | 83 | Requires(post): /usr/bin/perl |
b15a901d | 84 | Requires(post): jabber-common |
0d54398f | 85 | Requires(post): sed >= 4.0 |
fb70a56e | 86 | Requires(post): textutils |
fb70a56e | 87 | Requires(post,preun): /sbin/chkconfig |
67271627 | 88 | Requires(post,preun,postun): systemd-units >= 38 |
9a105ba4 | 89 | Requires: erlang >= 1:R15B01 |
bb159536 | 90 | Requires: expat >= 1.95 |
27b10c8b | 91 | Requires: rc-scripts |
67271627 | 92 | Requires: systemd-units >= 38 |
028763ab | 93 | Conflicts: logrotate < 3.8.0 |
fb70a56e JK |
94 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
95 | ||
fcf4c7a2 JK |
96 | %define _noautoprovfiles %{_libdir}/%{name}/priv/lib/ |
97 | ||
fb70a56e | 98 | %description |
472227c5 | 99 | ejabberd is a Free and Open Source fault-tolerant distributed Jabber |
100 | server. It is written mostly in Erlang. | |
fb70a56e | 101 | |
e0166ea5 JR |
102 | %description -l pl.UTF-8 |
103 | ejabberd to darmowy, z otwartymi źródłami, odporny na awarie | |
104 | rozproszony serwer Jabbera. Jest napisany w większości w Erlangu. | |
378431cb | 105 | |
cba58599 | 106 | %package logdb |
1a2644b6 | 107 | Summary: Server-side logging module |
cba58599 | 108 | Group: Applications/Communications |
109 | Requires: %{name} = %{version}-%{release} | |
110 | ||
111 | %description logdb | |
112 | Server-side logging module. | |
113 | ||
fb70a56e | 114 | %prep |
beed1a42 | 115 | %setup -q -a 10 -a 11 -a 12 -a 13 -a 14 -a 15 -a 16 -a 17 -a 18 -a 19 -a 20 -a 21 -a 22 -a 23 -a 24 -a 25 -a 26 -a 27 -a 28 -a 29 |
fb70a56e | 116 | %patch0 -p1 |
7f71a53c JK |
117 | %patch1 -p1 |
118 | #%%patch2 -p1 | |
9953f9cb | 119 | %if %{with logdb} |
046546ef | 120 | %patch3 -p1 |
9953f9cb | 121 | %endif |
c4f8aa56 JK |
122 | %if %{without weaker_crypto} |
123 | %patch4 -p1 | |
124 | %endif | |
fb70a56e | 125 | |
8e141538 JK |
126 | # Various parts of the build system use 'git describe' |
127 | # which returns nonsense on manual builds using the builder script | |
128 | # and which fails on the PLD builders | |
129 | # I was not able to locate all 'git describe' invocation, sot let's | |
130 | # fool them with this dummy repository | |
131 | unset GIT_DIR GIT_WORK_TREE | |
132 | git init | |
d798661f JK |
133 | git config user.email "dummy@example.com" |
134 | git config user.name "Dummy" | |
8e141538 JK |
135 | git add configure.ac |
136 | git commit -a -m "dummy commit" | |
137 | git tag "%{version}" | |
fb8f9840 | 138 | |
fb70a56e | 139 | %build |
8e141538 | 140 | unset GIT_DIR GIT_WORK_TREE |
e2bda3a7 | 141 | %{__aclocal} -I m4 |
fb70a56e | 142 | %{__autoconf} |
6b419144 | 143 | %configure \ |
5613d9b6 | 144 | %{?with_pam --enable-pam} \ |
e4f8c955 | 145 | --enable-user=jabber \ |
8311848d | 146 | --enable-elixir \ |
e2bda3a7 | 147 | --enable-full-xml \ |
e2bda3a7 JK |
148 | --enable-odbc \ |
149 | --enable-mysql \ | |
150 | --enable-pgsql \ | |
151 | %{?with_pam:--enable-pam} \ | |
152 | --enable-zlib \ | |
beed1a42 | 153 | --enable-iconv |
5e08a6fd | 154 | |
e2bda3a7 JK |
155 | touch deps/.got |
156 | ||
beed1a42 | 157 | cd deps/iconv |
e2bda3a7 JK |
158 | %configure |
159 | cd ../.. | |
beed1a42 | 160 | cd deps/stringprep |
e2bda3a7 JK |
161 | %configure |
162 | cd ../.. | |
beed1a42 | 163 | cd deps/fast_tls |
e2bda3a7 JK |
164 | %configure |
165 | cd ../.. | |
beed1a42 AM |
166 | cd deps/fast_xml |
167 | %configure | |
e2bda3a7 | 168 | cd ../.. |
beed1a42 | 169 | cd deps/fast_yaml |
e2bda3a7 JK |
170 | %configure |
171 | cd ../.. | |
beed1a42 | 172 | cd deps/ezlib |
e2bda3a7 JK |
173 | %configure |
174 | cd ../.. | |
c6f5b587 AM |
175 | cd deps/esip |
176 | %configure | |
177 | cd ../.. | |
e2bda3a7 | 178 | |
beed1a42 AM |
179 | # for elixir VM |
180 | LC_ALL=en_US.UTF-8; export LC_ALL | |
92a38251 | 181 | %{__make} -j1 |
fb70a56e JK |
182 | |
183 | %install | |
184 | rm -rf $RPM_BUILD_ROOT | |
d798517a | 185 | install -d $RPM_BUILD_ROOT{/var/lib/%{name},/etc/{sysconfig,rc.d/init.d}} \ |
f20002e6 | 186 | $RPM_BUILD_ROOT{%{systemdunitdir},%{_sbindir}} \ |
028763ab | 187 | $RPM_BUILD_ROOT{/etc/logrotate.d,/var/log/archive/%{name}} |
fb70a56e | 188 | |
8e141538 JK |
189 | unset GIT_DIR GIT_WORK_TREE |
190 | ||
e2bda3a7 | 191 | %{__make} install -j1 \ |
e4f8c955 JK |
192 | CHOWN_COMMAND=true \ |
193 | O_USER="" \ | |
194 | G_USER="" \ | |
27b10c8b | 195 | DESTDIR=$RPM_BUILD_ROOT |
fb70a56e | 196 | |
d798517a | 197 | sed -e's,@libdir@,%{_libdir},g' -e 's,@EJABBERD_DOC_PATH@,%{_docdir}/%{name}-%{version}/doc,g' %{SOURCE1} > $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
126fba49 AM |
198 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} |
199 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service | |
200 | cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} | |
fb70a56e | 201 | |
d798517a | 202 | chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{name}* |
fb70a56e | 203 | |
beed1a42 | 204 | chmod 755 $RPM_BUILD_ROOT%{_libdir}/*/priv/lib/*.so |
5613d9b6 | 205 | |
e2bda3a7 JK |
206 | rm -rf _doc 2>/dev/null || : |
207 | mv $RPM_BUILD_ROOT%{_docdir}/%{name} _doc | |
059c0bab | 208 | |
fcf4c7a2 JK |
209 | touch $RPM_BUILD_ROOT%{_sysconfdir}/jabber/ejabberd.cfg |
210 | touch $RPM_BUILD_ROOT/var/lib/ejabberd/.erlang.cookie | |
211 | ||
fb70a56e JK |
212 | %clean |
213 | rm -rf $RPM_BUILD_ROOT | |
214 | ||
e2bda3a7 JK |
215 | %pre |
216 | if [ -e /etc/jabber/ejabberd.cfg ] ; then | |
fcf4c7a2 JK |
217 | %banner -e %{name} <<'EOF' |
218 | Old-style /etc/jabber/ejabberd.cfg configuration file exists. You should | |
219 | consider converting it to the new YAML format. You can do this with the | |
27161f77 | 220 | 'ejabberdctl convert_to_yaml' command (ejabberd must be already running). |
fcf4c7a2 | 221 | EOF |
e2bda3a7 JK |
222 | fi |
223 | ||
fb70a56e | 224 | %post |
0d54398f | 225 | if [ -f %{_sysconfdir}/jabber/secret ] ; then |
7f71a53c | 226 | SECRET="$(cat %{_sysconfdir}/jabber/secret)" |
fb70a56e | 227 | if [ -n "$SECRET" ] ; then |
7f71a53c JK |
228 | echo -n "Updating component authentication secret in ejabberd config file..." >&2 |
229 | %{__sed} -i -e "s/@service_secret@/$SECRET/" /etc/jabber/ejabberd.yml | |
230 | echo "done" >&2 | |
fb70a56e JK |
231 | fi |
232 | fi | |
fb70a56e | 233 | /sbin/chkconfig --add ejabberd |
7102eb90 JK |
234 | if [ -e /var/run/%{name}-upgrade-trigger ] ; then |
235 | # service will be restarted in the postun trigger | |
236 | rm -f /var/run/%{name}-upgrade-trigger || : | |
237 | else | |
238 | %service ejabberd restart "ejabberd server" | |
239 | %systemd_post %{name}.service | |
240 | fi | |
67271627 | 241 | |
fb70a56e JK |
242 | %preun |
243 | if [ "$1" = "0" ]; then | |
b15a901d | 244 | %service ejabberd stop |
fb70a56e JK |
245 | /sbin/chkconfig --del ejabberd |
246 | fi | |
67271627 JK |
247 | %systemd_preun %{name}.service |
248 | ||
249 | %postun | |
250 | %systemd_reload | |
251 | ||
252 | %triggerprein -- %{name} < 13.10 | |
7102eb90 JK |
253 | if [ -e /etc/jabber/ejabberd.cfg ] ; then |
254 | if grep -Eq '^[^%]*access_get' /etc/jabber/ejabberd.cfg ; then | |
255 | echo "Your 'ejabberd.cfg' config file seems to use 'access_get' option of mod_vcard" >&2 | |
256 | echo "this is not supported by this ejabberd version in PLD" >&2 | |
257 | exit 1 | |
258 | fi | |
259 | rm -f /etc/jabber/ejabberd.yml.rpmnew 2>/dev/null || : | |
260 | fi | |
261 | if [ -e /var/lock/subsys/ejabberd ] ; then | |
67271627 JK |
262 | # old init script won't stop ejabberd correctly |
263 | # stop it's all processes here | |
264 | # we assume any 'epmd', 'beam', 'beam.smp' or 'heart' process | |
265 | # running with uid of jabber is ejabberd process | |
266 | pids="$(ps -C "epmd beam beam.smp heart" -o pid=,user= | awk '/jabber/ { print $1 }')" || : | |
267 | if [ -n "$pids" ] ; then | |
268 | %banner -e %{name} <<'EOF' | |
269 | Killing all 'epmd, beam, beam.smp, heart' processed owned by the 'jabber' user to make sure old ejabberd is down. | |
7102eb90 | 270 | |
67271627 JK |
271 | EOF |
272 | kill $pids || : | |
273 | fi | |
274 | fi | |
7102eb90 | 275 | touch /var/run/%{name}-upgrade-trigger || : |
fb70a56e | 276 | |
fcf4c7a2 JK |
277 | %triggerpostun -- %{name} < 13.10 |
278 | # convert old 'NODENAME' in /etc/sysconfig/ejabberd | |
279 | # to 'ERLANG_NODE' in /etc/jabber/ejabberdctl.cfg | |
280 | # and move other settings | |
281 | NODENAME="$(hostname)" | |
282 | if [ -e /etc/sysconfig/ejabberd ] ; then | |
283 | . /etc/sysconfig/ejabberd || : | |
284 | fi | |
285 | subst="s/^#ERLANG_NODE=.*/ERLANG_NODE=ejabberd@${NODENAME}/" | |
7102eb90 JK |
286 | if [ "$NODENAME" != "localhost" ] ; then |
287 | %banner -e %{name} <<'EOF' | |
288 | Configured node name (ejabberd@${NODENAME}) is not at 'localhost'. | |
289 | – setting INET_DIST_INTERFACE=0.0.0.0 in /etc/jabber/ejabberdctl.cfg. | |
290 | You should consider tuning that or your firewall configuration. | |
291 | ||
292 | EOF | |
293 | subst="$subst;s/^#INET_DIST_INTERFACE=.*/INET_DIST_INTERFACE=0.0.0.0/" | |
294 | fi | |
fcf4c7a2 JK |
295 | if [ -n "$ERL_MAX_PORTS" ] ; then |
296 | subst="$subst;s/^#ERL_MAX_PORTS=.*/ERL_MAX_PORTS=${ERL_MAX_PORTS}/" | |
297 | fi | |
298 | sed -i -e"$subst" /etc/jabber/ejabberdctl.cfg || : | |
299 | if [ -e /etc/sysconfig/ejabberd ] ; then | |
300 | sed -i.rpmsave \ | |
301 | -e'/^[#[:space:]]*NODENAME=/d;/^# Node name/d' \ | |
302 | -e'/^[#[:space:]]*ERL_MAX_PORTS=/d;/^# uncomment this to allow more then 1024 connections/d' \ | |
303 | -e'/^[#[:space:]]*ERL_FULLSWEEP_AFTER=/d;/^# uncomment this to limit memory usage/d' \ | |
304 | /etc/sysconfig/ejabberd || : | |
305 | fi | |
306 | cp %{_sysconfdir}/jabber/cookie /var/lib/ejabberd/.erlang.cookie || : | |
7102eb90 JK |
307 | chown jabber:jabber /var/lib/ejabberd/.erlang.cookie || : |
308 | chmod 400 /var/lib/ejabberd/.erlang.cookie || : | |
309 | if [ -e /etc/jabber/ejabberd.cfg -a ! -e /etc/jabber/ejabberd.yml.rpmnew ] ; then | |
310 | mv /etc/jabber/ejabberd.yml /etc/jabber/ejabberd.yml.rpmnew | |
311 | echo 'include_config_file: "/etc/jabber/ejabberd.cfg"' > /etc/jabber/ejabberd.yml || : | |
312 | fi | |
313 | ||
314 | # post action postponed here | |
315 | %service ejabberd restart "ejabberd server" | |
316 | %systemd_post %{name}.service | |
317 | ||
67271627 | 318 | %systemd_trigger %{name}.service |
fcf4c7a2 | 319 | |
fb70a56e JK |
320 | %files |
321 | %defattr(644,root,root,755) | |
e2bda3a7 | 322 | %doc sql _doc/* |
fb70a56e | 323 | %attr(755,root,root) %{_sbindir}/* |
4852a36b AM |
324 | %attr(755,root,root) %{_bindir}/elixir |
325 | %attr(755,root,root) %{_bindir}/iex | |
326 | %attr(755,root,root) %{_bindir}/mix | |
fcf4c7a2 JK |
327 | %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd-inetrc |
328 | %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.yml | |
329 | %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberdctl.cfg | |
330 | # legacy config may still be there | |
331 | %attr(640,root,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.cfg | |
028763ab JK |
332 | %attr(770,root,jabber) /var/log/%{name} |
333 | %attr(770,root,jabber) /var/log/archive/%{name} | |
61f3ef21 | 334 | %if %{with logdb} |
beed1a42 | 335 | %exclude %{_libdir}/ejabberd-%{version}/ebin/mod_logdb* |
61f3ef21 | 336 | %endif |
beed1a42 AM |
337 | %{_libdir}/ejabberd-%{version} |
338 | %{_libdir}/cache_tab-* | |
339 | %{_libdir}/elixir-* | |
340 | %{_libdir}/esip-* | |
341 | %{_libdir}/ezlib-* | |
342 | %{_libdir}/fast_tls-* | |
343 | %{_libdir}/fast_xml-* | |
344 | %{_libdir}/fast_yaml-* | |
345 | %{_libdir}/goldrush-* | |
346 | %{_libdir}/iconv-* | |
347 | %{_libdir}/jiffy-* | |
348 | %{_libdir}/lager-* | |
349 | %{_libdir}/luerl-* | |
350 | %{_libdir}/p1_mysql-* | |
351 | %{_libdir}/p1_oauth2-* | |
352 | %{_libdir}/p1_pgsql-* | |
353 | %{_libdir}/p1_utils-* | |
beed1a42 AM |
354 | %{_libdir}/rebar_elixir_plugin-* |
355 | %{_libdir}/stringprep-* | |
356 | %{_libdir}/stun-* | |
4852a36b | 357 | %{_libdir}/xmpp-* |
fb70a56e | 358 | %dir %attr(770,root,jabber) /var/lib/ejabberd |
fcf4c7a2 | 359 | %ghost %attr(400,jabber,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) /var/lib/ejabberd/.erlang.cookie |
d798517a JK |
360 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
361 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} | |
67271627 | 362 | %{systemdunitdir}/%{name}.service |
f20002e6 | 363 | /etc/logrotate.d/%{name} |
cba58599 | 364 | |
61f3ef21 | 365 | %if %{with logdb} |
cba58599 | 366 | %files logdb |
367 | %defattr(644,root,root,755) | |
beed1a42 | 368 | %{_libdir}/ejabberd-%{version}/ebin/mod_logdb* |
61f3ef21 | 369 | %endif |