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