2 # - use system js/tiny_mce
3 # - use system js/jquery
4 # - package: http://blog.ilohamail.org/ and remove boundled classess from it
5 # - test/finish and then enable by default password-anon-ldap-bind patch
6 # - bconds does not work for a long time
8 %bcond_with spamfilter # Build with spamfilter patch
9 %bcond_with postfixadmin # Build with postfixadmin support patch
10 %bcond_with password_anon_ldap_bind # apply with password-anon-ldap-bind patch.
12 %define rcpfa_ver 1.0.5
13 %define php_min_version 5.4.0
14 Summary: RoundCube Webmail
15 Summary(pl.UTF-8): RoundCube Webmail - poczta przez WWW
20 Group: Applications/Mail
21 Source0: https://github.com/roundcube/roundcubemail/releases/download/%{version}/%{name}-%{version}-complete.tar.gz
22 # Source0-md5: 44122deb6c5d77d65938b231d0625820
24 Source2: %{name}.logrotate
25 Source3: lighttpd.conf
26 Source4: http://nejc.skoberne.net/wp-content/uploads/2008/11/rcpfa-105.tgz
27 # Source4-md5: dc23bcd894f693db74fce53b09ab58d6
30 Patch0: %{name}-config.patch
31 Patch1: %{name}-spam.patch
32 Patch2: %{name}-postfixadmin-pl_locales.patch
33 Patch3: %{name}-faq-page.patch
34 Patch4: %{name}-password-anon-ldap-bind.patch
35 URL: http://www.roundcube.net/
36 BuildRequires: rpm-php-pearprov >= 4.4.2-11
37 BuildRequires: rpm-pythonprov
38 BuildRequires: rpmbuild(macros) >= 1.654
39 BuildRequires: sed >= 4.0
40 Requires: %{name}-skin
41 Requires: php(core) >= %{php_min_version}
48 Requires: php(mbstring)
50 Requires: php(openssl)
53 Requires: php(session)
54 Requires: php(simplexml)
55 Requires: php(sockets)
58 Requires: php-pear-Mail_Mime >= 1.10.0
59 Requires: php-pear-Net_IDNA2 >= 0.1.1
60 Requires: php-pear-Net_SMTP >= 1.7.1
61 Requires: rpm-whiteout >= 1.22
63 Requires: webserver(alias)
64 Requires: webserver(indexfile)
65 Requires: webserver(php)
66 Requires(post): openssl-tools
68 Suggests: php(fileinfo)
70 Suggests: php(imagick)
72 Suggests: php(openssl)
75 Suggests: php-pear-Auth_SASL >= 1.0.6
76 # at least one pdo db driver needed
77 Suggests: php(pdo-mysql)
78 Suggests: php(pdo-pgsql)
79 Suggests: php(pdo-sqlite)
80 Suggests: php-pear-Crypt_GPG >= 1.6.0
81 Suggests: php-pear-Net_LDAP2
82 Suggests: php-pear-Net_Sieve >= 1.3.2
83 Suggests: php-pear-Net_Socket >= 1.0.12
84 Obsoletes: roundcube-plugin-jqueryui
85 Obsoletes: roundcubemail-skin-default
86 Conflicts: apache-base < 2.4.0-1
87 Conflicts: logrotate < 3.8.0
89 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
91 %define _webapps /etc/webapps
92 %define _webapp roundcube
93 %define _sysconfdir %{_webapps}/%{_webapp}
94 %define _appdir %{_datadir}/%{_webapp}
95 %define _appdatadir /var/lib/roundcube
96 %define _applogdir /var/log/roundcube
97 %define _archivelogdir /var/log/archive/roundcube
99 %define find_lang sh %{SOURCE5} %{buildroot}
101 %define _noautoreq_pear .*
103 # exclude optional php dependencies
104 %define _noautophp php-sqlite php-mysql php-mysqli php-pgsql php-hash php-json php-xml
106 # put it together for rpmbuild
107 %define _noautoreq %{?_noautophp}
110 RoundCube Webmail is a browser-based multilingual IMAP client with an
111 application-like user interface. It provides full functionality you
112 expect from an e-mail client, including MIME support, address book,
113 folder manipulation and message filters. RoundCube Webmail is written
114 in PHP and requires the MySQL database. The user interface is fully
115 skinnable using XHTML and CSS 2.
117 %description -l pl.UTF-8
118 RoundCube Webmail to oparty na przeglądarce wielojęzyczny klient PHP z
119 interfejsem użytkownika podobnym do aplikacji. Udostępnia pełną
120 funkcjonalność jakiej można oczekiwać od klienta pocztowego, w tym
121 obsługę MIME, książkę adresową, operacje na folderach i filtry
122 wiadomości. RoundCube Webmail jest napisany w PHP i wymaga bazy danych
123 MySQL. Interfejs użytkownika można w pełni obudować skórką przy użyciu
127 Summary: Installer script for RoundCube Webmail
128 Summary(pl.UTF-8): Skrypt instalacyjny RoundCube Webmaila
129 Group: Applications/WWW
130 Requires: %{name} = %{version}-%{release}
133 This package provides installer script for RoundCube Webmail.
135 %description setup -l pl.UTF-8
136 Ten pakiet zawiera skrypt instalacyjny RoundCube Webmaila.
138 %package skin-classic
139 Summary: Classic skin for RoundCube Webmail
140 Summary(pl.UTF-8): Klasyczna skórka dla RoundCube Webmaila
141 Group: Applications/WWW
142 Requires: %{name} = %{version}-%{release}
143 Provides: %{name}-skin
145 %description skin-classic
146 Classic skin for RoundCube Webmail.
148 %description skin-classic -l pl.UTF-8
149 Klasyczna skórka dla RoundCube Webmaila.
152 Summary: Larry skin for RoundCube Webmail
153 Summary(pl.UTF-8): Skórka Larry dla RoundCube Webmaila
154 Group: Applications/WWW
155 Requires: %{name} = %{version}-%{release}
156 Provides: %{name}-skin
158 %description skin-larry
159 Larry skin for RoundCube Webmail.
161 %description skin-larry -l pl.UTF-8
162 Skórka Larry dla RoundCube Webmaila.
164 %package skin-elastic
165 Summary: Elastic skin for RoundCube Webmail
166 Summary(pl.UTF-8): Skórka Elastic dla RoundCube Webmaila
167 Group: Applications/WWW
168 Requires: %{name} = %{version}-%{release}
169 Provides: %{name}-skin
171 %description skin-elastic
172 Elastic skin for RoundCube Webmail.
174 %description skin-elastic -l pl.UTF-8
175 Skórka Elastic dla RoundCube Webmaila.
178 %setup -q %{?with_postfixadmin:-a 4}
180 %if %{with spamfilter}
183 %if %{with postfixadmin}
187 %if %{with password_anon_ldap_bind}
191 find -name .svn | xargs -r rm -rf
194 %undos -f php,inc,js,css
196 # fill proper shebang
197 %{__sed} -i -e '1s,^#!.*php,#!/usr/bin/php,' bin/*.sh plugins/enigma/bin/import_keys.sh
198 # these are php scripts really
199 for a in $(grep -l '<?php' bin/*.sh); do
202 %{__sed} -i s/indexcontacts.sh/indexcontacts/g bin/update
203 %{__sed} -i s/updatedb.sh/updatedb/g bin/update
209 mv config/config.inc.php{.sample,}
211 %if %{with postfixadmin}
212 mv rcpfa-%{rcpfa_ver} rcpfa
214 cp -p code/forwarding.html ../skins/default/templates
215 cp -p code/password.html ../skins/default/templates
216 cp -p code/vacation.html ../skins/default/templates
217 cp -p code/pfa_forwarding.inc ../program/steps/settings
218 cp -p code/pfa_password.inc ../program/steps/settings
219 cp -p code/pfa_vacation.inc ../program/steps/settings
220 cp -p code/pfa.php ../program/include
222 %{__patch} -d .. -p1 < diffs/app.js.diff
223 %{__patch} -d .. -p1 < diffs/db.inc.php.diff
224 %{__patch} -d .. -p1 < diffs/func.inc.diff
225 %{__patch} -d .. -p1 < diffs/index.php.diff
226 %{__patch} -d .. -p1 < diffs/labels.inc.diff
227 %{__patch} -d .. -p1 < diffs/main.inc.diff
228 %{__patch} -d .. -p1 < diffs/config.inc.php.diff
229 %{__patch} -d .. -p1 < diffs/messages.inc.diff
230 %{__patch} -d .. -p1 < diffs/rcube_user.php.diff
231 %{__patch} -d .. -p1 < diffs/settingstabs.html.diff
234 # cleanup backups after patching
235 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
238 rm -rf $RPM_BUILD_ROOT
239 install -d $RPM_BUILD_ROOT{%{_appdatadir},%{_applogdir},%{_archivelogdir},%{_sysconfdir}} \
240 $RPM_BUILD_ROOT{%{_appdir}/{bin,config,installer,program,skins},/etc/logrotate.d}
242 # Main application part:
243 cp -a program/* $RPM_BUILD_ROOT%{_appdir}/program
244 cp -a bin/* $RPM_BUILD_ROOT%{_appdir}/bin
245 cp -a index.php $RPM_BUILD_ROOT%{_appdir}
248 cp -a skins/* $RPM_BUILD_ROOT%{_appdir}/skins
251 cp -a installer/* $RPM_BUILD_ROOT%{_appdir}/installer
252 cp -a SQL $RPM_BUILD_ROOT%{_appdir}
255 cp -a plugins $RPM_BUILD_ROOT%{_appdir}/plugins
258 for a in config/*.php; do
259 cp -p $a $RPM_BUILD_ROOT%{_sysconfdir}
260 ln -s %{_sysconfdir}/$(basename $a) $RPM_BUILD_ROOT%{_appdir}/config
262 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
263 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
264 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
265 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
268 %find_lang %{name}.lang
269 # sed -ne 's/%lang(\([^)]\+\).*/\1/p' %{name}.lang | sort -u | grep _
271 # now package plugins using filelist as well, as due lang tagging the files
272 # section will go unmanageable
273 for p in $RPM_BUILD_ROOT%{_appdir}/plugins/*; do
274 echo "%dir ${p#$RPM_BUILD_ROOT}"
277 p=${p#$RPM_BUILD_ROOT}
282 README | Changelog | composer.json | config.inc.php.dist)
291 cat plugins.lang >> %{name}.lang
294 rm -rf $RPM_BUILD_ROOT
297 # replace default des string in config file for better security
302 if grep -q '24ByteDESkey' %{_sysconfdir}/config.inc.php; then
304 # precaution if random str generation failed
305 if [ c$(echo -n "$des" | wc -c) = c24 ]; then
306 %{__sed} -i -e "s/rcmail-\!24ByteDESkey\*Str/$des/" %{_sysconfdir}/config.inc.php
310 # Note this on version upgrade
311 %triggerpostun -- %{name} < %{version}-0
312 # don't do anything on --downgrade
313 if [ $1 -le 1 ]; then
316 %banner -e %{name}-upgrade <<-EOF
317 Run %{_appdir}/bin/update to update to version %{version}.
318 (Be sure to have %{name}-setup installed when you run it)
320 See %{_docdir}/%{name}-%{version}/UPGRADING* for more information.
323 %triggerin -- apache1 < 1.3.37-3, apache1-base
324 %webapp_register apache %{_webapp}
326 %triggerun -- apache1 < 1.3.37-3, apache1-base
327 %webapp_unregister apache %{_webapp}
329 %triggerin -- apache-base
330 %webapp_register httpd %{_webapp}
332 %triggerun -- apache-base
333 %webapp_unregister httpd %{_webapp}
335 %triggerin -- lighttpd
336 %webapp_register lighttpd %{_webapp}
338 %triggerun -- lighttpd
339 %webapp_unregister lighttpd %{_webapp}
341 %files -f %{name}.lang
342 %defattr(644,root,root,755)
343 %doc CHANGELOG INSTALL README.md UPGRADING
344 %dir %attr(750,root,http) %{_sysconfdir}
345 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
346 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
347 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
348 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.inc.php
349 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/defaults.inc.php
350 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mimetypes.php
351 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
355 %dir %{_appdir}/program
356 %{_appdir}/program/include
357 %{_appdir}/program/js
358 %{_appdir}/program/lib
359 %{_appdir}/program/resources
360 %{_appdir}/program/steps
361 %{_appdir}/program/localization/index.inc
363 %dir %{_appdir}/plugins
365 %dir %{_appdir}/skins
366 %dir %attr(770,root,http) %{_applogdir}
367 %dir %attr(751,root,logs) %{_archivelogdir}
368 %dir %attr(770,root,http) %{_appdatadir}
370 # TODO: %ghost logfile(s)
373 %defattr(644,root,root,755)
375 %attr(755,root,root) %{_appdir}/bin/*
376 %dir %{_appdir}/installer
377 %{_appdir}/installer/*.php
378 %{_appdir}/installer/client.js
379 %{_appdir}/installer/styles.css
380 %{_appdir}/installer/images
384 %defattr(644,root,root,755)
385 %{_appdir}/skins/classic
388 %defattr(644,root,root,755)
389 %{_appdir}/skins/larry
392 %defattr(644,root,root,755)
393 %{_appdir}/skins/elastic