3 %bcond_without db # don't build db storage and authreg backends
4 %bcond_without ldap # don't build ldap authreg backend
5 %bcond_without mysql # don't build MySQL storage and authreg backends
6 %bcond_without pgsql # don't build PostgreSQL storage and authreg backends
7 %bcond_without sqlite # don't build SQLite v3 storage backend
8 # allows limiting the number of offline messages stored per user (mysql storage)
9 # and allows offline storage (queuing) of subscription requests and/or messages
11 %bcond_with bxmpp # - patches c2s to allow connections from Flash clients which don't use proper XMPP
13 %define skip_post_check_so mod_.*.so.0.0.0 libstorage.so.0.0.0
15 %include /usr/lib/rpm/macros.perl
16 Summary: Jabber/XMPP server
17 Summary(pl.UTF-8): Serwer Jabber/XMPP
22 Group: Applications/Communications
23 Source0: https://github.com/downloads/jabberd2/jabberd2/%{name}-%{version}.tar.xz
24 # Source0-md5: 8b7d654deaa6566e58ab6630112f9b10
26 Source2: %{name}.sysconfig
27 Source3: db-setup.sqlite
28 Patch0: %{name}-perlscript.patch
29 Patch1: %{name}-daemonize.patch
30 Patch2: %{name}-default_config.patch
31 Patch4: %{name}-delay_jobs.patch
32 Patch5: %{name}-binary_path.patch
33 Patch6: %{name}-reconnect.patch
35 Patch22: http://www.marquard.net/jabber/patches/patch-flash-v2
36 URL: http://jabberd.jabberstudio.org/
37 BuildRequires: autoconf
38 BuildRequires: automake
39 %{?with_db:BuildRequires: db-devel >= 4.1.24}
40 BuildRequires: expat-devel
41 BuildRequires: gettext-devel
42 BuildRequires: gsasl-devel >= 0.2.28
43 BuildRequires: libidn-devel >= 0.3.0
44 BuildRequires: libstdc++-devel
45 BuildRequires: libtool
46 %{?with_mysql:BuildRequires: mysql-devel}
47 %{?with_ldap:BuildRequires: openldap-devel}
48 BuildRequires: openssl-devel >= 0.9.6d
49 BuildRequires: pam-devel
50 %{?with_pgsql:BuildRequires: postgresql-devel}
51 BuildRequires: rpm-perlprov >= 3.0.3-16
52 BuildRequires: rpmbuild(macros) >= 1.268
53 %{?with_sqlite:BuildRequires: sqlite3-devel}
54 BuildRequires: udns-devel
55 Requires(post): sed >= 4.0
56 Requires(post): textutils
57 Requires(post,preun): /sbin/chkconfig
58 Requires: jabber-common
61 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64 Modern open source Jabber server, implementing latest XMPP protocol.
66 %description -l pl.UTF-8
67 Nowoczesny, wolnodostępny serwer Jabbera implementujący najnowszy
83 install %{SOURCE3} tools/
86 #http://j2.openaether.org/bugzilla/show_bug.cgi?id=17
93 --bindir="%{_libdir}/%{name}" \
94 --sysconfdir="%{_sysconfdir}/jabber" \
95 %{?with_db:--enable-db} \
96 %{?with_mysql:--enable-mysql} \
97 %{?with_pgsql:--enable-pgsql} \
102 %{?with_ldap:--enable-ldap} \
103 %{?with_sqlite:--enable-sqlite} \
104 %{?debug:--enable-debug}
109 rm -rf $RPM_BUILD_ROOT
110 install -d $RPM_BUILD_ROOT{%{_sbindir},/var/lib/%{name}/{db,stats},/etc/{sysconfig,rc.d/init.d}}
113 DESTDIR=$RPM_BUILD_ROOT
115 mv $RPM_BUILD_ROOT%{_libdir}/jabberd/jabberd $RPM_BUILD_ROOT%{_sbindir}
116 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/jabber{,/templates}/*.dist
118 # drop Upstart configuration files
119 %{__rm} -f $RPM_BUILD_ROOT%{_sysconfdir}/jabber/*.conf
120 %{__rm} -f $RPM_BUILD_ROOT%{_prefix}/etc/init/*.conf
122 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
123 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
126 rm -rf $RPM_BUILD_ROOT
129 if [ -f %{_sysconfdir}/jabber/secret ] ; then
130 SECRET=`cat %{_sysconfdir}/jabber/secret`
131 if [ -n "$SECRET" ] ; then
132 echo "Updating component authentication secret in Jabberd config files..."
133 %{__sed} -i -e "s/>secret</>$SECRET</" %{_sysconfdir}/jabber/*.xml
137 /sbin/chkconfig --add jabberd
138 %service jabberd restart "Jabber server"
141 echo "This j2 package has new functionality, please read AVATARS file."
145 if [ "$1" = "0" ]; then
146 %service jabberd stop
147 /sbin/chkconfig --del jabberd
151 %defattr(644,root,root,755)
152 %doc AUTHORS ChangeLog NEWS README TODO
153 %doc tools/{db-setup.mysql,db-setup.pgsql,%{?with_sqlite:db-setup.sqlite,}pipe-auth.pl}
154 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/*.cfg
155 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/*.xml
156 %dir %{_sysconfdir}/jabber/templates
157 %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/templates/*.xml
158 %attr(755,root,root) %{_sbindir}/*
159 %dir %{_libdir}/jabberd
160 %attr(755,root,root) %{_libdir}/%{name}/*
161 %dir %attr(770,root,jabber) /var/lib/%{name}
162 %dir %attr(770,root,jabber) /var/lib/%{name}/db
163 %dir %attr(770,root,jabber) /var/lib/%{name}/stats
164 %attr(754,root,root) /etc/rc.d/init.d/%{name}
165 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}