]>
Commit | Line | Data |
---|---|---|
891f342a | 1 | # |
348d001f | 2 | # Conditional build |
c942d35a TP |
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 | |
5e18d8c5 | 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 | |
10 | # to be disabled | |
e12a97ec | 11 | %bcond_with bxmpp # - patches c2s to allow connections from Flash clients which don't use proper XMPP |
12 | ||
4f2b5b0b | 13 | %define skip_post_check_so mod_.*.so.0.0.0 libstorage.so.0.0.0 |
5282d2a7 | 14 | |
c97879cb | 15 | %include /usr/lib/rpm/macros.perl |
07e127bc | 16 | Summary: Jabber/XMPP server |
90d7886c | 17 | Summary(pl.UTF-8): Serwer Jabber/XMPP |
07e127bc | 18 | Name: jabberd |
95857b4c | 19 | Version: 2.6.1 |
8ae3fc49 | 20 | Release: 5 |
07e127bc JK |
21 | License: GPL |
22 | Group: Applications/Communications | |
dbf65a43 | 23 | Source0: https://github.com/jabberd2/jabberd2/releases/download/jabberd-%{version}/%{name}-%{version}.tar.xz |
95857b4c | 24 | # Source0-md5: cfe1b7fb77ccc9905cc18aabded9a1de |
1ba63c95 JK |
25 | Source1: %{name}.init |
26 | Source2: %{name}.sysconfig | |
07e127bc | 27 | Patch0: %{name}-perlscript.patch |
8c426eae JK |
28 | Patch1: %{name}-daemonize.patch |
29 | Patch2: %{name}-default_config.patch | |
8c426eae JK |
30 | Patch4: %{name}-delay_jobs.patch |
31 | Patch5: %{name}-binary_path.patch | |
df87453c | 32 | Patch6: %{name}-reconnect.patch |
89898590 | 33 | Patch7: openssl11.diff |
e12a97ec | 34 | #bcond bxmpp |
de1cbcb0 | 35 | Patch22: http://www.marquard.net/jabber/patches/patch-flash-v2 |
dbf65a43 | 36 | URL: http://jabberd2.org/ |
c97879cb | 37 | BuildRequires: autoconf |
dbf65a43 | 38 | BuildRequires: autoconf-archive |
c97879cb | 39 | BuildRequires: automake |
348d001f | 40 | %{?with_db:BuildRequires: db-devel >= 4.1.24} |
f3a89fef | 41 | BuildRequires: expat-devel |
e11a8e06 | 42 | BuildRequires: gettext-tools |
b407d06c | 43 | BuildRequires: gsasl-devel >= 0.2.28 |
fa345631 | 44 | BuildRequires: libidn-devel >= 0.3.0 |
c942d35a | 45 | BuildRequires: libstdc++-devel |
c97879cb | 46 | BuildRequires: libtool |
ffddf503 | 47 | %{?with_mysql:BuildRequires: mysql-devel} |
db765d42 | 48 | %{?with_ldap:BuildRequires: openldap-devel} |
227c9448 | 49 | BuildRequires: openssl-devel >= 0.9.6d |
07e127bc | 50 | BuildRequires: pam-devel |
642dbe51 | 51 | %{?with_pgsql:BuildRequires: postgresql-devel} |
6ce19c53 | 52 | BuildRequires: rpm-perlprov >= 3.0.3-16 |
b4669a57 | 53 | BuildRequires: rpmbuild(macros) >= 1.268 |
ecacb8a9 | 54 | %{?with_sqlite:BuildRequires: sqlite3-devel} |
c942d35a | 55 | BuildRequires: udns-devel |
b4669a57 | 56 | Requires(post): sed >= 4.0 |
ecacb8a9 | 57 | Requires(post): textutils |
891f342a JB |
58 | Requires(post,preun): /sbin/chkconfig |
59 | Requires: jabber-common | |
ecacb8a9 | 60 | Requires: rc-scripts |
95857b4c BS |
61 | Suggests: cyrus-sasl-digest-md5 |
62 | Suggests: cyrus-sasl-plain | |
4531e08f | 63 | Obsoletes: jabber |
07e127bc JK |
64 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
65 | ||
66 | %description | |
67 | Modern open source Jabber server, implementing latest XMPP protocol. | |
68 | ||
cd9a8546 JR |
69 | %description -l pl.UTF-8 |
70 | Nowoczesny, wolnodostępny serwer Jabbera implementujący najnowszy | |
71 | protokół XMPP. | |
891f342a | 72 | |
07e127bc | 73 | %prep |
047803aa | 74 | %setup -q |
07e127bc | 75 | %patch0 -p1 |
1ba63c95 JK |
76 | %patch1 -p1 |
77 | %patch2 -p1 | |
4531e08f | 78 | %patch4 -p1 |
3f5f0148 | 79 | %patch5 -p1 |
df87453c | 80 | %patch6 -p1 |
89898590 | 81 | %patch7 -p1 |
e12a97ec | 82 | |
83 | %if %{with bxmpp} | |
d26d6d34 | 84 | %patch22 -p0 |
bb7afe2d | 85 | %endif |
a5fffa1d | 86 | |
07e127bc | 87 | %build |
f0440aa1 | 88 | #http://j2.openaether.org/bugzilla/show_bug.cgi?id=17 |
07e127bc | 89 | %{__libtoolize} |
076ba81e | 90 | %{__aclocal} |
07e127bc JK |
91 | %{__autoconf} |
92 | %{__autoheader} | |
93 | %{__automake} | |
94 | %configure \ | |
1ba63c95 | 95 | --bindir="%{_libdir}/%{name}" \ |
db765d42 | 96 | --sysconfdir="%{_sysconfdir}/jabber" \ |
94545cac | 97 | %{?with_db:--enable-db} \ |
533f35ba | 98 | %{?with_mysql:--enable-mysql} \ |
94545cac | 99 | %{?with_pgsql:--enable-pgsql} \ |
100 | --enable-fs \ | |
101 | --enable-anon \ | |
102 | --enable-pipe \ | |
103 | --enable-pam \ | |
104 | %{?with_ldap:--enable-ldap} \ | |
9b0c2259 | 105 | %{?with_sqlite:--enable-sqlite} \ |
89898590 AM |
106 | %{?debug:--enable-debug} \ |
107 | --disable-silent-rules | |
07e127bc JK |
108 | |
109 | %{__make} | |
110 | ||
111 | %install | |
112 | rm -rf $RPM_BUILD_ROOT | |
e674b6cf | 113 | install -d $RPM_BUILD_ROOT{%{_sbindir},/var/lib/%{name}/{db,stats},/etc/{sysconfig,rc.d/init.d}} |
dbf65a43 | 114 | install -d $RPM_BUILD_ROOT%{systemdunitdir} |
07e127bc JK |
115 | |
116 | %{__make} install \ | |
1ba63c95 | 117 | DESTDIR=$RPM_BUILD_ROOT |
07e127bc | 118 | |
6feabb9c | 119 | mv $RPM_BUILD_ROOT%{_libdir}/jabberd/jabberd $RPM_BUILD_ROOT%{_sbindir} |
dbf65a43 | 120 | mv $RPM_BUILD_ROOT/usr/lib/systemd/system/* $RPM_BUILD_ROOT%{systemdunitdir}/ |
e674b6cf ŁK |
121 | %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/jabber{,/templates}/*.dist |
122 | ||
123 | # drop Upstart configuration files | |
124 | %{__rm} -f $RPM_BUILD_ROOT%{_sysconfdir}/jabber/*.conf | |
125 | %{__rm} -f $RPM_BUILD_ROOT%{_prefix}/etc/init/*.conf | |
1ba63c95 JK |
126 | |
127 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
128 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
07e127bc JK |
129 | |
130 | %clean | |
131 | rm -rf $RPM_BUILD_ROOT | |
132 | ||
07e127bc | 133 | %post |
b4669a57 ER |
134 | if [ -f %{_sysconfdir}/jabber/secret ] ; then |
135 | SECRET=`cat %{_sysconfdir}/jabber/secret` | |
6ce19c53 | 136 | if [ -n "$SECRET" ] ; then |
891f342a | 137 | echo "Updating component authentication secret in Jabberd config files..." |
b4669a57 | 138 | %{__sed} -i -e "s/>secret</>$SECRET</" %{_sysconfdir}/jabber/*.xml |
6ce19c53 JK |
139 | fi |
140 | fi | |
141 | ||
1ba63c95 | 142 | /sbin/chkconfig --add jabberd |
b4669a57 | 143 | %service jabberd restart "Jabber server" |
dbf65a43 | 144 | %systemd_post jabberd.service |
07e127bc | 145 | |
a5fffa1d | 146 | %if %{with avatars} |
50dc6c1c | 147 | echo "This j2 package has new functionality, please read AVATARS file." |
a5fffa1d | 148 | %endif |
6bd64d6d | 149 | |
07e127bc JK |
150 | %preun |
151 | if [ "$1" = "0" ]; then | |
b4669a57 | 152 | %service jabberd stop |
1ba63c95 | 153 | /sbin/chkconfig --del jabberd |
07e127bc | 154 | fi |
dbf65a43 BS |
155 | %systemd_preun jabberd.service |
156 | ||
157 | %postun | |
158 | %systemd_reload | |
07e127bc | 159 | |
07e127bc JK |
160 | %files |
161 | %defattr(644,root,root,755) | |
3cb45cd5 | 162 | %doc AUTHORS ChangeLog NEWS README TODO |
dbf65a43 | 163 | %doc tools/{%{?with_mysql:db-*.mysql,}%{?with_pgsql:db-*.pgsql,}%{?with_sqlite:db-*.sqlite,}pipe-auth.pl} |
076ba81e | 164 | %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/*.cfg |
165 | %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/*.xml | |
4531e08f | 166 | %dir %{_sysconfdir}/jabber/templates |
076ba81e | 167 | %attr(640,root,jabber) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jabber/templates/*.xml |
6feabb9c | 168 | %attr(755,root,root) %{_sbindir}/* |
1ba63c95 JK |
169 | %dir %{_libdir}/jabberd |
170 | %attr(755,root,root) %{_libdir}/%{name}/* | |
6ce19c53 JK |
171 | %dir %attr(770,root,jabber) /var/lib/%{name} |
172 | %dir %attr(770,root,jabber) /var/lib/%{name}/db | |
c942d35a | 173 | %dir %attr(770,root,jabber) /var/lib/%{name}/stats |
1ba63c95 | 174 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
076ba81e | 175 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |
07e127bc | 176 | %{_mandir}/man*/* |
dbf65a43 BS |
177 | %{systemdunitdir}/jabberd-c2s.service |
178 | %{systemdunitdir}/jabberd-router.service | |
179 | %{systemdunitdir}/jabberd-s2s.service | |
180 | %{systemdunitdir}/jabberd-sm.service | |
181 | %{systemdunitdir}/jabberd.service |