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: 8ec32e093983128ef1a87c561bb48c99
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
31 Patch0: %{name}-config.patch
32 Patch1: %{name}-spam.patch
33 Patch2: %{name}-postfixadmin-pl_locales.patch
34 Patch3: %{name}-faq-page.patch
35 Patch4: %{name}-password-anon-ldap-bind.patch
36 URL: http://www.roundcube.net/
37 BuildRequires: rpm-php-pearprov >= 4.4.2-11
38 BuildRequires: rpm-pythonprov
39 BuildRequires: rpmbuild(macros) >= 1.566
40 BuildRequires: sed >= 4.0
41 Requires: %{name}-skin
42 Requires: php(core) >= %{php_min_version}
48 Requires: php(session)
49 Requires: php(simplexml)
50 Requires: php(sockets)
54 Requires: php-pear-Mail_Mime >= 1.8.0
55 Requires: php-pear-Net_IDNA2 >= 0.1.1
56 Requires: php-pear-Net_SMTP
57 Requires: rpm-whiteout >= 1.22
59 Requires: webserver(alias)
60 Requires: webserver(indexfile)
61 Requires: webserver(php)
62 Requires(post): openssl-tools
64 Suggests: php(fileinfo)
68 Suggests: php-mbstring
71 Suggests: php-pear-Auth_SASL
72 # at least one MDB2 db driver needed
73 Suggests: php-pear-MDB2_Driver_mysql
74 Suggests: php-pear-MDB2_Driver_pgsql
75 Suggests: php-pear-MDB2_Driver_sqlite
76 Suggests: php-pear-Net_LDAP2
77 Suggests: php-pear-Net_Sieve
78 Suggests: php-pear-Net_Socket
80 Obsoletes: roundcube-plugin-jqueryui
81 Obsoletes: roundcubemail-skin-default
82 Conflicts: apache-base < 2.4.0-1
83 Conflicts: logrotate < 3.8.0
85 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
87 %define _webapps /etc/webapps
88 %define _webapp roundcube
89 %define _sysconfdir %{_webapps}/%{_webapp}
90 %define _appdir %{_datadir}/%{_webapp}
91 %define _appdatadir /var/lib/roundcube
92 %define _applogdir /var/log/roundcube
93 %define _archivelogdir /var/log/archive/roundcube
95 %define find_lang sh %{SOURCE5} %{buildroot}
98 %define _noautopear pear
100 # exclude optional php dependencies
101 %define _noautophp php-sqlite php-mysql php-mysqli php-pgsql php-hash php-json php-xml
103 # put it together for rpmbuild
104 %define _noautoreq %{?_noautophp} %{?_noautopear}
107 RoundCube Webmail is a browser-based multilingual IMAP client with an
108 application-like user interface. It provides full functionality you
109 expect from an e-mail client, including MIME support, address book,
110 folder manipulation and message filters. RoundCube Webmail is written
111 in PHP and requires the MySQL database. The user interface is fully
112 skinnable using XHTML and CSS 2.
114 %description -l pl.UTF-8
115 RoundCube Webmail to oparty na przeglądarce wielojęzyczny klient PHP z
116 interfejsem użytkownika podobnym do aplikacji. Udostępnia pełną
117 funkcjonalność jakiej można oczekiwać od klienta pocztowego, w tym
118 obsługę MIME, książkę adresową, operacje na folderach i filtry
119 wiadomości. RoundCube Webmail jest napisany w PHP i wymaga bazy danych
120 MySQL. Interfejs użytkownika można w pełni obudować skórką przy użyciu
124 Summary: Installer script for RoundCube Webmail
125 Summary(pl.UTF-8): Skrypt instalacyjny RoundCube Webmaila
126 Group: Applications/WWW
127 Requires: %{name} = %{version}-%{release}
130 This package provides installer script for RoundCube Webmail.
132 %description setup -l pl.UTF-8
133 Ten pakiet zawiera skrypt instalacyjny RoundCube Webmaila.
135 %package skin-classic
136 Summary: Classic skin for RoundCube Webmail
137 Summary(pl.UTF-8): Klasyczna skórka dla RoundCube Webmaila
138 Group: Applications/WWW
139 Requires: %{name} = %{version}-%{release}
140 Provides: %{name}-skin
142 %description skin-classic
143 Classic skin for RoundCube Webmail.
145 %description skin-classic -l pl.UTF-8
146 Klasyczna skórka dla RoundCube Webmaila.
149 Summary: Larry skin for RoundCube Webmail
150 Summary(pl.UTF-8): Skórka Larry dla RoundCube Webmaila
151 Group: Applications/WWW
152 Requires: %{name} = %{version}-%{release}
153 Provides: %{name}-skin
155 %description skin-larry
156 Larry skin for RoundCube Webmail.
158 %description skin-larry -l pl.UTF-8
159 Skórka Larry dla RoundCube Webmaila.
162 %setup -q -n %{name}-%{version}-dep %{?with_postfixadmin:-a 4}
164 %if %{with spamfilter}
167 %if %{with postfixadmin}
171 %if %{with password_anon_ldap_bind}
175 find -name .svn | xargs -r rm -rf
178 %undos -f php,inc,js,css
180 # kill extensions and fill proper shebang
181 %{__sed} -i -e '1s,^#!.*php,#!%{__php},' bin/*.sh
182 for a in bin/*.sh; do
186 %{__sed} -i s/indexcontacts.sh/indexcontacts/g bin/update
187 %{__sed} -i s/updatedb.sh/update/g bin/update
190 rm bin/{jsshrink,jsunshrink}
192 # php-pear-Net_Sieve 1.3.0
193 rm plugins/managesieve/lib/Net/Sieve.php
196 rmdir plugins/managesieve/lib/Net
199 rm -v plugins/*/package.xml
201 mv config/db.inc.php.dist config/db.inc.php
202 mv config/main.inc.php.dist config/main.inc.php
203 %if %{with postfixadmin}
204 mv rcpfa-%{rcpfa_ver} rcpfa
206 cp -p code/forwarding.html ../skins/default/templates
207 cp -p code/password.html ../skins/default/templates
208 cp -p code/vacation.html ../skins/default/templates
209 cp -p code/pfa_forwarding.inc ../program/steps/settings
210 cp -p code/pfa_password.inc ../program/steps/settings
211 cp -p code/pfa_vacation.inc ../program/steps/settings
212 cp -p code/pfa.php ../program/include
214 %{__patch} -d .. -p1 < diffs/app.js.diff
215 %{__patch} -d .. -p1 < diffs/db.inc.php.diff
216 %{__patch} -d .. -p1 < diffs/func.inc.diff
217 %{__patch} -d .. -p1 < diffs/index.php.diff
218 %{__patch} -d .. -p1 < diffs/labels.inc.diff
219 %{__patch} -d .. -p1 < diffs/main.inc.diff
220 %{__patch} -d .. -p1 < diffs/main.inc.php.diff
221 %{__patch} -d .. -p1 < diffs/messages.inc.diff
222 %{__patch} -d .. -p1 < diffs/rcube_user.php.diff
223 %{__patch} -d .. -p1 < diffs/settingstabs.html.diff
226 # cleanup backups after patching
227 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
230 rm -rf $RPM_BUILD_ROOT
231 install -d $RPM_BUILD_ROOT{%{_appdatadir},%{_applogdir},%{_archivelogdir},%{_sysconfdir}} \
232 $RPM_BUILD_ROOT{%{_appdir}/{bin,config,installer,program,skins},/etc/logrotate.d}
234 # Main application part:
235 cp -a program/* $RPM_BUILD_ROOT%{_appdir}/program
236 cp -a bin/* $RPM_BUILD_ROOT%{_appdir}/bin
237 cp -a index.php $RPM_BUILD_ROOT%{_appdir}
240 cp -a skins/* $RPM_BUILD_ROOT%{_appdir}/skins
243 cp -a installer/* $RPM_BUILD_ROOT%{_appdir}/installer
244 cp -a config/db.inc.php $RPM_BUILD_ROOT%{_appdir}/config/db.inc.php.dist
245 cp -a config/main.inc.php $RPM_BUILD_ROOT%{_appdir}/config/main.inc.php.dist
246 cp -a SQL $RPM_BUILD_ROOT%{_appdir}
249 cp -a plugins $RPM_BUILD_ROOT%{_appdir}/plugins
252 cp -a config/db.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/db.inc.php
253 cp -a config/main.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/main.inc.php
254 ln -sf %{_sysconfdir}/db.inc.php $RPM_BUILD_ROOT%{_appdir}/config/db.inc.php
255 ln -sf %{_sysconfdir}/main.inc.php $RPM_BUILD_ROOT%{_appdir}/config/main.inc.php
257 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
258 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
259 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
260 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
263 %find_lang %{name}.lang
264 # sed -ne 's/%lang(\([^)]\+\).*/\1/p' %{name}.lang | sort -u | grep _
266 # now package plugins using filelist as well, as due lang tagging the files
267 # section will go unmanageable
268 for p in $RPM_BUILD_ROOT%{_appdir}/plugins/*; do
269 echo "%dir ${p#$RPM_BUILD_ROOT}"
272 p=${p#$RPM_BUILD_ROOT}
277 README | Changelog | config.inc.php.dist)
286 cat plugins.lang >> %{name}.lang
289 rm -rf $RPM_BUILD_ROOT
292 # replace default des string in config file for better security
297 if grep -q '24ByteDESkey' %{_sysconfdir}/main.inc.php; then
299 # precaution if random str generation failed
300 if [ c$(echo -n "$des" | wc -c) = c24 ]; then
301 %{__sed} -i -e "s/rcmail-\!24ByteDESkey\*Str/$des/" %{_sysconfdir}/main.inc.php
306 if [ ! -f %{_sysconfdir}/db.inc.php -o ! -f %{_sysconfdir}/main.inc.php ]; then
307 # import configs from previously manually installed site
308 d=/home/services/httpd/html/config
309 if [ -f $d/db.inc.php -o -f $d/main.inc.php ]; then
310 echo >&2 "Importing site configs from $d"
311 mkdir -p %{_sysconfdir}
312 if [ -f $d/db.inc.php ]; then
313 [ -f %{_sysconfdir}/db.inc.php ] && mv -f %{_sysconfdir}/db.inc.php{,.rpmorig}
314 cp -af $d/db.inc.php %{_sysconfdir}/db.inc.php
316 if [ -f $d/main.inc.php ]; then
317 [ -f %{_sysconfdir}/main.inc.php ] && mv -f %{_sysconfdir}/main.inc.php{,.rpmorig}
318 cp -af $d/main.inc.php %{_sysconfdir}/main.inc.php
323 # Note this on version upgrade
324 %triggerpostun -- %{name} < %{version}-0
325 # don't do anything on --downgrade
326 if [ $1 -le 1 ]; then
329 %banner -e %{name}-upgrade <<-EOF
330 Run %{_appdir}/bin/update to update to version %{version}.
331 (Be sure to have %{name}-setup installed when you run it)
333 See %{_docdir}/%{name}-%{version}/UPGRADING* for more information.
336 %triggerin -- apache1 < 1.3.37-3, apache1-base
337 %webapp_register apache %{_webapp}
339 %triggerun -- apache1 < 1.3.37-3, apache1-base
340 %webapp_unregister apache %{_webapp}
342 %triggerin -- apache-base
343 %webapp_register httpd %{_webapp}
345 %triggerun -- apache-base
346 %webapp_unregister httpd %{_webapp}
348 %triggerin -- lighttpd
349 %webapp_register lighttpd %{_webapp}
351 %triggerun -- lighttpd
352 %webapp_unregister lighttpd %{_webapp}
354 %files -f %{name}.lang
355 %defattr(644,root,root,755)
356 %doc CHANGELOG INSTALL README.md UPGRADING
357 %dir %attr(750,root,http) %{_sysconfdir}
358 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
359 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
360 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
361 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
362 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
365 %dir %{_appdir}/config
366 %{_appdir}/config/*.php
367 %dir %{_appdir}/program
368 %{_appdir}/program/include
369 %{_appdir}/program/js
370 %{_appdir}/program/lib
371 %{_appdir}/program/resources
372 %{_appdir}/program/steps
373 %{_appdir}/program/localization/index.inc
375 %dir %{_appdir}/plugins
377 %dir %{_appdir}/skins
378 %dir %attr(770,root,http) %{_applogdir}
379 %dir %attr(751,root,logs) %{_archivelogdir}
380 %dir %attr(770,root,http) %{_appdatadir}
382 # TODO: %ghost logfile(s)
385 %defattr(644,root,root,755)
387 %attr(755,root,root) %{_appdir}/bin/*
388 %dir %{_appdir}/installer
389 %{_appdir}/installer/*.php
390 %{_appdir}/installer/client.js
391 %{_appdir}/installer/styles.css
392 %{_appdir}/installer/images
393 %{_appdir}/config/*.php.dist
397 %defattr(644,root,root,755)
398 %{_appdir}/skins/classic
401 %defattr(644,root,root,755)
402 %{_appdir}/skins/larry