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