2 # - move bin/* to -setup which are related to upgrading/setup
3 # - use system js/tiny_mce
4 # - use system js/jquery
5 # - use system magic db: program/lib/magic
6 # - script to %lang all "localization" dirs
7 # - package: http://blog.ilohamail.org/ and remove boundled classess from it
8 # - Some php-database backend. Suggests?
9 # - test/finish and then enable by default password-anon-ldap-bind patch
11 %bcond_with spamfilter # Build with spamfilter patch
12 %bcond_with postfixadmin # Build with postfixadmin support patch
13 %bcond_with password_anon_ldap_bind # apply with password-anon-ldap-bind patch.
15 %define rcpfa_ver 1.0.5
16 %define php_min_version 5.2.3
18 %include /usr/lib/rpm/macros.php
19 Summary: RoundCube Webmail
20 Summary(pl.UTF-8): RoundCube Webmail - poczta przez WWW
25 Group: Applications/Mail
26 Source0: http://downloads.sourceforge.net/roundcubemail/%{name}-%{version}.tar.gz
27 # Source0-md5: d28417f0f16ff2a251a964be153c967a
28 Source1: %{name}.config
29 Source2: %{name}.logrotate
30 Source3: %{name}-lighttpd.conf
31 Source4: http://nejc.skoberne.net/wp-content/uploads/2008/11/rcpfa-105.tgz
32 # Source4-md5: dc23bcd894f693db74fce53b09ab58d6
34 Patch0: %{name}-config.patch
35 Patch1: %{name}-spam.patch
36 Patch2: %{name}-postfixadmin-pl_locales.patch
37 Patch3: %{name}-faq-page.patch
38 Patch4: %{name}-password-anon-ldap-bind.patch
39 Patch5: use-iconv.patch
40 Patch6: shared-folders.patch
41 URL: http://www.roundcube.net/
42 BuildRequires: rpm-php-pearprov >= 4.4.2-11
43 BuildRequires: rpmbuild(macros) >= 1.553
44 BuildRequires: sed >= 4.0
45 Requires: %{name}-skin
46 Requires: php-common >= 4:%{php_min_version}
53 Requires: php-pear-Mail_Mime
54 Requires: php-pear-Net_SMTP
56 Requires: php-simplexml
60 Requires: rpm-whiteout >= 1.22
62 Requires: webserver(alias)
63 Requires: webserver(indexfile)
64 Requires: webserver(php)
65 Suggests: php(fileinfo)
68 Suggests: php-mbstring
71 Suggests: php-pear-Auth_SASL
72 Suggests: php-pear-Net_LDAP2
73 Suggests: php-pear-Net_Sieve
74 Suggests: php-pear-Net_Socket
76 Conflicts: logrotate < 3.7-4
78 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
80 %define _webapps /etc/webapps
81 %define _webapp roundcube
82 %define _sysconfdir %{_webapps}/%{_webapp}
83 %define _appdir %{_datadir}/%{_webapp}
84 %define _appdatadir /var/lib/roundcube
85 %define _applogdir /var/log/roundcube
86 %define _archivelogdir /var/log/archive/roundcube
88 %define find_lang sh %{SOURCE5} %{buildroot}
91 %define _noautopear pear
93 # exclude optional php dependencies
94 %define _noautophp php-sqlite php-mysql php-mysqli php-pgsql php-hash php-json php-xml
96 # put it together for rpmbuild
97 %define _noautoreq %{?_noautophp} %{?_noautopear}
100 RoundCube Webmail is a browser-based multilingual IMAP client with an
101 application-like user interface. It provides full functionality you
102 expect from an e-mail client, including MIME support, address book,
103 folder manipulation and message filters. RoundCube Webmail is written
104 in PHP and requires the MySQL database. The user interface is fully
105 skinnable using XHTML and CSS 2.
107 %description -l pl.UTF-8
108 RoundCube Webmail to oparty na przeglądarce wielojęzyczny klient PHP z
109 interfejsem użytkownika podobnym do aplikacji. Udostępnia pełną
110 funkcjonalność jakiej można oczekiwać od klienta pocztowego, w tym
111 obsługę MIME, książkę adresową, operacje na folderach i filtry
112 wiadomości. RoundCube Webmail jest napisany w PHP i wymaga bazy danych
113 MySQL. Interfejs użytkownika można w pełni obudować skórką przy użyciu
117 Summary: Installer script for RoundCube Webmail
118 Summary(pl.UTF-8): Skrypt instalacyjny RoundCube Webmaila
119 Group: Applications/WWW
120 Requires: %{name} = %{version}-%{release}
123 This package provides installer script for RoundCube Webmail.
125 %description setup -l pl.UTF-8
126 Ten pakiet zawiera skrypt instalacyjny RoundCube Webmaila.
128 %package skin-default
129 Summary: Default skin for RoundCube Webmail
130 Summary(pl.UTF-8): Domyślna skórka dla RoundCube Webmaila
131 Group: Applications/WWW
132 Requires: %{name} = %{version}-%{release}
133 Provides: %{name}-skin
135 %description skin-default
136 Default skin for RoundCube Webmail.
138 %description skin-default -l pl.UTF-8
139 Domyślna skórka dla RoundCube Webmaila.
142 %setup -q %{?with_postfixadmin:-a 4}
144 %if %{with spamfilter}
147 %if %{with postfixadmin}
151 %if %{with password_anon_ldap_bind}
157 find -name .svn | xargs -r rm -rf
160 %undos -f php,inc,js,css
162 # kill extensions and fill proper shebang
163 %{__sed} -i -e '1s,^#!.*php,#!%{__php},' bin/*.sh
164 for a in bin/*.sh; do
168 # unpacked js sources
169 find -name '*.src' | xargs rm -v
171 # rm utf8.class and deps, we use iconv extension
172 rm program/lib/utf8.class.php
173 rm -r program/lib/encoding
175 # php-pear-PEAR-core 1.9.0 (used indirectly)
176 rm program/lib/PEAR.php
177 rm program/lib/PEAR5.php
179 # php-pear-Net_Socket 1.0.9 (used by password, managesieve plugins)
180 rm program/lib/Net/Socket.php
182 # php-pear-Net_SMTP 1.4.2 (nothing seem to use it)
183 rm program/lib/Net/SMTP.php
185 # php-pear-Auth_SASL 1.0.4 (used by managesieve)
186 rm program/lib/Auth/SASL.php
187 rm -r program/lib/Auth/SASL
189 # php-pear-Mail_Mime 1.8.0 (nothing seems to use it)
190 rm program/lib/Mail/mime.php
191 rm program/lib/Mail/mimePart.php
193 # php-pear-Net_Sieve 1.3.0
194 rm plugins/managesieve/lib/Net/Sieve.php
197 rmdir program/lib/Auth
198 rmdir program/lib/Mail
199 rmdir program/lib/Net
200 rmdir plugins/managesieve/lib/Net
202 # unknown MDB2 version (newer than released 2.5.0b2, or modified by rc)
203 #rm program/lib/MDB2.php
206 rm -v plugins/*/package.xml
208 mv config/db.inc.php.dist config/db.inc.php
209 mv config/main.inc.php.dist config/main.inc.php
210 %if %{with postfixadmin}
211 mv rcpfa-%{rcpfa_ver} rcpfa
213 cp code/forwarding.html ../skins/default/templates
214 cp code/password.html ../skins/default/templates
215 cp code/vacation.html ../skins/default/templates
216 cp code/pfa_forwarding.inc ../program/steps/settings
217 cp code/pfa_password.inc ../program/steps/settings
218 cp code/pfa_vacation.inc ../program/steps/settings
219 cp code/pfa.php ../program/include
221 patch -d .. -p1 < diffs/app.js.diff
222 patch -d .. -p1 < diffs/db.inc.php.diff
223 patch -d .. -p1 < diffs/func.inc.diff
224 patch -d .. -p1 < diffs/index.php.diff
225 patch -d .. -p1 < diffs/labels.inc.diff
226 patch -d .. -p1 < diffs/main.inc.diff
227 patch -d .. -p1 < diffs/main.inc.php.diff
228 patch -d .. -p1 < diffs/messages.inc.diff
229 patch -d .. -p1 < diffs/rcube_user.php.diff
230 patch -d .. -p1 < diffs/settingstabs.html.diff
234 rm -rf $RPM_BUILD_ROOT
235 install -d $RPM_BUILD_ROOT{%{_appdatadir},%{_applogdir},%{_archivelogdir},%{_sysconfdir}} \
236 $RPM_BUILD_ROOT{%{_appdir}/{bin,config,installer,program,skins},/etc/logrotate.d}
238 # Main application part:
239 cp -a program/* $RPM_BUILD_ROOT%{_appdir}/program
240 cp -a bin/* $RPM_BUILD_ROOT%{_appdir}/bin
241 cp -a index.php $RPM_BUILD_ROOT%{_appdir}
244 cp -a skins/* $RPM_BUILD_ROOT%{_appdir}/skins
247 cp -a installer/* $RPM_BUILD_ROOT%{_appdir}/installer
248 cp -a config/db.inc.php $RPM_BUILD_ROOT%{_appdir}/config/db.inc.php.dist
249 cp -a config/main.inc.php $RPM_BUILD_ROOT%{_appdir}/config/main.inc.php.dist
250 cp -a SQL $RPM_BUILD_ROOT%{_appdir}
253 cp -a plugins $RPM_BUILD_ROOT%{_appdir}/plugins
256 cp -a config/db.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/db.inc.php
257 cp -a config/main.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/main.inc.php
258 ln -sf %{_sysconfdir}/db.inc.php $RPM_BUILD_ROOT%{_appdir}/config/db.inc.php
259 ln -sf %{_sysconfdir}/main.inc.php $RPM_BUILD_ROOT%{_appdir}/config/main.inc.php
261 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
262 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
263 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
264 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
267 %find_lang %{name}.lang
268 # sed -ne 's/%lang(\([^)]\+\).*/\1/p' %{name}.lang | sort -u | grep _
270 # now package plugins using filelist as well, as due lang tagging the files
271 # section will go unmanageable
272 for p in $RPM_BUILD_ROOT%{_appdir}/plugins/*; do
273 echo "%dir ${p#$RPM_BUILD_ROOT}"
276 p=${p#$RPM_BUILD_ROOT}
281 README | Changelog | config.inc.php.dist)
290 cat plugins.lang >> %{name}.lang
293 rm -rf $RPM_BUILD_ROOT
296 if [ ! -f %{_sysconfdir}/db.inc.php -o ! -f %{_sysconfdir}/main.inc.php ]; then
297 # import configs from previously manually installed site
298 d=/home/services/httpd/html/config
299 if [ -f $d/db.inc.php -o -f $d/main.inc.php ]; then
300 echo >&2 "Importing site configs from $d"
301 mkdir -p %{_sysconfdir}
302 if [ -f $d/db.inc.php ]; then
303 [ -f %{_sysconfdir}/db.inc.php ] && mv -f %{_sysconfdir}/db.inc.php{,.rpmorig}
304 cp -af $d/db.inc.php %{_sysconfdir}/db.inc.php
306 if [ -f $d/main.inc.php ]; then
307 [ -f %{_sysconfdir}/main.inc.php ] && mv -f %{_sysconfdir}/main.inc.php{,.rpmorig}
308 cp -af $d/main.inc.php %{_sysconfdir}/main.inc.php
313 # Note this on version upgrade
314 %triggerpostun -- %{name} < %{version}
315 %banner -e %{name} <<-EOF
316 Run %{_appdir}/bin/update to update to version %{version}.
317 (Be sure to have %{name}-setup installed when you run it)
319 See %{_docdir}/%{name}-%{version}/UPGRADING* for more information.
322 %triggerin -- apache1 < 1.3.37-3, apache1-base
323 %webapp_register apache %{_webapp}
325 %triggerun -- apache1 < 1.3.37-3, apache1-base
326 %webapp_unregister apache %{_webapp}
328 %triggerin -- apache < 2.2.0, apache-base
329 %webapp_register httpd %{_webapp}
331 %triggerun -- apache < 2.2.0, apache-base
332 %webapp_unregister httpd %{_webapp}
334 %triggerin -- lighttpd
335 %webapp_register lighttpd %{_webapp}
337 %triggerun -- lighttpd
338 %webapp_unregister lighttpd %{_webapp}
340 %files -f %{name}.lang
341 %defattr(644,root,root,755)
342 %doc CHANGELOG INSTALL README UPGRADING
343 %dir %attr(750,root,http) %{_sysconfdir}
344 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
345 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
346 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
347 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
348 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
352 %attr(755,root,root) %{_appdir}/bin/*
353 %dir %{_appdir}/config
354 %{_appdir}/config/*.php
355 %dir %{_appdir}/program
356 %{_appdir}/program/*.gif
357 %{_appdir}/program/include
358 %{_appdir}/program/js
359 %{_appdir}/program/lib
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)
374 %dir %{_appdir}/installer
375 %{_appdir}/installer/*.php
376 %{_appdir}/installer/client.js
377 %{_appdir}/installer/styles.css
378 %{_appdir}/installer/welcome.html
379 %{_appdir}/installer/images
380 %{_appdir}/config/*.php.dist
384 %defattr(644,root,root,755)
385 %{_appdir}/skins/default