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.2.3
14 %include /usr/lib/rpm/macros.php
15 Summary: RoundCube Webmail
16 Summary(pl.UTF-8): RoundCube Webmail - poczta przez WWW
21 Group: Applications/Mail
22 Source0: http://downloads.sourceforge.net/roundcubemail/%{name}-%{version}-dep.tar.gz
23 # Source0-md5: e27f19ba021482348bde80ac8f063cb6
25 Source2: %{name}.logrotate
26 Source3: lighttpd.conf
27 Source4: http://nejc.skoberne.net/wp-content/uploads/2008/11/rcpfa-105.tgz
28 # 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.566
39 BuildRequires: sed >= 4.0
40 Requires: %{name}-skin
41 Requires: php(core) >= %{php_min_version}
47 Requires: php(session)
48 Requires: php(simplexml)
49 Requires: php(sockets)
53 Requires: php-pear-Mail_Mime >= 1.8.0
54 Requires: php-pear-Net_IDNA2 >= 0.1.1
55 Requires: php-pear-Net_SMTP
56 Requires: rpm-whiteout >= 1.22
58 Requires: webserver(alias)
59 Requires: webserver(indexfile)
60 Requires: webserver(php)
61 Requires(post): openssl-tools
63 Suggests: php(fileinfo)
67 Suggests: php-mbstring
70 Suggests: php-pear-Auth_SASL
71 # at least one MDB2 db driver needed
72 Suggests: php-pear-MDB2_Driver_mysql
73 Suggests: php-pear-MDB2_Driver_pgsql
74 Suggests: php-pear-MDB2_Driver_sqlite
75 Suggests: php-pear-Net_LDAP2
76 Suggests: php-pear-Net_Sieve
77 Suggests: php-pear-Net_Socket
79 Obsoletes: roundcube-plugin-jqueryui
80 Obsoletes: roundcubemail-skin-default
81 Conflicts: logrotate < 3.8.0
83 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
85 %define _webapps /etc/webapps
86 %define _webapp roundcube
87 %define _sysconfdir %{_webapps}/%{_webapp}
88 %define _appdir %{_datadir}/%{_webapp}
89 %define _appdatadir /var/lib/roundcube
90 %define _applogdir /var/log/roundcube
91 %define _archivelogdir /var/log/archive/roundcube
93 %define find_lang sh %{SOURCE5} %{buildroot}
96 %define _noautopear pear
98 # exclude optional php dependencies
99 %define _noautophp php-sqlite php-mysql php-mysqli php-pgsql php-hash php-json php-xml
101 # put it together for rpmbuild
102 %define _noautoreq %{?_noautophp} %{?_noautopear}
105 RoundCube Webmail is a browser-based multilingual IMAP client with an
106 application-like user interface. It provides full functionality you
107 expect from an e-mail client, including MIME support, address book,
108 folder manipulation and message filters. RoundCube Webmail is written
109 in PHP and requires the MySQL database. The user interface is fully
110 skinnable using XHTML and CSS 2.
112 %description -l pl.UTF-8
113 RoundCube Webmail to oparty na przeglądarce wielojęzyczny klient PHP z
114 interfejsem użytkownika podobnym do aplikacji. Udostępnia pełną
115 funkcjonalność jakiej można oczekiwać od klienta pocztowego, w tym
116 obsługę MIME, książkę adresową, operacje na folderach i filtry
117 wiadomości. RoundCube Webmail jest napisany w PHP i wymaga bazy danych
118 MySQL. Interfejs użytkownika można w pełni obudować skórką przy użyciu
122 Summary: Installer script for RoundCube Webmail
123 Summary(pl.UTF-8): Skrypt instalacyjny RoundCube Webmaila
124 Group: Applications/WWW
125 Requires: %{name} = %{version}-%{release}
128 This package provides installer script for RoundCube Webmail.
130 %description setup -l pl.UTF-8
131 Ten pakiet zawiera skrypt instalacyjny RoundCube Webmaila.
133 %package skin-classic
134 Summary: Classic skin for RoundCube Webmail
135 Summary(pl.UTF-8): Klasyczna skórka dla RoundCube Webmaila
136 Group: Applications/WWW
137 Requires: %{name} = %{version}-%{release}
138 Provides: %{name}-skin
140 %description skin-classic
141 Classic skin for RoundCube Webmail.
143 %description skin-classic -l pl.UTF-8
144 Klasyczna skórka dla RoundCube Webmaila.
147 Summary: Larry skin for RoundCube Webmail
148 Summary(pl.UTF-8): Skórka Larry dla RoundCube Webmaila
149 Group: Applications/WWW
150 Requires: %{name} = %{version}-%{release}
151 Provides: %{name}-skin
153 %description skin-larry
154 Larry skin for RoundCube Webmail.
156 %description skin-larry -l pl.UTF-8
157 Skórka Larry dla RoundCube Webmaila.
160 %setup -q -n %{name}-%{version}-dep %{?with_postfixadmin:-a 4}
162 %if %{with spamfilter}
165 %if %{with postfixadmin}
169 %if %{with password_anon_ldap_bind}
173 find -name .svn | xargs -r rm -rf
176 %undos -f php,inc,js,css
178 # kill extensions and fill proper shebang
179 %{__sed} -i -e '1s,^#!.*php,#!%{__php},' bin/*.sh
180 for a in bin/*.sh; do
184 %{__sed} -i s/indexcontacts.sh/indexcontacts/g bin/update
186 # unpacked js sources
187 find -name '*.src' | xargs rm -v
189 rm -f bin/{jsshrink,jsunshrink}
191 # php-pear-Net_Sieve 1.3.0
192 rm plugins/managesieve/lib/Net/Sieve.php
195 rmdir plugins/managesieve/lib/Net
198 rm -v plugins/*/package.xml
200 mv config/db.inc.php.dist config/db.inc.php
201 mv config/main.inc.php.dist config/main.inc.php
202 %if %{with postfixadmin}
203 mv rcpfa-%{rcpfa_ver} rcpfa
205 cp -p code/forwarding.html ../skins/default/templates
206 cp -p code/password.html ../skins/default/templates
207 cp -p code/vacation.html ../skins/default/templates
208 cp -p code/pfa_forwarding.inc ../program/steps/settings
209 cp -p code/pfa_password.inc ../program/steps/settings
210 cp -p code/pfa_vacation.inc ../program/steps/settings
211 cp -p code/pfa.php ../program/include
213 %{__patch} -d .. -p1 < diffs/app.js.diff
214 %{__patch} -d .. -p1 < diffs/db.inc.php.diff
215 %{__patch} -d .. -p1 < diffs/func.inc.diff
216 %{__patch} -d .. -p1 < diffs/index.php.diff
217 %{__patch} -d .. -p1 < diffs/labels.inc.diff
218 %{__patch} -d .. -p1 < diffs/main.inc.diff
219 %{__patch} -d .. -p1 < diffs/main.inc.php.diff
220 %{__patch} -d .. -p1 < diffs/messages.inc.diff
221 %{__patch} -d .. -p1 < diffs/rcube_user.php.diff
222 %{__patch} -d .. -p1 < diffs/settingstabs.html.diff
225 # cleanup backups after patching
226 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
229 rm -rf $RPM_BUILD_ROOT
230 install -d $RPM_BUILD_ROOT{%{_appdatadir},%{_applogdir},%{_archivelogdir},%{_sysconfdir}} \
231 $RPM_BUILD_ROOT{%{_appdir}/{bin,config,installer,program,skins},/etc/logrotate.d}
233 # Main application part:
234 cp -a program/* $RPM_BUILD_ROOT%{_appdir}/program
235 cp -a bin/* $RPM_BUILD_ROOT%{_appdir}/bin
236 cp -a index.php $RPM_BUILD_ROOT%{_appdir}
239 cp -a skins/* $RPM_BUILD_ROOT%{_appdir}/skins
242 cp -a installer/* $RPM_BUILD_ROOT%{_appdir}/installer
243 cp -a config/db.inc.php $RPM_BUILD_ROOT%{_appdir}/config/db.inc.php.dist
244 cp -a config/main.inc.php $RPM_BUILD_ROOT%{_appdir}/config/main.inc.php.dist
245 cp -a SQL $RPM_BUILD_ROOT%{_appdir}
248 cp -a plugins $RPM_BUILD_ROOT%{_appdir}/plugins
251 cp -a config/db.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/db.inc.php
252 cp -a config/main.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/main.inc.php
253 ln -sf %{_sysconfdir}/db.inc.php $RPM_BUILD_ROOT%{_appdir}/config/db.inc.php
254 ln -sf %{_sysconfdir}/main.inc.php $RPM_BUILD_ROOT%{_appdir}/config/main.inc.php
256 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
257 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
258 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
259 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
262 %find_lang %{name}.lang
263 # sed -ne 's/%lang(\([^)]\+\).*/\1/p' %{name}.lang | sort -u | grep _
265 # now package plugins using filelist as well, as due lang tagging the files
266 # section will go unmanageable
267 for p in $RPM_BUILD_ROOT%{_appdir}/plugins/*; do
268 echo "%dir ${p#$RPM_BUILD_ROOT}"
271 p=${p#$RPM_BUILD_ROOT}
276 README | Changelog | config.inc.php.dist)
285 cat plugins.lang >> %{name}.lang
288 rm -rf $RPM_BUILD_ROOT
291 # replace default des string in config file for better security
296 if grep -q '24ByteDESkey' %{_sysconfdir}/main.inc.php; then
298 # precaution if random str generation failed
299 if [ c$(echo -n "$des" | wc -c) = c24 ]; then
300 %{__sed} -i -e "s/rcmail-\!24ByteDESkey\*Str/$des/" %{_sysconfdir}/main.inc.php
305 if [ ! -f %{_sysconfdir}/db.inc.php -o ! -f %{_sysconfdir}/main.inc.php ]; then
306 # import configs from previously manually installed site
307 d=/home/services/httpd/html/config
308 if [ -f $d/db.inc.php -o -f $d/main.inc.php ]; then
309 echo >&2 "Importing site configs from $d"
310 mkdir -p %{_sysconfdir}
311 if [ -f $d/db.inc.php ]; then
312 [ -f %{_sysconfdir}/db.inc.php ] && mv -f %{_sysconfdir}/db.inc.php{,.rpmorig}
313 cp -af $d/db.inc.php %{_sysconfdir}/db.inc.php
315 if [ -f $d/main.inc.php ]; then
316 [ -f %{_sysconfdir}/main.inc.php ] && mv -f %{_sysconfdir}/main.inc.php{,.rpmorig}
317 cp -af $d/main.inc.php %{_sysconfdir}/main.inc.php
322 # Note this on version upgrade
323 %triggerpostun -- %{name} < %{version}-0
324 # don't do anything on --downgrade
325 if [ $1 -le 1 ]; then
328 %banner -e %{name}-upgrade <<-EOF
329 Run %{_appdir}/bin/update to update to version %{version}.
330 (Be sure to have %{name}-setup installed when you run it)
332 See %{_docdir}/%{name}-%{version}/UPGRADING* for more information.
335 %triggerin -- apache1 < 1.3.37-3, apache1-base
336 %webapp_register apache %{_webapp}
338 %triggerun -- apache1 < 1.3.37-3, apache1-base
339 %webapp_unregister apache %{_webapp}
341 %triggerin -- apache < 2.2.0, apache-base
342 %webapp_register httpd %{_webapp}
344 %triggerun -- apache < 2.2.0, apache-base
345 %webapp_unregister httpd %{_webapp}
347 %triggerin -- lighttpd
348 %webapp_register lighttpd %{_webapp}
350 %triggerun -- lighttpd
351 %webapp_unregister lighttpd %{_webapp}
353 %files -f %{name}.lang
354 %defattr(644,root,root,755)
355 %doc CHANGELOG INSTALL README.md UPGRADING
356 %dir %attr(750,root,http) %{_sysconfdir}
357 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
358 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
359 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
360 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
361 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
364 %dir %{_appdir}/config
365 %{_appdir}/config/*.php
366 %dir %{_appdir}/program
367 %{_appdir}/program/*.gif
368 %{_appdir}/program/include
369 %{_appdir}/program/js
370 %{_appdir}/program/lib
371 %{_appdir}/program/steps
372 %{_appdir}/program/localization/index.inc
374 %dir %{_appdir}/plugins
376 %dir %{_appdir}/skins
377 %dir %attr(770,root,http) %{_applogdir}
378 %dir %attr(751,root,logs) %{_archivelogdir}
379 %dir %attr(770,root,http) %{_appdatadir}
381 # TODO: %ghost logfile(s)
384 %defattr(644,root,root,755)
386 %attr(755,root,root) %{_appdir}/bin/*
387 %dir %{_appdir}/installer
388 %{_appdir}/installer/*.php
389 %{_appdir}/installer/client.js
390 %{_appdir}/installer/styles.css
391 %{_appdir}/installer/images
392 %{_appdir}/config/*.php.dist
396 %defattr(644,root,root,755)
397 %{_appdir}/skins/classic
400 %defattr(644,root,root,755)
401 %{_appdir}/skins/larry