]> git.pld-linux.org Git - packages/ejabberd.git/blob - ejabberd.spec
more dummies…
[packages/ejabberd.git] / ejabberd.spec
1 #
2 # TODO:
3 #       - add systemd unit
4
5 # Conditional build:
6 %bcond_with     pam             # PAM authentication support
7 %bcond_with     logdb           # enable mod_logdb (server-side message logging)
8 #
9
10 %define realname        ejabberd
11
12 Summary:        Fault-tolerant distributed Jabber/XMPP server
13 Summary(pl.UTF-8):      Odporny na awarie rozproszony serwer Jabbera/XMPP
14 Name:           %{realname}
15 Version:        13.10
16 Release:        0.1
17 License:        GPL
18 Group:          Applications/Communications
19 Source0:        http://www.process-one.net/downloads/ejabberd/%{version}/%{realname}-%{version}.tgz
20 # Source0-md5:  94ce4fe244ee72771eeafe27209d6d3c
21 Source1:        %{realname}.init
22 Source2:        %{realname}.sysconfig
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 #
56 Patch0:         %{realname}-paths.patch
57 # not available for 13.10
58 #Patch1:                %{realname}-vcard-access-get.patch
59 # http://www.dp.uz.gov.ua/o.palij/mod_logdb/patch-mod_logdb-2.1.12.diff
60 Patch2:         %{realname}-mod_logdb.patch
61 URL:            http://www.ejabberd.im/
62 BuildRequires:  autoconf
63 BuildRequires:  automake
64 BuildRequires:  erlang >= 1:R15B01
65 BuildRequires:  expat-devel >= 1.95
66 BuildRequires:  openssl-devel
67 %if %{with pam}
68 BuildRequires:  pam-devel
69 %endif
70 BuildRequires:  rpmbuild(macros) >= 1.268
71 BuildRequires:  yaml-devel
72 BuildRequires:  zlib-devel
73 BuildRequires:  git-core
74 Requires(post): /usr/bin/perl
75 Requires(post): jabber-common
76 Requires(post): sed >= 4.0
77 Requires(post): textutils
78 Requires(post,preun):   /sbin/chkconfig
79 Requires:       erlang
80 Requires:       expat >= 1.95
81 Requires:       rc-scripts
82 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
83
84 %define         _noautoprovfiles        %{_libdir}/%{name}/priv/lib/
85
86 %description
87 ejabberd is a Free and Open Source fault-tolerant distributed Jabber
88 server. It is written mostly in Erlang.
89
90 %description -l pl.UTF-8
91 ejabberd to darmowy, z otwartymi źródłami, odporny na awarie
92 rozproszony serwer Jabbera. Jest napisany w większości w Erlangu.
93
94 %package logdb
95 Summary:        Server-side logging module
96 Group:          Applications/Communications
97 Requires:       %{name} = %{version}-%{release}
98
99 %description logdb
100 Server-side logging module.
101
102 %prep
103 %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
104 %patch0 -p1
105 #%%patch1 -p1
106 %if %{with logdb}
107 %patch2 -p0
108 %endif
109
110 # Various parts of the build system use 'git describe'
111 # which returns nonsense on manual builds using the builder script
112 # and which fails on the PLD builders
113 # I was not able to locate all 'git describe' invocation, sot let's
114 # fool them with this dummy repository
115 unset GIT_DIR GIT_WORK_TREE
116 git init
117 git config user.email "dummy@example.com"
118 git config user.name "Dummy"
119 git add configure.ac
120 git commit -a -m "dummy commit"
121 git tag "%{version}"
122
123 %build
124 unset GIT_DIR GIT_WORK_TREE
125 %{__aclocal} -I m4
126 %{__autoconf}
127 %configure \
128         %{?with_pam --enable-pam} \
129         --with-openssl=%{_prefix} \
130         --enable-user=jabber \
131         --enable-full-xml \
132         --enable-nif \
133         --enable-odbc \
134         --enable-mysql \
135         --enable-pgsql \
136         %{?with_pam:--enable-pam} \
137         --enable-zlib \
138         --enable-stun \
139         --enable-json \
140         --enable-iconv \
141         --enable-lager
142 touch deps/.got
143
144 cd deps/p1_iconv
145 %configure
146 cd ../..
147 cd deps/p1_stringprep
148 %configure
149 cd ../..
150 cd deps/p1_tls
151 %configure
152 cd ../..
153 cd deps/p1_xml
154 %configure \
155         --enable-nif \
156         --enable-full-xml
157 cd ../..
158 cd deps/p1_yaml
159 %configure
160 cd ../..
161 cd deps/p1_zlib
162 %configure
163 cd ../..
164
165 %{__make} -j1
166
167 %install
168 rm -rf $RPM_BUILD_ROOT
169 install -d $RPM_BUILD_ROOT{/var/lib/%{realname},/etc/{sysconfig,rc.d/init.d},%{_sbindir}}
170
171 unset GIT_DIR GIT_WORK_TREE
172
173 %{__make} install -j1 \
174         CHOWN_COMMAND=true \
175         O_USER="" \
176         G_USER="" \
177         DESTDIR=$RPM_BUILD_ROOT
178
179 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}
180 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{realname}
181
182 chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{realname}*
183
184 chmod 755 $RPM_BUILD_ROOT%{_libdir}/ejabberd/priv/lib/*.so
185
186 rm -rf _doc 2>/dev/null || :
187 mv $RPM_BUILD_ROOT%{_docdir}/%{name} _doc
188
189 touch $RPM_BUILD_ROOT%{_sysconfdir}/jabber/ejabberd.cfg
190 touch $RPM_BUILD_ROOT/var/lib/ejabberd/.erlang.cookie
191
192 %clean
193 rm -rf $RPM_BUILD_ROOT
194
195 %pre
196 if [ -e /etc/jabber/ejabberd.cfg ] ; then
197         if grep -Eq '^[^#]*access_get' ; then
198                 echo "Your 'ejabberd.cfg' config file seems to use 'access_get' option of mod_vcard" >&2
199                 echo "this is not supported by this ejabberd version in PLD" >&2
200                 exit 1
201         fi
202         %banner -e %{name} <<'EOF'
203 Old-style /etc/jabber/ejabberd.cfg configuration file exists. You should
204 consider converting it to the new YAML format. You can do this with the
205 ejabberctl command.
206 EOF
207 fi
208
209 %post
210 if [ -f %{_sysconfdir}/jabber/secret ] ; then
211         SECRET=`cat %{_sysconfdir}/jabber/secret`
212         if [ -n "$SECRET" ] ; then
213                 echo "Updating component authentication secret in ejabberd config file..."
214                 %{__sed} -i -e "s/>secret</>$SECRET</" /etc/jabber/ejabberd.yml
215         fi
216 fi
217
218 /sbin/chkconfig --add ejabberd
219 %service ejabberd restart "ejabberd server"
220
221 %preun
222 if [ "$1" = "0" ]; then
223         %service ejabberd stop
224         /sbin/chkconfig --del ejabberd
225 fi
226
227 %triggerpostun -- %{name} < 13.10
228 # convert old 'NODENAME' in /etc/sysconfig/ejabberd
229 # to 'ERLANG_NODE' in /etc/jabber/ejabberdctl.cfg
230 # and move other settings
231 NODENAME="$(hostname)"
232 if [ -e /etc/sysconfig/ejabberd ] ; then
233         . /etc/sysconfig/ejabberd || :
234 fi
235 subst="s/^#ERLANG_NODE=.*/ERLANG_NODE=ejabberd@${NODENAME}/"
236 if [ -n "$ERL_MAX_PORTS" ] ; then
237         subst="$subst;s/^#ERL_MAX_PORTS=.*/ERL_MAX_PORTS=${ERL_MAX_PORTS}/"
238 fi
239 sed -i -e"$subst" /etc/jabber/ejabberdctl.cfg || :
240 if [ -e /etc/sysconfig/ejabberd ] ; then
241         sed -i.rpmsave \
242                 -e'/^[#[:space:]]*NODENAME=/d;/^# Node name/d' \
243                 -e'/^[#[:space:]]*ERL_MAX_PORTS=/d;/^# uncomment this to allow more then 1024 connections/d' \
244                 -e'/^[#[:space:]]*ERL_FULLSWEEP_AFTER=/d;/^# uncomment this to limit memory usage/d' \
245                 /etc/sysconfig/ejabberd || :
246 fi
247 cp %{_sysconfdir}/jabber/cookie /var/lib/ejabberd/.erlang.cookie || :
248
249 %files
250 %defattr(644,root,root,755)
251 %doc sql _doc/*
252 %attr(755,root,root) %{_sbindir}/*
253 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd-inetrc
254 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.yml
255 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberdctl.cfg
256 # legacy config may still be there
257 %attr(640,root,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/ejabberd.cfg
258 %attr(770,root,jabber) /var/log/ejabberd
259 %if %{with logdb}
260 %exclude %{_libdir}/ejabberd/ebin/mod_logdb*
261 %endif
262 %{_libdir}/ejabberd
263 %dir %attr(770,root,jabber) /var/lib/ejabberd
264 %ghost %attr(400,jabber,jabber) %ghost %config(noreplace) %verify(not md5 mtime size) /var/lib/ejabberd/.erlang.cookie
265 %attr(754,root,root) /etc/rc.d/init.d/%{realname}
266 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{realname}
267
268 %if %{with logdb}
269 %files logdb
270 %defattr(644,root,root,755)
271 %{_libdir}/ejabberd/ebin/mod_logdb*
272 %endif
This page took 0.066247 seconds and 4 git commands to generate.