]>
Commit | Line | Data |
---|---|---|
e9f604ed | 1 | # |
e2bda3a7 | 2 | # TODO: |
e2bda3a7 JK |
3 | # - add systemd unit |
4 | ||
e9f604ed | 5 | # Conditional build: |
6 | %bcond_with pam # PAM authentication support | |
e2bda3a7 | 7 | %bcond_with logdb # enable mod_logdb (server-side message logging) |
e9f604ed | 8 | # |
eddf5b64 | 9 | |
10 | %define realname ejabberd | |
11 | ||
fb70a56e | 12 | Summary: Fault-tolerant distributed Jabber/XMPP server |
7abad569 | 13 | Summary(pl.UTF-8): Odporny na awarie rozproszony serwer Jabbera/XMPP |
cba58599 | 14 | Name: %{realname} |
e2bda3a7 JK |
15 | Version: 13.10 |
16 | Release: 0.1 | |
fb70a56e JK |
17 | License: GPL |
18 | Group: Applications/Communications | |
3f2196e7 | 19 | Source0: http://www.process-one.net/downloads/ejabberd/%{version}/%{realname}-%{version}.tgz |
e2bda3a7 | 20 | # Source0-md5: 94ce4fe244ee72771eeafe27209d6d3c |
eddf5b64 | 21 | Source1: %{realname}.init |
22 | Source2: %{realname}.sysconfig | |
e2bda3a7 JK |
23 | # |
24 | # Archives created with the ejabberd-pack_deps.sh script (in this repo) | |
25 | Source10: ejabberd-goldrush-20131108.tar.gz | |
26 | # Source10-md5: 3f61708d20fcee2e7d47036cc470f4e9 | |
27 | Source11: ejabberd-lager-20131111.tar.gz | |
28 | # Source11-md5: e0933da9d0462b045f6b9c4bbd320d3e | |
29 | Source12: ejabberd-p1_cache_tab-20130515.tar.gz | |
30 | # Source12-md5: f2500cffdaff434b354d01eeb24d136d | |
31 | Source13: ejabberd-p1_iconv-20130602.tar.gz | |
32 | # Source13-md5: ab0118d4097ee756f65fd087265c88ae | |
33 | Source14: ejabberd-p1_stringprep-20131113.tar.gz | |
34 | # Source14-md5: 282d70c792a78ea9a7415b0b4e65e157 | |
35 | Source15: ejabberd-p1_tls-20130717.tar.gz | |
36 | # Source15-md5: 1211c5d8f0a95b58dfc5fb5bf4e13ded | |
37 | Source16: ejabberd-p1_xml-20131017.tar.gz | |
38 | # Source16-md5: dc7ebd7ed1ed6340ff0e7739173d4438 | |
39 | Source17: ejabberd-p1_yaml-20131031.tar.gz | |
40 | # Source17-md5: 82d4bb5c5d56ab93a60f5d1c6e583dc1 | |
41 | Source18: ejabberd-p1_zlib-20130515.tar.gz | |
42 | # Source18-md5: a203d9359122ead64966eeb0bd1c8cf7 | |
43 | Source19: ejabberd-xmlrpc-20130116.tar.gz | |
44 | # Source19-md5: 22e02ff7ca174b4ac225005f63da10ad | |
45 | Source20: ejabberd-jiffy-20130702.tar.gz | |
46 | # Source20-md5: 01b156e97005f07ce8bb46ecf27471ff | |
47 | Source21: ejabberd-p1_mysql-20131024.tar.gz | |
48 | # Source21-md5: c02921f21ba030357d2cbbbf182af54a | |
49 | Source22: ejabberd-p1_pam-20130515.tar.gz | |
50 | # Source22-md5: 0ca31094d93dfb047f05c7539136433a | |
51 | Source23: ejabberd-p1_pgsql-20130515.tar.gz | |
52 | # Source23-md5: 1958be8e59d1b472499ef1bdf8edc1db | |
53 | Source24: ejabberd-p1_stun-20130624.tar.gz | |
54 | # Source24-md5: 9a1c5ad9b3b95364d3f76446fcf58dc3 | |
55 | # | |
9a6073b0 | 56 | Patch0: %{realname}-paths.patch |
e2bda3a7 JK |
57 | # not available for 13.10 |
58 | #Patch1: %{realname}-vcard-access-get.patch | |
0d78319d | 59 | # http://www.dp.uz.gov.ua/o.palij/mod_logdb/patch-mod_logdb-2.1.12.diff |
e2bda3a7 | 60 | Patch2: %{realname}-mod_logdb.patch |
3f2196e7 | 61 | URL: http://www.ejabberd.im/ |
fb70a56e | 62 | BuildRequires: autoconf |
1a2644b6 | 63 | BuildRequires: automake |
60c3a68c | 64 | BuildRequires: erlang >= 1:R15B01 |
6f0d08c1 | 65 | BuildRequires: expat-devel >= 1.95 |
66 | BuildRequires: openssl-devel | |
e9f604ed | 67 | %if %{with pam} |
68 | BuildRequires: pam-devel | |
69 | %endif | |
b15a901d | 70 | BuildRequires: rpmbuild(macros) >= 1.268 |
60c3a68c | 71 | BuildRequires: yaml-devel |
01f61704 | 72 | BuildRequires: zlib-devel |
27b10c8b | 73 | Requires(post): /usr/bin/perl |
b15a901d | 74 | Requires(post): jabber-common |
0d54398f | 75 | Requires(post): sed >= 4.0 |
fb70a56e | 76 | Requires(post): textutils |
fb70a56e JK |
77 | Requires(post,preun): /sbin/chkconfig |
78 | Requires: erlang | |
bb159536 | 79 | Requires: expat >= 1.95 |
27b10c8b | 80 | Requires: rc-scripts |
fb70a56e JK |
81 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
82 | ||
fcf4c7a2 JK |
83 | %define _noautoprovfiles %{_libdir}/%{name}/priv/lib/ |
84 | ||
fb70a56e | 85 | %description |
472227c5 | 86 | ejabberd is a Free and Open Source fault-tolerant distributed Jabber |
87 | server. It is written mostly in Erlang. | |
fb70a56e | 88 | |
e0166ea5 JR |
89 | %description -l pl.UTF-8 |
90 | ejabberd to darmowy, z otwartymi źródłami, odporny na awarie | |
91 | rozproszony serwer Jabbera. Jest napisany w większości w Erlangu. | |
378431cb | 92 | |
cba58599 | 93 | %package logdb |
1a2644b6 | 94 | Summary: Server-side logging module |
cba58599 | 95 | Group: Applications/Communications |
96 | Requires: %{name} = %{version}-%{release} | |
97 | ||
98 | %description logdb | |
99 | Server-side logging module. | |
100 | ||
fb70a56e | 101 | %prep |
e2bda3a7 | 102 | %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 |
fb70a56e | 103 | %patch0 -p1 |
e2bda3a7 | 104 | #%%patch1 -p1 |
9953f9cb | 105 | %if %{with logdb} |
e2bda3a7 | 106 | %patch2 -p0 |
9953f9cb | 107 | %endif |
fb70a56e | 108 | |
fb8f9840 JK |
109 | # do not let it use 'git describe' to fetch version |
110 | # it uses nonsense during manual builds and fails on the builder | |
111 | sed -i -e"s/AC_INIT(ejabberd,[^,]*,/AC_INIT(ejabberd,community %{version},/" configure.ac | |
8e49610a JK |
112 | sed -i -e's/\([[:space:]]*REVISION=\).*git.*describe.*/\1"%{version}"/' contrib/extract_translations/prepare-translation.sh |
113 | ! grep -q "git describe" configure.ac contrib/extract_translations/prepare-translation.sh | |
fb8f9840 | 114 | |
fb70a56e | 115 | %build |
e2bda3a7 | 116 | %{__aclocal} -I m4 |
fb70a56e | 117 | %{__autoconf} |
6b419144 | 118 | %configure \ |
5613d9b6 AM |
119 | %{?with_pam --enable-pam} \ |
120 | --with-openssl=%{_prefix} \ | |
e4f8c955 | 121 | --enable-user=jabber \ |
e2bda3a7 JK |
122 | --enable-full-xml \ |
123 | --enable-nif \ | |
124 | --enable-odbc \ | |
125 | --enable-mysql \ | |
126 | --enable-pgsql \ | |
127 | %{?with_pam:--enable-pam} \ | |
128 | --enable-zlib \ | |
129 | --enable-stun \ | |
130 | --enable-json \ | |
131 | --enable-iconv \ | |
132 | --enable-lager | |
133 | touch deps/.got | |
134 | ||
135 | cd deps/p1_iconv | |
136 | %configure | |
137 | cd ../.. | |
138 | cd deps/p1_stringprep | |
139 | %configure | |
140 | cd ../.. | |
141 | cd deps/p1_tls | |
142 | %configure | |
143 | cd ../.. | |
144 | cd deps/p1_xml | |
145 | %configure \ | |
146 | --enable-nif \ | |
147 | --enable-full-xml | |
148 | cd ../.. | |
149 | cd deps/p1_yaml | |
150 | %configure | |
151 | cd ../.. | |
152 | cd deps/p1_zlib | |
153 | %configure | |
154 | cd ../.. | |
155 | ||
92a38251 | 156 | %{__make} -j1 |
fb70a56e JK |
157 | |
158 | %install | |
159 | rm -rf $RPM_BUILD_ROOT | |
eddf5b64 | 160 | install -d $RPM_BUILD_ROOT{/var/lib/%{realname},/etc/{sysconfig,rc.d/init.d},%{_sbindir}} |
fb70a56e | 161 | |
e2bda3a7 | 162 | %{__make} install -j1 \ |
e4f8c955 JK |
163 | CHOWN_COMMAND=true \ |
164 | O_USER="" \ | |
165 | G_USER="" \ | |
27b10c8b | 166 | DESTDIR=$RPM_BUILD_ROOT |
fb70a56e | 167 | |
8ce6995f | 168 | 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/%{realname} |
eddf5b64 | 169 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{realname} |
fb70a56e | 170 | |
4dea86b0 | 171 | chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{realname}* |
fb70a56e | 172 | |
5613d9b6 AM |
173 | chmod 755 $RPM_BUILD_ROOT%{_libdir}/ejabberd/priv/lib/*.so |
174 | ||
e2bda3a7 JK |
175 | rm -rf _doc 2>/dev/null || : |
176 | mv $RPM_BUILD_ROOT%{_docdir}/%{name} _doc | |
059c0bab | 177 | |
fcf4c7a2 JK |
178 | touch $RPM_BUILD_ROOT%{_sysconfdir}/jabber/ejabberd.cfg |
179 | touch $RPM_BUILD_ROOT/var/lib/ejabberd/.erlang.cookie | |
180 | ||
fb70a56e JK |
181 | %clean |
182 | rm -rf $RPM_BUILD_ROOT | |
183 | ||
e2bda3a7 JK |
184 | %pre |
185 | if [ -e /etc/jabber/ejabberd.cfg ] ; then | |
186 | if grep -Eq '^[^#]*access_get' ; then | |
187 | echo "Your 'ejabberd.cfg' config file seems to use 'access_get' option of mod_vcard" >&2 | |
188 | echo "this is not supported by this ejabberd version in PLD" >&2 | |
189 | exit 1 | |
190 | fi | |
fcf4c7a2 JK |
191 | %banner -e %{name} <<'EOF' |
192 | Old-style /etc/jabber/ejabberd.cfg configuration file exists. You should | |
193 | consider converting it to the new YAML format. You can do this with the | |
194 | ejabberctl command. | |
195 | EOF | |
e2bda3a7 JK |
196 | fi |
197 | ||
fb70a56e | 198 | %post |
0d54398f ER |
199 | if [ -f %{_sysconfdir}/jabber/secret ] ; then |
200 | SECRET=`cat %{_sysconfdir}/jabber/secret` | |
fb70a56e JK |
201 | if [ -n "$SECRET" ] ; then |
202 | echo "Updating component authentication secret in ejabberd config file..." | |
fcf4c7a2 | 203 | %{__sed} -i -e "s/>secret</>$SECRET</" /etc/jabber/ejabberd.yml |
fb70a56e JK |
204 | fi |
205 | fi | |
206 | ||
207 | /sbin/chkconfig --add ejabberd | |
b15a901d | 208 | %service ejabberd restart "ejabberd server" |
fb70a56e JK |
209 | |
210 | %preun | |
211 | if [ "$1" = "0" ]; then | |
b15a901d | 212 | %service ejabberd stop |
fb70a56e JK |
213 | /sbin/chkconfig --del ejabberd |
214 | fi | |
215 | ||
fcf4c7a2 JK |
216 | %triggerpostun -- %{name} < 13.10 |
217 | # convert old 'NODENAME' in /etc/sysconfig/ejabberd | |
218 | # to 'ERLANG_NODE' in /etc/jabber/ejabberdctl.cfg | |
219 | # and move other settings | |
220 | NODENAME="$(hostname)" | |
221 | if [ -e /etc/sysconfig/ejabberd ] ; then | |
222 | . /etc/sysconfig/ejabberd || : | |
223 | fi | |
224 | subst="s/^#ERLANG_NODE=.*/ERLANG_NODE=ejabberd@${NODENAME}/" | |
225 | if [ -n "$ERL_MAX_PORTS" ] ; then | |
226 | subst="$subst;s/^#ERL_MAX_PORTS=.*/ERL_MAX_PORTS=${ERL_MAX_PORTS}/" | |
227 | fi | |
228 | sed -i -e"$subst" /etc/jabber/ejabberdctl.cfg || : | |
229 | if [ -e /etc/sysconfig/ejabberd ] ; then | |
230 | sed -i.rpmsave \ | |
231 | -e'/^[#[:space:]]*NODENAME=/d;/^# Node name/d' \ | |
232 | -e'/^[#[:space:]]*ERL_MAX_PORTS=/d;/^# uncomment this to allow more then 1024 connections/d' \ | |
233 | -e'/^[#[:space:]]*ERL_FULLSWEEP_AFTER=/d;/^# uncomment this to limit memory usage/d' \ | |
234 | /etc/sysconfig/ejabberd || : | |
235 | fi | |
236 | cp %{_sysconfdir}/jabber/cookie /var/lib/ejabberd/.erlang.cookie || : | |
237 | ||
fb70a56e JK |
238 | %files |
239 | %defattr(644,root,root,755) | |
e2bda3a7 | 240 | %doc sql _doc/* |
fb70a56e | 241 | %attr(755,root,root) %{_sbindir}/* |
fcf4c7a2 JK |
242 | %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd-inetrc |
243 | %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.yml | |
244 | %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberdctl.cfg | |
245 | # legacy config may still be there | |
246 | %attr(640,root,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.cfg | |
67ffd871 | 247 | %attr(770,root,jabber) /var/log/ejabberd |
61f3ef21 | 248 | %if %{with logdb} |
cba58599 | 249 | %exclude %{_libdir}/ejabberd/ebin/mod_logdb* |
61f3ef21 | 250 | %endif |
fb70a56e JK |
251 | %{_libdir}/ejabberd |
252 | %dir %attr(770,root,jabber) /var/lib/ejabberd | |
fcf4c7a2 | 253 | %ghost %attr(400,jabber,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) /var/lib/ejabberd/.erlang.cookie |
eddf5b64 | 254 | %attr(754,root,root) /etc/rc.d/init.d/%{realname} |
255 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{realname} | |
cba58599 | 256 | |
61f3ef21 | 257 | %if %{with logdb} |
cba58599 | 258 | %files logdb |
259 | %defattr(644,root,root,755) | |
260 | %{_libdir}/ejabberd/ebin/mod_logdb* | |
61f3ef21 | 261 | %endif |