]> git.pld-linux.org Git - packages/roundcubemail.git/blame_incremental - roundcubemail.spec
- fix updatedb.sh in update script
[packages/roundcubemail.git] / roundcubemail.spec
... / ...
CommitLineData
1# TODO:
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
7#
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.
11
12%define rcpfa_ver 1.0.5
13%define php_min_version 5.2.3
14%include /usr/lib/rpm/macros.php
15Summary: RoundCube Webmail
16Summary(pl.UTF-8): RoundCube Webmail - poczta przez WWW
17Name: roundcubemail
18Version: 0.9.4
19Release: 1
20License: GPL v3+
21Group: Applications/Mail
22Source0: http://downloads.sourceforge.net/roundcubemail/%{name}-%{version}-dep.tar.gz
23# Source0-md5: 8ec32e093983128ef1a87c561bb48c99
24Source1: apache.conf
25Source2: %{name}.logrotate
26Source3: lighttpd.conf
27Source4: http://nejc.skoberne.net/wp-content/uploads/2008/11/rcpfa-105.tgz
28# Source4-md5: dc23bcd894f693db74fce53b09ab58d6
29Source5: find-lang.sh
30Source6: httpd.conf
31Patch0: %{name}-config.patch
32Patch1: %{name}-spam.patch
33Patch2: %{name}-postfixadmin-pl_locales.patch
34Patch3: %{name}-faq-page.patch
35Patch4: %{name}-password-anon-ldap-bind.patch
36URL: http://www.roundcube.net/
37BuildRequires: rpm-php-pearprov >= 4.4.2-11
38BuildRequires: rpm-pythonprov
39BuildRequires: rpmbuild(macros) >= 1.566
40BuildRequires: sed >= 4.0
41Requires: %{name}-skin
42Requires: php(core) >= %{php_min_version}
43Requires: php(date)
44Requires: php(dom)
45Requires: php(iconv)
46Requires: php(imap)
47Requires: php(pcre)
48Requires: php(session)
49Requires: php(simplexml)
50Requires: php(sockets)
51Requires: php(spl)
52Requires: php(xml)
53Requires: php-pear-DB
54Requires: php-pear-Mail_Mime >= 1.8.0
55Requires: php-pear-Net_IDNA2 >= 0.1.1
56Requires: php-pear-Net_SMTP
57Requires: rpm-whiteout >= 1.22
58Requires: webapps
59Requires: webserver(alias)
60Requires: webserver(indexfile)
61Requires: webserver(php)
62Requires(post): openssl-tools
63Suggests: php(exif)
64Suggests: php(fileinfo)
65Suggests: php-gd
66Suggests: php-intl
67Suggests: php-json
68Suggests: php-mbstring
69Suggests: php-mcrypt
70Suggests: php-openssl
71Suggests: php-pear-Auth_SASL
72# at least one MDB2 db driver needed
73Suggests: php-pear-MDB2_Driver_mysql
74Suggests: php-pear-MDB2_Driver_pgsql
75Suggests: php-pear-MDB2_Driver_sqlite
76Suggests: php-pear-Net_LDAP2
77Suggests: php-pear-Net_Sieve
78Suggests: php-pear-Net_Socket
79Suggests: php-xml
80Obsoletes: roundcube-plugin-jqueryui
81Obsoletes: roundcubemail-skin-default
82Conflicts: apache-base < 2.4.0-1
83Conflicts: logrotate < 3.8.0
84BuildArch: noarch
85BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
86
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
94
95%define find_lang sh %{SOURCE5} %{buildroot}
96
97# bad depsolver
98%define _noautopear pear
99
100# exclude optional php dependencies
101%define _noautophp php-sqlite php-mysql php-mysqli php-pgsql php-hash php-json php-xml
102
103# put it together for rpmbuild
104%define _noautoreq %{?_noautophp} %{?_noautopear}
105
106%description
107RoundCube Webmail is a browser-based multilingual IMAP client with an
108application-like user interface. It provides full functionality you
109expect from an e-mail client, including MIME support, address book,
110folder manipulation and message filters. RoundCube Webmail is written
111in PHP and requires the MySQL database. The user interface is fully
112skinnable using XHTML and CSS 2.
113
114%description -l pl.UTF-8
115RoundCube Webmail to oparty na przeglądarce wielojęzyczny klient PHP z
116interfejsem użytkownika podobnym do aplikacji. Udostępnia pełną
117funkcjonalność jakiej można oczekiwać od klienta pocztowego, w tym
118obsługę MIME, książkę adresową, operacje na folderach i filtry
119wiadomości. RoundCube Webmail jest napisany w PHP i wymaga bazy danych
120MySQL. Interfejs użytkownika można w pełni obudować skórką przy użyciu
121XHTML-a i CSS 2.
122
123%package setup
124Summary: Installer script for RoundCube Webmail
125Summary(pl.UTF-8): Skrypt instalacyjny RoundCube Webmaila
126Group: Applications/WWW
127Requires: %{name} = %{version}-%{release}
128
129%description setup
130This package provides installer script for RoundCube Webmail.
131
132%description setup -l pl.UTF-8
133Ten pakiet zawiera skrypt instalacyjny RoundCube Webmaila.
134
135%package skin-classic
136Summary: Classic skin for RoundCube Webmail
137Summary(pl.UTF-8): Klasyczna skórka dla RoundCube Webmaila
138Group: Applications/WWW
139Requires: %{name} = %{version}-%{release}
140Provides: %{name}-skin
141
142%description skin-classic
143Classic skin for RoundCube Webmail.
144
145%description skin-classic -l pl.UTF-8
146Klasyczna skórka dla RoundCube Webmaila.
147
148%package skin-larry
149Summary: Larry skin for RoundCube Webmail
150Summary(pl.UTF-8): Skórka Larry dla RoundCube Webmaila
151Group: Applications/WWW
152Requires: %{name} = %{version}-%{release}
153Provides: %{name}-skin
154
155%description skin-larry
156Larry skin for RoundCube Webmail.
157
158%description skin-larry -l pl.UTF-8
159Skórka Larry dla RoundCube Webmaila.
160
161%prep
162%setup -q -n %{name}-%{version}-dep %{?with_postfixadmin:-a 4}
163%patch0 -p1
164%if %{with spamfilter}
165%patch1 -p1
166%endif
167%if %{with postfixadmin}
168#patch2 -p1
169%endif
170#%patch3 -p1
171%if %{with password_anon_ldap_bind}
172%patch4 -p1
173%endif
174
175find -name .svn | xargs -r rm -rf
176
177# undos the source
178%undos -f php,inc,js,css
179
180# kill extensions and fill proper shebang
181%{__sed} -i -e '1s,^#!.*php,#!%{__php},' bin/*.sh
182for a in bin/*.sh; do
183 mv $a ${a%.sh}
184done
185
186%{__sed} -i s/indexcontacts.sh/indexcontacts/g bin/update
187%{__sed} -i s/updatedb.sh/update/g bin/update
188
189# tools to pack js
190rm bin/{jsshrink,jsunshrink}
191
192# php-pear-Net_Sieve 1.3.0
193rm plugins/managesieve/lib/Net/Sieve.php
194
195# now empty dirs
196rmdir plugins/managesieve/lib/Net
197
198# pear package junk
199rm -v plugins/*/package.xml
200
201mv config/db.inc.php.dist config/db.inc.php
202mv config/main.inc.php.dist config/main.inc.php
203%if %{with postfixadmin}
204mv rcpfa-%{rcpfa_ver} rcpfa
205cd rcpfa
206cp -p code/forwarding.html ../skins/default/templates
207cp -p code/password.html ../skins/default/templates
208cp -p code/vacation.html ../skins/default/templates
209cp -p code/pfa_forwarding.inc ../program/steps/settings
210cp -p code/pfa_password.inc ../program/steps/settings
211cp -p code/pfa_vacation.inc ../program/steps/settings
212cp -p code/pfa.php ../program/include
213
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
224%endif
225
226# cleanup backups after patching
227find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
228
229%install
230rm -rf $RPM_BUILD_ROOT
231install -d $RPM_BUILD_ROOT{%{_appdatadir},%{_applogdir},%{_archivelogdir},%{_sysconfdir}} \
232 $RPM_BUILD_ROOT{%{_appdir}/{bin,config,installer,program,skins},/etc/logrotate.d}
233
234# Main application part:
235cp -a program/* $RPM_BUILD_ROOT%{_appdir}/program
236cp -a bin/* $RPM_BUILD_ROOT%{_appdir}/bin
237cp -a index.php $RPM_BUILD_ROOT%{_appdir}
238
239# Skins installation
240cp -a skins/* $RPM_BUILD_ROOT%{_appdir}/skins
241
242# Installer part
243cp -a installer/* $RPM_BUILD_ROOT%{_appdir}/installer
244cp -a config/db.inc.php $RPM_BUILD_ROOT%{_appdir}/config/db.inc.php.dist
245cp -a config/main.inc.php $RPM_BUILD_ROOT%{_appdir}/config/main.inc.php.dist
246cp -a SQL $RPM_BUILD_ROOT%{_appdir}
247
248# Plugins
249cp -a plugins $RPM_BUILD_ROOT%{_appdir}/plugins
250
251## Configuration:
252cp -a config/db.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/db.inc.php
253cp -a config/main.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/main.inc.php
254ln -sf %{_sysconfdir}/db.inc.php $RPM_BUILD_ROOT%{_appdir}/config/db.inc.php
255ln -sf %{_sysconfdir}/main.inc.php $RPM_BUILD_ROOT%{_appdir}/config/main.inc.php
256
257cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
258cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
259cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
260cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
261
262# find locales
263%find_lang %{name}.lang
264# sed -ne 's/%lang(\([^)]\+\).*/\1/p' %{name}.lang | sort -u | grep _
265
266# now package plugins using filelist as well, as due lang tagging the files
267# section will go unmanageable
268for p in $RPM_BUILD_ROOT%{_appdir}/plugins/*; do
269 echo "%dir ${p#$RPM_BUILD_ROOT}"
270 for p in $p/*; do
271 d=${p##*/}
272 p=${p#$RPM_BUILD_ROOT}
273 case "$d" in
274 localization)
275 continue
276 ;;
277 README | Changelog | config.inc.php.dist)
278 echo "%doc $p"
279 ;;
280 *)
281 echo "$p"
282 ;;
283 esac
284 done
285done > plugins.lang
286cat plugins.lang >> %{name}.lang
287
288%clean
289rm -rf $RPM_BUILD_ROOT
290
291%post
292# replace default des string in config file for better security
293makedesstr() {
294 openssl rand -hex 12
295}
296
297if grep -q '24ByteDESkey' %{_sysconfdir}/main.inc.php; then
298 des=$(makedesstr)
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
302 fi
303fi
304
305%pretrans
306if [ ! -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
315 fi
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
319 fi
320 fi
321fi
322
323# Note this on version upgrade
324%triggerpostun -- %{name} < %{version}-0
325# don't do anything on --downgrade
326if [ $1 -le 1 ]; then
327 exit 0
328fi
329%banner -e %{name}-upgrade <<-EOF
330Run %{_appdir}/bin/update to update to version %{version}.
331(Be sure to have %{name}-setup installed when you run it)
332
333See %{_docdir}/%{name}-%{version}/UPGRADING* for more information.
334EOF
335
336%triggerin -- apache1 < 1.3.37-3, apache1-base
337%webapp_register apache %{_webapp}
338
339%triggerun -- apache1 < 1.3.37-3, apache1-base
340%webapp_unregister apache %{_webapp}
341
342%triggerin -- apache-base
343%webapp_register httpd %{_webapp}
344
345%triggerun -- apache-base
346%webapp_unregister httpd %{_webapp}
347
348%triggerin -- lighttpd
349%webapp_register lighttpd %{_webapp}
350
351%triggerun -- lighttpd
352%webapp_unregister lighttpd %{_webapp}
353
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}
363%dir %{_appdir}
364%{_appdir}/*.php
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
374
375%dir %{_appdir}/plugins
376
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}
381
382# TODO: %ghost logfile(s)
383
384%files setup
385%defattr(644,root,root,755)
386%dir %{_appdir}/bin
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
394%{_appdir}/SQL
395
396%files skin-classic
397%defattr(644,root,root,755)
398%{_appdir}/skins/classic
399
400%files skin-larry
401%defattr(644,root,root,755)
402%{_appdir}/skins/larry
This page took 0.031736 seconds and 4 git commands to generate.