]>
Commit | Line | Data |
---|---|---|
e9f604ed | 1 | # |
2 | # Conditional build: | |
3 | %bcond_with pam # PAM authentication support | |
4 | # | |
fb70a56e | 5 | Summary: Fault-tolerant distributed Jabber/XMPP server |
7abad569 | 6 | Summary(pl.UTF-8): Odporny na awarie rozproszony serwer Jabbera/XMPP |
fb70a56e | 7 | Name: ejabberd |
3ae1381d | 8 | Version: 1.1.4 |
9 | Release: 1 | |
fb70a56e JK |
10 | License: GPL |
11 | Group: Applications/Communications | |
1e0a4744 | 12 | Source0: http://www.process-one.net/en/projects/ejabberd/download/%{version}/%{name}-%{version}.tar.gz |
3ae1381d | 13 | # Source0-md5: 65e9cd346f11a28afbacfe1d7be3a33b |
fb70a56e JK |
14 | Source1: %{name}.init |
15 | Source2: %{name}.sysconfig | |
16 | Source3: %{name}.sh | |
17 | Source4: %{name}ctl.sh | |
1e70c0a0 | 18 | Source5: %{name}-inetrc |
fb70a56e | 19 | Patch0: %{name}-makefile.patch |
8652777e | 20 | Patch1: %{name}-config.patch |
e068fa54 | 21 | Patch2: %{name}-mod_muc.patch |
e9f604ed | 22 | Patch3: %{name}-auth_pam.patch |
126fc2fb | 23 | Patch4: %{name}-show_certificate_chain.patch |
fc7c8497 | 24 | URL: http://ejabberd.jabber.ru/ |
fb70a56e | 25 | BuildRequires: autoconf |
afe517ce | 26 | BuildRequires: erlang >= R9C |
6f0d08c1 | 27 | BuildRequires: expat-devel >= 1.95 |
28 | BuildRequires: openssl-devel | |
e9f604ed | 29 | %if %{with pam} |
30 | BuildRequires: pam-devel | |
31 | %endif | |
b15a901d | 32 | BuildRequires: rpmbuild(macros) >= 1.268 |
01f61704 | 33 | BuildRequires: zlib-devel |
27b10c8b | 34 | Requires(post): /usr/bin/perl |
b15a901d | 35 | Requires(post): jabber-common |
0d54398f | 36 | Requires(post): sed >= 4.0 |
fb70a56e | 37 | Requires(post): textutils |
fb70a56e JK |
38 | Requires(post,preun): /sbin/chkconfig |
39 | Requires: erlang | |
27b10c8b | 40 | Requires: rc-scripts |
fb70a56e JK |
41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
42 | ||
43 | %description | |
472227c5 | 44 | ejabberd is a Free and Open Source fault-tolerant distributed Jabber |
45 | server. It is written mostly in Erlang. | |
fb70a56e | 46 | |
e0166ea5 JR |
47 | %description -l pl.UTF-8 |
48 | ejabberd to darmowy, z otwartymi źródłami, odporny na awarie | |
49 | rozproszony serwer Jabbera. Jest napisany w większości w Erlangu. | |
378431cb | 50 | |
fb70a56e | 51 | %prep |
a0d21af5 | 52 | %setup -q |
fb70a56e | 53 | %patch0 -p1 |
8652777e | 54 | %patch1 -p1 |
e068fa54 | 55 | %patch2 -p1 |
e9f604ed | 56 | %if %{with pam} |
57 | cd src/ | |
58 | %patch3 -p0 | |
59 | %endif | |
126fc2fb | 60 | %patch4 -p1 |
fb70a56e JK |
61 | |
62 | %build | |
63 | cd src | |
64 | %{__autoconf} | |
6b419144 | 65 | %configure \ |
e9f604ed | 66 | --enable-odbc %{?with_pam --enable-pam} |
fb70a56e JK |
67 | %{__make} |
68 | cd .. | |
69 | ||
70 | %install | |
71 | rm -rf $RPM_BUILD_ROOT | |
72 | install -d $RPM_BUILD_ROOT{/var/lib/%{name},/etc/{sysconfig,rc.d/init.d},%{_sbindir}} | |
73 | ||
378431cb | 74 | %{__make} -C src install \ |
27b10c8b | 75 | DESTDIR=$RPM_BUILD_ROOT |
fb70a56e | 76 | |
3d8c71bc | 77 | sed -e's,@libdir@,%{_libdir},g' %{SOURCE1} > $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
fb70a56e JK |
78 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} |
79 | ||
793dcdd8 ER |
80 | sed -e's,@libdir@,%{_libdir},g' %{SOURCE3} > $RPM_BUILD_ROOT%{_sbindir}/%{name} |
81 | sed -e's,@libdir@,%{_libdir},g' %{SOURCE4} > $RPM_BUILD_ROOT%{_sbindir}/%{name}ctl | |
27b10c8b | 82 | install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/jabber |
fb70a56e JK |
83 | |
84 | %clean | |
85 | rm -rf $RPM_BUILD_ROOT | |
86 | ||
87 | %post | |
0d54398f ER |
88 | if [ -f %{_sysconfdir}/jabber/secret ] ; then |
89 | SECRET=`cat %{_sysconfdir}/jabber/secret` | |
fb70a56e JK |
90 | if [ -n "$SECRET" ] ; then |
91 | echo "Updating component authentication secret in ejabberd config file..." | |
0d54398f | 92 | %{__sed} -i -e "s/>secret</>$SECRET</" /etc/jabber/ejabberd.cfg |
fb70a56e JK |
93 | fi |
94 | fi | |
95 | ||
0d54398f ER |
96 | if [ ! -f %{_sysconfdir}/jabber/cookie ] ; then |
97 | echo "Generating erl authentication cookie..." | |
98 | umask 066 | |
99 | perl -e 'open R,"/dev/urandom"; read R,$r,16; | |
100 | printf "%02x",ord(chop $r) while($r);' > %{_sysconfdir}/jabber/cookie | |
7f0fa4be | 101 | fi |
102 | ||
fb70a56e | 103 | /sbin/chkconfig --add ejabberd |
b15a901d | 104 | %service ejabberd restart "ejabberd server" |
fb70a56e JK |
105 | |
106 | %preun | |
107 | if [ "$1" = "0" ]; then | |
b15a901d | 108 | %service ejabberd stop |
fb70a56e JK |
109 | /sbin/chkconfig --del ejabberd |
110 | fi | |
111 | ||
112 | %files | |
113 | %defattr(644,root,root,755) | |
6bc26531 | 114 | %doc ChangeLog doc src/odbc/pg.sql src/odbc/mysql.sql src/odbc/mssql.sql |
fb70a56e | 115 | %attr(755,root,root) %{_sbindir}/* |
27b10c8b | 116 | %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/* |
67ffd871 | 117 | %attr(770,root,jabber) /var/log/ejabberd |
fb70a56e JK |
118 | %{_libdir}/ejabberd |
119 | %dir %attr(770,root,jabber) /var/lib/ejabberd | |
120 | %attr(754,root,root) /etc/rc.d/init.d/%{name} | |
27b10c8b | 121 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |