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