]> git.pld-linux.org Git - packages/roundcubemail.git/blame - roundcubemail.spec
- fix updatedb.sh in update script
[packages/roundcubemail.git] / roundcubemail.spec
CommitLineData
600b6f8b 1# TODO:
a87cdb0e 2# - use system js/tiny_mce
e0fe6c29 3# - use system js/jquery
32abe254 4# - package: http://blog.ilohamail.org/ and remove boundled classess from it
7859ddcb 5# - test/finish and then enable by default password-anon-ldap-bind patch
33db8acb 6# - bconds does not work for a long time
5d53966e 7#
3f52c0ee 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.
5d53966e 11
2c65974f 12%define rcpfa_ver 1.0.5
e2c7ca4f 13%define php_min_version 5.2.3
e2c7ca4f 14%include /usr/lib/rpm/macros.php
600b6f8b 15Summary: RoundCube Webmail
07c0744d 16Summary(pl.UTF-8): RoundCube Webmail - poczta przez WWW
600b6f8b 17Name: roundcubemail
f4331adf
AZ
18Version: 0.9.4
19Release: 1
102af7f7 20License: GPL v3+
d3874ddf 21Group: Applications/Mail
a4b2ddbf 22Source0: http://downloads.sourceforge.net/roundcubemail/%{name}-%{version}-dep.tar.gz
f4331adf 23# Source0-md5: 8ec32e093983128ef1a87c561bb48c99
62103fec 24Source1: apache.conf
94ca3383 25Source2: %{name}.logrotate
62103fec 26Source3: lighttpd.conf
2c65974f
PG
27Source4: http://nejc.skoberne.net/wp-content/uploads/2008/11/rcpfa-105.tgz
28# Source4-md5: dc23bcd894f693db74fce53b09ab58d6
6a5cb541 29Source5: find-lang.sh
864f8de1 30Source6: httpd.conf
600b6f8b 31Patch0: %{name}-config.patch
6511b436
ER
32Patch1: %{name}-spam.patch
33Patch2: %{name}-postfixadmin-pl_locales.patch
34Patch3: %{name}-faq-page.patch
7859ddcb 35Patch4: %{name}-password-anon-ldap-bind.patch
600b6f8b 36URL: http://www.roundcube.net/
e2c7ca4f 37BuildRequires: rpm-php-pearprov >= 4.4.2-11
0bbcc424 38BuildRequires: rpm-pythonprov
1353aee8 39BuildRequires: rpmbuild(macros) >= 1.566
a87cdb0e 40BuildRequires: sed >= 4.0
3727377d 41Requires: %{name}-skin
e5f15b1f 42Requires: php(core) >= %{php_min_version}
3334c66c 43Requires: php(date)
f7a5e3fd
ER
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)
b8598ece 53Requires: php-pear-DB
47920129 54Requires: php-pear-Mail_Mime >= 1.8.0
1353aee8 55Requires: php-pear-Net_IDNA2 >= 0.1.1
b3ac8b6a 56Requires: php-pear-Net_SMTP
22e93b97 57Requires: rpm-whiteout >= 1.22
600b6f8b 58Requires: webapps
22e93b97 59Requires: webserver(alias)
114a69ab 60Requires: webserver(indexfile)
22e93b97 61Requires: webserver(php)
3334c66c
ER
62Requires(post): openssl-tools
63Suggests: php(exif)
83f90f35 64Suggests: php(fileinfo)
e2c7ca4f 65Suggests: php-gd
a3177d5b 66Suggests: php-intl
83f90f35 67Suggests: php-json
e2c7ca4f
ER
68Suggests: php-mbstring
69Suggests: php-mcrypt
70Suggests: php-openssl
83f90f35 71Suggests: php-pear-Auth_SASL
307f7882
ER
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
ddd8e01c 76Suggests: php-pear-Net_LDAP2
83f90f35
ER
77Suggests: php-pear-Net_Sieve
78Suggests: php-pear-Net_Socket
79Suggests: php-xml
426cfe3d 80Obsoletes: roundcube-plugin-jqueryui
2a334c38 81Obsoletes: roundcubemail-skin-default
864f8de1 82Conflicts: apache-base < 2.4.0-1
a329403c 83Conflicts: logrotate < 3.8.0
600b6f8b
PG
84BuildArch: noarch
85BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
86
87%define _webapps /etc/webapps
5737afb2 88%define _webapp roundcube
600b6f8b
PG
89%define _sysconfdir %{_webapps}/%{_webapp}
90%define _appdir %{_datadir}/%{_webapp}
91%define _appdatadir /var/lib/roundcube
8f3a4fab 92%define _applogdir /var/log/roundcube
e324f8fc 93%define _archivelogdir /var/log/archive/roundcube
600b6f8b 94
6a5cb541
ER
95%define find_lang sh %{SOURCE5} %{buildroot}
96
e2c7ca4f
ER
97# bad depsolver
98%define _noautopear pear
99
100# exclude optional php dependencies
83f90f35 101%define _noautophp php-sqlite php-mysql php-mysqli php-pgsql php-hash php-json php-xml
e2c7ca4f
ER
102
103# put it together for rpmbuild
104%define _noautoreq %{?_noautophp} %{?_noautopear}
105
600b6f8b
PG
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
d9bffeff
JR
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
5d23c484
JB
121XHTML-a i CSS 2.
122
a10cd471 123%package setup
00ff8410 124Summary: Installer script for RoundCube Webmail
a210006f 125Summary(pl.UTF-8): Skrypt instalacyjny RoundCube Webmaila
00ff8410 126Group: Applications/WWW
8b170957 127Requires: %{name} = %{version}-%{release}
00ff8410 128
a10cd471 129%description setup
a210006f
JB
130This package provides installer script for RoundCube Webmail.
131
132%description setup -l pl.UTF-8
133Ten pakiet zawiera skrypt instalacyjny RoundCube Webmaila.
00ff8410 134
1a438f79
SP
135%package skin-classic
136Summary: Classic skin for RoundCube Webmail
137Summary(pl.UTF-8): Klasyczna skórka dla RoundCube Webmaila
3727377d 138Group: Applications/WWW
220183ec 139Requires: %{name} = %{version}-%{release}
3727377d
ER
140Provides: %{name}-skin
141
1a438f79
SP
142%description skin-classic
143Classic skin for RoundCube Webmail.
3727377d 144
1a438f79
SP
145%description skin-classic -l pl.UTF-8
146Klasyczna skórka dla RoundCube Webmaila.
147
148%package skin-larry
e1693d58
SP
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
1a438f79
SP
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.
205b27a0 160
600b6f8b 161%prep
a4b2ddbf 162%setup -q -n %{name}-%{version}-dep %{?with_postfixadmin:-a 4}
600b6f8b 163%patch0 -p1
5d53966e 164%if %{with spamfilter}
6511b436 165%patch1 -p1
5d53966e 166%endif
1e701d3b 167%if %{with postfixadmin}
2c65974f 168#patch2 -p1
1e701d3b 169%endif
1353aee8 170#%patch3 -p1
51610214 171%if %{with password_anon_ldap_bind}
7859ddcb 172%patch4 -p1
173%endif
e1206cba 174
5737afb2
ER
175find -name .svn | xargs -r rm -rf
176
a87cdb0e 177# undos the source
e7167a32
ER
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
a87cdb0e 185
4dc5a7cb 186%{__sed} -i s/indexcontacts.sh/indexcontacts/g bin/update
804d5e45 187%{__sed} -i s/updatedb.sh/update/g bin/update
4dc5a7cb 188
971afbf3 189# tools to pack js
bf039ff8 190rm bin/{jsshrink,jsunshrink}
a517b18b 191
83f90f35
ER
192# php-pear-Net_Sieve 1.3.0
193rm plugins/managesieve/lib/Net/Sieve.php
194
195# now empty dirs
83f90f35
ER
196rmdir plugins/managesieve/lib/Net
197
6a5cb541
ER
198# pear package junk
199rm -v plugins/*/package.xml
200
b9aeba97 201mv config/db.inc.php.dist config/db.inc.php
202mv config/main.inc.php.dist config/main.inc.php
203%if %{with postfixadmin}
fb493b0a 204mv rcpfa-%{rcpfa_ver} rcpfa
2c65974f 205cd rcpfa
a4b2ddbf
ER
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
b9aeba97 224%endif
6f843021 225
d648289b
ER
226# cleanup backups after patching
227find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
228
600b6f8b
PG
229%install
230rm -rf $RPM_BUILD_ROOT
e324f8fc 231install -d $RPM_BUILD_ROOT{%{_appdatadir},%{_applogdir},%{_archivelogdir},%{_sysconfdir}} \
98cf2bae 232 $RPM_BUILD_ROOT{%{_appdir}/{bin,config,installer,program,skins},/etc/logrotate.d}
600b6f8b
PG
233
234# Main application part:
59b0d169 235cp -a program/* $RPM_BUILD_ROOT%{_appdir}/program
e7167a32 236cp -a bin/* $RPM_BUILD_ROOT%{_appdir}/bin
59b0d169 237cp -a index.php $RPM_BUILD_ROOT%{_appdir}
600b6f8b 238
3727377d 239# Skins installation
59b0d169 240cp -a skins/* $RPM_BUILD_ROOT%{_appdir}/skins
600b6f8b 241
98cf2bae
SP
242# Installer part
243cp -a installer/* $RPM_BUILD_ROOT%{_appdir}/installer
a0651488
ER
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}
98cf2bae 247
2a88dca9 248# Plugins
249cp -a plugins $RPM_BUILD_ROOT%{_appdir}/plugins
250
600b6f8b 251## Configuration:
a0651488
ER
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
600b6f8b
PG
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
a4b2ddbf 257cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
864f8de1 258cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
a4b2ddbf
ER
259cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
260cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
32abe254 261
6a5cb541
ER
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
5d23c484
JB
288%clean
289rm -rf $RPM_BUILD_ROOT
290
83b7476e
ER
291%post
292# replace default des string in config file for better security
36122e51 293makedesstr() {
83b7476e 294 openssl rand -hex 12
36122e51 295}
83b7476e
ER
296
297if grep -q '24ByteDESkey' %{_sysconfdir}/main.inc.php; then
449f964a
ER
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
83b7476e
ER
303fi
304
a87cdb0e
ER
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
4e2ae79b
ER
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
a87cdb0e
ER
320 fi
321fi
322
5e4530ac 323# Note this on version upgrade
1353aee8
ER
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
5e4530ac 330Run %{_appdir}/bin/update to update to version %{version}.
83f90f35
ER
331(Be sure to have %{name}-setup installed when you run it)
332
5e4530ac
ER
333See %{_docdir}/%{name}-%{version}/UPGRADING* for more information.
334EOF
335
4fddc0f8 336%triggerin -- apache1 < 1.3.37-3, apache1-base
600b6f8b
PG
337%webapp_register apache %{_webapp}
338
4fddc0f8 339%triggerun -- apache1 < 1.3.37-3, apache1-base
600b6f8b
PG
340%webapp_unregister apache %{_webapp}
341
864f8de1 342%triggerin -- apache-base
600b6f8b
PG
343%webapp_register httpd %{_webapp}
344
864f8de1 345%triggerun -- apache-base
600b6f8b
PG
346%webapp_unregister httpd %{_webapp}
347
beb3779c
PG
348%triggerin -- lighttpd
349%webapp_register lighttpd %{_webapp}
350
351%triggerun -- lighttpd
352%webapp_unregister lighttpd %{_webapp}
353
6a5cb541 354%files -f %{name}.lang
600b6f8b 355%defattr(644,root,root,755)
1a438f79 356%doc CHANGELOG INSTALL README.md UPGRADING
600b6f8b 357%dir %attr(750,root,http) %{_sysconfdir}
32abe254
PG
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
beb3779c 360%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
600b6f8b 361%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
496e37a6 362%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
600b6f8b 363%dir %{_appdir}
7e88f091 364%{_appdir}/*.php
600b6f8b
PG
365%dir %{_appdir}/config
366%{_appdir}/config/*.php
367%dir %{_appdir}/program
59b0d169
ER
368%{_appdir}/program/include
369%{_appdir}/program/js
370%{_appdir}/program/lib
f4331adf 371%{_appdir}/program/resources
59b0d169 372%{_appdir}/program/steps
59b0d169 373%{_appdir}/program/localization/index.inc
6a5cb541
ER
374
375%dir %{_appdir}/plugins
59b0d169 376
290a707d 377%dir %{_appdir}/skins
8f3a4fab 378%dir %attr(770,root,http) %{_applogdir}
e324f8fc 379%dir %attr(751,root,logs) %{_archivelogdir}
600b6f8b 380%dir %attr(770,root,http) %{_appdatadir}
6511b436
ER
381
382# TODO: %ghost logfile(s)
3727377d 383
a10cd471 384%files setup
00ff8410 385%defattr(644,root,root,755)
70c48539
ER
386%dir %{_appdir}/bin
387%attr(755,root,root) %{_appdir}/bin/*
00ff8410
SP
388%dir %{_appdir}/installer
389%{_appdir}/installer/*.php
390%{_appdir}/installer/client.js
391%{_appdir}/installer/styles.css
00ff8410 392%{_appdir}/installer/images
a0651488
ER
393%{_appdir}/config/*.php.dist
394%{_appdir}/SQL
00ff8410 395
1a438f79
SP
396%files skin-classic
397%defattr(644,root,root,755)
398%{_appdir}/skins/classic
399
400%files skin-larry
3727377d 401%defattr(644,root,root,755)
1a438f79 402%{_appdir}/skins/larry
This page took 0.189984 seconds and 4 git commands to generate.