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