]> git.pld-linux.org Git - packages/ejabberd.git/blob - ejabberd.spec
Version: 13.10 (not finished yet)
[packages/ejabberd.git] / ejabberd.spec
1 #
2 # TODO:
3 #       - config migration from old versions
4 #       - check/udpate the init script
5 #       - add systemd unit
6
7 # Conditional build:
8 %bcond_with     pam             # PAM authentication support
9 %bcond_with     logdb           # enable mod_logdb (server-side message logging)
10 #
11
12 %define realname        ejabberd
13
14 Summary:        Fault-tolerant distributed Jabber/XMPP server
15 Summary(pl.UTF-8):      Odporny na awarie rozproszony serwer Jabbera/XMPP
16 Name:           %{realname}
17 Version:        13.10
18 Release:        0.1
19 License:        GPL
20 Group:          Applications/Communications
21 Source0:        http://www.process-one.net/downloads/ejabberd/%{version}/%{realname}-%{version}.tgz
22 # Source0-md5:  94ce4fe244ee72771eeafe27209d6d3c
23 Source1:        %{realname}.init
24 Source2:        %{realname}.sysconfig
25 Source3:        %{realname}.sh
26 Source4:        %{realname}ctl.sh
27 Source5:        %{realname}-inetrc
28 #
29 # Archives created with the ejabberd-pack_deps.sh script (in this repo)
30 Source10:       ejabberd-goldrush-20131108.tar.gz
31 # Source10-md5: 3f61708d20fcee2e7d47036cc470f4e9
32 Source11:       ejabberd-lager-20131111.tar.gz
33 # Source11-md5: e0933da9d0462b045f6b9c4bbd320d3e
34 Source12:       ejabberd-p1_cache_tab-20130515.tar.gz
35 # Source12-md5: f2500cffdaff434b354d01eeb24d136d
36 Source13:       ejabberd-p1_iconv-20130602.tar.gz
37 # Source13-md5: ab0118d4097ee756f65fd087265c88ae
38 Source14:       ejabberd-p1_stringprep-20131113.tar.gz
39 # Source14-md5: 282d70c792a78ea9a7415b0b4e65e157
40 Source15:       ejabberd-p1_tls-20130717.tar.gz
41 # Source15-md5: 1211c5d8f0a95b58dfc5fb5bf4e13ded
42 Source16:       ejabberd-p1_xml-20131017.tar.gz
43 # Source16-md5: dc7ebd7ed1ed6340ff0e7739173d4438
44 Source17:       ejabberd-p1_yaml-20131031.tar.gz
45 # Source17-md5: 82d4bb5c5d56ab93a60f5d1c6e583dc1
46 Source18:       ejabberd-p1_zlib-20130515.tar.gz
47 # Source18-md5: a203d9359122ead64966eeb0bd1c8cf7
48 Source19:       ejabberd-xmlrpc-20130116.tar.gz
49 # Source19-md5: 22e02ff7ca174b4ac225005f63da10ad
50 Source20:       ejabberd-jiffy-20130702.tar.gz
51 # Source20-md5: 01b156e97005f07ce8bb46ecf27471ff
52 Source21:       ejabberd-p1_mysql-20131024.tar.gz
53 # Source21-md5: c02921f21ba030357d2cbbbf182af54a
54 Source22:       ejabberd-p1_pam-20130515.tar.gz
55 # Source22-md5: 0ca31094d93dfb047f05c7539136433a
56 Source23:       ejabberd-p1_pgsql-20130515.tar.gz
57 # Source23-md5: 1958be8e59d1b472499ef1bdf8edc1db
58 Source24:       ejabberd-p1_stun-20130624.tar.gz
59 # Source24-md5: 9a1c5ad9b3b95364d3f76446fcf58dc3
60 #
61 Patch0:         %{realname}-makefile.patch
62 # not available for 13.10
63 #Patch1:                %{realname}-vcard-access-get.patch
64 # http://www.dp.uz.gov.ua/o.palij/mod_logdb/patch-mod_logdb-2.1.12.diff
65 Patch2:         %{realname}-mod_logdb.patch
66 URL:            http://www.ejabberd.im/
67 BuildRequires:  autoconf
68 BuildRequires:  automake
69 BuildRequires:  erlang >= R10B_5
70 BuildRequires:  expat-devel >= 1.95
71 BuildRequires:  openssl-devel
72 %if %{with pam}
73 BuildRequires:  pam-devel
74 %endif
75 BuildRequires:  rpmbuild(macros) >= 1.268
76 BuildRequires:  zlib-devel
77 Requires(post): /usr/bin/perl
78 Requires(post): jabber-common
79 Requires(post): sed >= 4.0
80 Requires(post): textutils
81 Requires(post,preun):   /sbin/chkconfig
82 Requires:       erlang
83 Requires:       expat >= 1.95
84 Requires:       rc-scripts
85 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
86
87 %description
88 ejabberd is a Free and Open Source fault-tolerant distributed Jabber
89 server. It is written mostly in Erlang.
90
91 %description -l pl.UTF-8
92 ejabberd to darmowy, z otwartymi źródłami, odporny na awarie
93 rozproszony serwer Jabbera. Jest napisany w większości w Erlangu.
94
95 %package logdb
96 Summary:        Server-side logging module
97 Group:          Applications/Communications
98 Requires:       %{name} = %{version}-%{release}
99
100 %description logdb
101 Server-side logging module.
102
103 %prep
104 %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
105 %patch0 -p1
106 #%%patch1 -p1
107 %if %{with logdb}
108 %patch2 -p0
109 %endif
110
111 %build
112 %{__aclocal} -I m4
113 %{__autoconf}
114 %configure \
115         %{?with_pam --enable-pam} \
116         --with-openssl=%{_prefix} \
117         --enable-full-xml \
118         --enable-nif \
119         --enable-odbc \
120         --enable-mysql \
121         --enable-pgsql \
122         %{?with_pam:--enable-pam} \
123         --enable-zlib \
124         --enable-stun \
125         --enable-json \
126         --enable-iconv \
127         --enable-lager
128 touch deps/.got
129
130 cd deps/p1_iconv
131 %configure
132 cd ../..
133 cd deps/p1_stringprep
134 %configure
135 cd ../..
136 cd deps/p1_tls
137 %configure
138 cd ../..
139 cd deps/p1_xml
140 %configure \
141         --enable-nif \
142         --enable-full-xml
143 cd ../..
144 cd deps/p1_yaml
145 %configure
146 cd ../..
147 cd deps/p1_zlib
148 %configure
149 cd ../..
150
151 %{__make} -j1
152
153 %install
154 rm -rf $RPM_BUILD_ROOT
155 install -d $RPM_BUILD_ROOT{/var/lib/%{realname},/etc/{sysconfig,rc.d/init.d},%{_sbindir}}
156
157 %{__make} install -j1 \
158         DESTDIR=$RPM_BUILD_ROOT
159
160 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}
161 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{realname}
162
163 chmod u+rw $RPM_BUILD_ROOT%{_sbindir}/%{realname}*
164 sed -e's,@libdir@,%{_libdir},g' %{SOURCE3} > $RPM_BUILD_ROOT%{_sbindir}/%{realname}
165 sed -e's,@libdir@,%{_libdir},g' %{SOURCE4} > $RPM_BUILD_ROOT%{_sbindir}/%{realname}ctl
166 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/jabber
167
168 chmod 755 $RPM_BUILD_ROOT%{_libdir}/ejabberd/priv/lib/*.so
169
170 rm -rf _doc 2>/dev/null || :
171 mv $RPM_BUILD_ROOT%{_docdir}/%{name} _doc
172
173 %clean
174 rm -rf $RPM_BUILD_ROOT
175
176 %pre
177 if [ -e /etc/jabber/ejabberd.cfg ] ; then
178         if grep -Eq '^[^#]*access_get' ; then
179                 echo "Your 'ejabberd.cfg' config file seems to use 'access_get' option of mod_vcard" >&2
180                 echo "this is not supported by this ejabberd version in PLD" >&2
181                 exit 1
182         fi
183 fi
184
185 %post
186 if [ -f %{_sysconfdir}/jabber/secret ] ; then
187         SECRET=`cat %{_sysconfdir}/jabber/secret`
188         if [ -n "$SECRET" ] ; then
189                 echo "Updating component authentication secret in ejabberd config file..."
190                 %{__sed} -i -e "s/>secret</>$SECRET</" /etc/jabber/ejabberd.cfg
191         fi
192 fi
193
194 if [ ! -f %{_sysconfdir}/jabber/cookie ] ; then
195         echo "Generating erl authentication cookie..."
196         umask 066
197         perl -e 'open R,"/dev/urandom"; read R,$r,16;
198                 printf "%02x",ord(chop $r) while($r);' > %{_sysconfdir}/jabber/cookie
199 fi
200
201 /sbin/chkconfig --add ejabberd
202 %service ejabberd restart "ejabberd server"
203
204 %preun
205 if [ "$1" = "0" ]; then
206         %service ejabberd stop
207         /sbin/chkconfig --del ejabberd
208 fi
209
210 %files
211 %defattr(644,root,root,755)
212 %doc sql _doc/*
213 %attr(755,root,root) %{_sbindir}/*
214 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/*
215 %attr(770,root,jabber) /var/log/ejabberd
216 %if %{with logdb}
217 %exclude %{_libdir}/ejabberd/ebin/mod_logdb*
218 %endif
219 %{_libdir}/ejabberd
220 %dir %attr(770,root,jabber) /var/lib/ejabberd
221 %attr(754,root,root) /etc/rc.d/init.d/%{realname}
222 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{realname}
223
224 %if %{with logdb}
225 %files logdb
226 %defattr(644,root,root,755)
227 %{_libdir}/ejabberd/ebin/mod_logdb*
228 %endif
This page took 0.075312 seconds and 4 git commands to generate.