]>
Commit | Line | Data |
---|---|---|
e2bda3a7 | 1 | |
e9f604ed | 2 | # Conditional build: |
3 | %bcond_with pam # PAM authentication support | |
046546ef | 4 | %bcond_without logdb # enable mod_logdb (server-side message logging) |
c4f8aa56 | 5 | %bcond_with weaker_crypto # enable SSLv3 |
eddf5b64 | 6 | |
fb70a56e | 7 | Summary: Fault-tolerant distributed Jabber/XMPP server |
7abad569 | 8 | Summary(pl.UTF-8): Odporny na awarie rozproszony serwer Jabbera/XMPP |
d798517a | 9 | Name: ejabberd |
e9ba3863 | 10 | Version: 15.09 |
dcddf252 | 11 | Release: 4 |
fb70a56e JK |
12 | License: GPL |
13 | Group: Applications/Communications | |
d798517a | 14 | Source0: http://www.process-one.net/downloads/ejabberd/%{version}/%{name}-%{version}.tgz |
e9ba3863 | 15 | # Source0-md5: 616a2fa06064e53ef0130260116dbb68 |
d798517a JK |
16 | Source1: %{name}.init |
17 | Source2: %{name}.sysconfig | |
18 | Source3: %{name}.service | |
f20002e6 | 19 | Source4: %{name}.logrotate |
e2bda3a7 JK |
20 | # |
21 | # Archives created with the ejabberd-pack_deps.sh script (in this repo) | |
c152f853 | 22 | Source10: ejabberd-elixir-20150712.tar.gz |
e9ba3863 | 23 | # Source10-md5: d5d6770c1d4d8e79dc9e9a0e9109bfc8 |
c152f853 | 24 | Source11: ejabberd-esip-20150722.tar.gz |
e9ba3863 | 25 | # Source11-md5: 9d41942a114e13af343992f2b70b9102 |
c152f853 | 26 | Source12: ejabberd-goldrush-20150530.tar.gz |
e9ba3863 AM |
27 | # Source12-md5: d0da4c67a1926e68f6e5ba83fa000dbd |
28 | Source13: ejabberd-jiffy-20150831.tar.gz | |
29 | # Source13-md5: 2175f4219f97b627466fff70d3b7c9e2 | |
30 | Source14: ejabberd-lager-20150812.tar.gz | |
31 | # Source14-md5: b054a6a00e18800f60e8a84e9b2d0178 | |
32 | Source15: ejabberd-oauth2-20150928.tar.gz | |
33 | # Source15-md5: 4f784ea8fc242b980ebd88591b63787d | |
34 | Source16: ejabberd-p1_cache_tab-20150628.tar.gz | |
35 | # Source16-md5: f247d0482084724c72007303606325ec | |
36 | Source17: ejabberd-p1_iconv-20150624.tar.gz | |
37 | # Source17-md5: c1b155bd12750b68eb3b5e1cd30633c0 | |
38 | Source18: ejabberd-p1_mysql-20150929.tar.gz | |
39 | # Source18-md5: 008681215bfac2ef6e564022fc59d5ea | |
40 | Source19: ejabberd-p1_pgsql-20150428.tar.gz | |
41 | # Source19-md5: 276801e6dc862fdd87c2bf75c43022eb | |
42 | Source20: ejabberd-p1_stringprep-20150204.tar.gz | |
43 | # Source20-md5: 7bee6c6e233656699d8185739fe4cc42 | |
44 | Source21: ejabberd-p1_stun-20150916.tar.gz | |
45 | # Source21-md5: f191e45df97de294cdc854caa9183c1b | |
46 | Source22: ejabberd-p1_tls-20150803.tar.gz | |
47 | # Source22-md5: 25f045ce6c07380fb7d1572eecd2ec4f | |
48 | Source23: ejabberd-p1_utils-20150204.tar.gz | |
49 | # Source23-md5: 02f75bb69077a30da3ec4337cc00ec02 | |
50 | Source24: ejabberd-p1_xml-20150924.tar.gz | |
51 | # Source24-md5: 7104125f840d7e20723339a6a4b88ee4 | |
52 | Source25: ejabberd-p1_yaml-20150925.tar.gz | |
53 | # Source25-md5: 38c6c36acf0ddf7a5d960ab7aa3f7661 | |
54 | Source26: ejabberd-p1_zlib-20150223.tar.gz | |
55 | # Source26-md5: 38c5ed4af6cde4d2cf21dfc3ba73028d | |
56 | Source27: ejabberd-rebar_elixir_plugin-20150420.tar.gz | |
57 | # Source27-md5: aa115c4fffc7e25fb782da595e0c6fa6 | |
58 | Source28: ejabberd-xmlrpc-20150506.tar.gz | |
59 | # Source28-md5: 852876d8cc812747c3d8af992491a9f7 | |
e2bda3a7 | 60 | # |
d798517a JK |
61 | Patch0: %{name}-paths.patch |
62 | Patch1: %{name}-config.patch | |
e2bda3a7 | 63 | # not available for 13.10 |
d798517a | 64 | #Patch2: %{name}-vcard-access-get.patch |
33af2120 | 65 | # http://www.dp.uz.gov.ua/o.palij/mod_logdb/patch-mod_logdb-13.12.diff |
d798517a | 66 | Patch3: %{name}-mod_logdb.patch |
c4f8aa56 | 67 | Patch4: %{name}-no_sslv3_or_3des.patch |
3f2196e7 | 68 | URL: http://www.ejabberd.im/ |
fb70a56e | 69 | BuildRequires: autoconf |
1a2644b6 | 70 | BuildRequires: automake |
a306e2ac | 71 | BuildRequires: erlang >= 1:R16B03 |
6f0d08c1 | 72 | BuildRequires: expat-devel >= 1.95 |
73 | BuildRequires: openssl-devel | |
e9f604ed | 74 | %if %{with pam} |
75 | BuildRequires: pam-devel | |
76 | %endif | |
67271627 | 77 | BuildRequires: rpmbuild(macros) >= 1.671 |
60c3a68c | 78 | BuildRequires: yaml-devel |
01f61704 | 79 | BuildRequires: zlib-devel |
8e141538 | 80 | BuildRequires: git-core |
27b10c8b | 81 | Requires(post): /usr/bin/perl |
b15a901d | 82 | Requires(post): jabber-common |
0d54398f | 83 | Requires(post): sed >= 4.0 |
fb70a56e | 84 | Requires(post): textutils |
fb70a56e | 85 | Requires(post,preun): /sbin/chkconfig |
67271627 | 86 | Requires(post,preun,postun): systemd-units >= 38 |
9a105ba4 | 87 | Requires: erlang >= 1:R15B01 |
bb159536 | 88 | Requires: expat >= 1.95 |
27b10c8b | 89 | Requires: rc-scripts |
67271627 | 90 | Requires: systemd-units >= 38 |
028763ab | 91 | Conflicts: logrotate < 3.8.0 |
fb70a56e JK |
92 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
93 | ||
fcf4c7a2 JK |
94 | %define _noautoprovfiles %{_libdir}/%{name}/priv/lib/ |
95 | ||
fb70a56e | 96 | %description |
472227c5 | 97 | ejabberd is a Free and Open Source fault-tolerant distributed Jabber |
98 | server. It is written mostly in Erlang. | |
fb70a56e | 99 | |
e0166ea5 JR |
100 | %description -l pl.UTF-8 |
101 | ejabberd to darmowy, z otwartymi źródłami, odporny na awarie | |
102 | rozproszony serwer Jabbera. Jest napisany w większości w Erlangu. | |
378431cb | 103 | |
cba58599 | 104 | %package logdb |
1a2644b6 | 105 | Summary: Server-side logging module |
cba58599 | 106 | Group: Applications/Communications |
107 | Requires: %{name} = %{version}-%{release} | |
108 | ||
109 | %description logdb | |
110 | Server-side logging module. | |
111 | ||
fb70a56e | 112 | %prep |
e9ba3863 | 113 | %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 |
fb70a56e | 114 | %patch0 -p1 |
7f71a53c JK |
115 | %patch1 -p1 |
116 | #%%patch2 -p1 | |
9953f9cb | 117 | %if %{with logdb} |
046546ef | 118 | %patch3 -p1 |
9953f9cb | 119 | %endif |
c4f8aa56 JK |
120 | %if %{without weaker_crypto} |
121 | %patch4 -p1 | |
122 | %endif | |
fb70a56e | 123 | |
8e141538 JK |
124 | # Various parts of the build system use 'git describe' |
125 | # which returns nonsense on manual builds using the builder script | |
126 | # and which fails on the PLD builders | |
127 | # I was not able to locate all 'git describe' invocation, sot let's | |
128 | # fool them with this dummy repository | |
129 | unset GIT_DIR GIT_WORK_TREE | |
130 | git init | |
d798661f JK |
131 | git config user.email "dummy@example.com" |
132 | git config user.name "Dummy" | |
8e141538 JK |
133 | git add configure.ac |
134 | git commit -a -m "dummy commit" | |
135 | git tag "%{version}" | |
fb8f9840 | 136 | |
fb70a56e | 137 | %build |
8e141538 | 138 | unset GIT_DIR GIT_WORK_TREE |
e2bda3a7 | 139 | %{__aclocal} -I m4 |
fb70a56e | 140 | %{__autoconf} |
6b419144 | 141 | %configure \ |
5613d9b6 | 142 | %{?with_pam --enable-pam} \ |
e4f8c955 | 143 | --enable-user=jabber \ |
8311848d | 144 | --enable-elixir \ |
e2bda3a7 JK |
145 | --enable-full-xml \ |
146 | --enable-nif \ | |
147 | --enable-odbc \ | |
148 | --enable-mysql \ | |
149 | --enable-pgsql \ | |
150 | %{?with_pam:--enable-pam} \ | |
151 | --enable-zlib \ | |
e2bda3a7 JK |
152 | --enable-json \ |
153 | --enable-iconv \ | |
154 | --enable-lager | |
5e08a6fd | 155 | |
e2bda3a7 JK |
156 | touch deps/.got |
157 | ||
158 | cd deps/p1_iconv | |
159 | %configure | |
160 | cd ../.. | |
161 | cd deps/p1_stringprep | |
162 | %configure | |
163 | cd ../.. | |
164 | cd deps/p1_tls | |
165 | %configure | |
166 | cd ../.. | |
167 | cd deps/p1_xml | |
168 | %configure \ | |
169 | --enable-nif \ | |
170 | --enable-full-xml | |
171 | cd ../.. | |
172 | cd deps/p1_yaml | |
173 | %configure | |
174 | cd ../.. | |
175 | cd deps/p1_zlib | |
176 | %configure | |
177 | cd ../.. | |
c6f5b587 AM |
178 | cd deps/esip |
179 | %configure | |
180 | cd ../.. | |
e2bda3a7 | 181 | |
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 JK |
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} |
199 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
67271627 | 200 | install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service |
f20002e6 | 201 | install %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} |
fb70a56e | 202 | |
d798517a | 203 | chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{name}* |
fb70a56e | 204 | |
5613d9b6 AM |
205 | chmod 755 $RPM_BUILD_ROOT%{_libdir}/ejabberd/priv/lib/*.so |
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}/* |
fcf4c7a2 JK |
325 | %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd-inetrc |
326 | %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.yml | |
327 | %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberdctl.cfg | |
328 | # legacy config may still be there | |
329 | %attr(640,root,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.cfg | |
028763ab JK |
330 | %attr(770,root,jabber) /var/log/%{name} |
331 | %attr(770,root,jabber) /var/log/archive/%{name} | |
61f3ef21 | 332 | %if %{with logdb} |
cba58599 | 333 | %exclude %{_libdir}/ejabberd/ebin/mod_logdb* |
61f3ef21 | 334 | %endif |
fb70a56e JK |
335 | %{_libdir}/ejabberd |
336 | %dir %attr(770,root,jabber) /var/lib/ejabberd | |
fcf4c7a2 | 337 | %ghost %attr(400,jabber,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) /var/lib/ejabberd/.erlang.cookie |
d798517a JK |
338 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
339 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} | |
67271627 | 340 | %{systemdunitdir}/%{name}.service |
f20002e6 | 341 | /etc/logrotate.d/%{name} |
cba58599 | 342 | |
61f3ef21 | 343 | %if %{with logdb} |
cba58599 | 344 | %files logdb |
345 | %defattr(644,root,root,755) | |
346 | %{_libdir}/ejabberd/ebin/mod_logdb* | |
61f3ef21 | 347 | %endif |