]> git.pld-linux.org Git - packages/roundcubemail.git/blame - roundcubemail.spec
up to 1.3.8
[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
b075bafc 13%define php_min_version 5.4.0
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
a5355114 18Version: 1.3.8
b075bafc 19Release: 1
102af7f7 20License: GPL v3+
d3874ddf 21Group: Applications/Mail
f8403417 22Source0: https://github.com/roundcube/roundcubemail/releases/download/%{version}/%{name}-%{version}-complete.tar.gz
a5355114 23# Source0-md5: 5f5cbed05328722862d7bded2449519e
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
df210e96 39BuildRequires: rpmbuild(macros) >= 1.654
a87cdb0e 40BuildRequires: sed >= 4.0
3727377d 41Requires: %{name}-skin
e5f15b1f 42Requires: php(core) >= %{php_min_version}
3334c66c 43Requires: php(date)
f7a5e3fd 44Requires: php(dom)
a9aeb3f2 45Requires: php(filter)
f7a5e3fd
ER
46Requires: php(iconv)
47Requires: php(imap)
a9aeb3f2
GP
48Requires: php(json)
49Requires: php(mbstring)
50Requires: php(mcrypt)
b075bafc 51Requires: php(openssl)
f7a5e3fd 52Requires: php(pcre)
a9aeb3f2 53Requires: php(pdo)
f7a5e3fd
ER
54Requires: php(session)
55Requires: php(simplexml)
56Requires: php(sockets)
57Requires: php(spl)
58Requires: php(xml)
b075bafc 59Requires: php-pear-Mail_Mime >= 1.10.0
1353aee8 60Requires: php-pear-Net_IDNA2 >= 0.1.1
b075bafc 61Requires: php-pear-Net_SMTP >= 1.7.1
22e93b97 62Requires: rpm-whiteout >= 1.22
600b6f8b 63Requires: webapps
22e93b97 64Requires: webserver(alias)
114a69ab 65Requires: webserver(indexfile)
22e93b97 66Requires: webserver(php)
3334c66c
ER
67Requires(post): openssl-tools
68Suggests: php(exif)
83f90f35 69Suggests: php(fileinfo)
df210e96 70Suggests: php(gd)
f8403417 71Suggests: php(imagick)
df210e96 72Suggests: php(intl)
df210e96
ER
73Suggests: php(openssl)
74Suggests: php(xml)
a9aeb3f2
GP
75Suggests: php(zip)
76Suggests: php-pear-Auth_SASL >= 1.0.6
77# at least one pdo db driver needed
a9aeb3f2 78Suggests: php(pdo-mysql)
f8403417 79Suggests: php(pdo-pgsql)
a9aeb3f2 80Suggests: php(pdo-sqlite)
b075bafc 81Suggests: php-pear-Crypt_GPG >= 1.6.0
ddd8e01c 82Suggests: php-pear-Net_LDAP2
a9aeb3f2 83Suggests: php-pear-Net_Sieve >= 1.3.2
b075bafc 84Suggests: php-pear-Net_Socket >= 1.0.12
426cfe3d 85Obsoletes: roundcube-plugin-jqueryui
2a334c38 86Obsoletes: roundcubemail-skin-default
864f8de1 87Conflicts: apache-base < 2.4.0-1
a329403c 88Conflicts: logrotate < 3.8.0
600b6f8b
PG
89BuildArch: noarch
90BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
91
92%define _webapps /etc/webapps
5737afb2 93%define _webapp roundcube
600b6f8b
PG
94%define _sysconfdir %{_webapps}/%{_webapp}
95%define _appdir %{_datadir}/%{_webapp}
96%define _appdatadir /var/lib/roundcube
8f3a4fab 97%define _applogdir /var/log/roundcube
e324f8fc 98%define _archivelogdir /var/log/archive/roundcube
600b6f8b 99
6a5cb541
ER
100%define find_lang sh %{SOURCE5} %{buildroot}
101
df210e96 102%define _noautoreq_pear .*
e2c7ca4f
ER
103
104# exclude optional php dependencies
83f90f35 105%define _noautophp php-sqlite php-mysql php-mysqli php-pgsql php-hash php-json php-xml
e2c7ca4f
ER
106
107# put it together for rpmbuild
df210e96 108%define _noautoreq %{?_noautophp}
e2c7ca4f 109
600b6f8b
PG
110%description
111RoundCube Webmail is a browser-based multilingual IMAP client with an
112application-like user interface. It provides full functionality you
113expect from an e-mail client, including MIME support, address book,
114folder manipulation and message filters. RoundCube Webmail is written
115in PHP and requires the MySQL database. The user interface is fully
116skinnable using XHTML and CSS 2.
117
d9bffeff
JR
118%description -l pl.UTF-8
119RoundCube Webmail to oparty na przeglądarce wielojęzyczny klient PHP z
120interfejsem użytkownika podobnym do aplikacji. Udostępnia pełną
121funkcjonalność jakiej można oczekiwać od klienta pocztowego, w tym
122obsługę MIME, książkę adresową, operacje na folderach i filtry
123wiadomości. RoundCube Webmail jest napisany w PHP i wymaga bazy danych
124MySQL. Interfejs użytkownika można w pełni obudować skórką przy użyciu
5d23c484
JB
125XHTML-a i CSS 2.
126
a10cd471 127%package setup
00ff8410 128Summary: Installer script for RoundCube Webmail
a210006f 129Summary(pl.UTF-8): Skrypt instalacyjny RoundCube Webmaila
00ff8410 130Group: Applications/WWW
8b170957 131Requires: %{name} = %{version}-%{release}
00ff8410 132
a10cd471 133%description setup
a210006f
JB
134This package provides installer script for RoundCube Webmail.
135
136%description setup -l pl.UTF-8
137Ten pakiet zawiera skrypt instalacyjny RoundCube Webmaila.
00ff8410 138
1a438f79
SP
139%package skin-classic
140Summary: Classic skin for RoundCube Webmail
141Summary(pl.UTF-8): Klasyczna skórka dla RoundCube Webmaila
3727377d 142Group: Applications/WWW
220183ec 143Requires: %{name} = %{version}-%{release}
3727377d
ER
144Provides: %{name}-skin
145
1a438f79
SP
146%description skin-classic
147Classic skin for RoundCube Webmail.
3727377d 148
1a438f79
SP
149%description skin-classic -l pl.UTF-8
150Klasyczna skórka dla RoundCube Webmaila.
151
152%package skin-larry
e1693d58
SP
153Summary: Larry skin for RoundCube Webmail
154Summary(pl.UTF-8): Skórka Larry dla RoundCube Webmaila
155Group: Applications/WWW
156Requires: %{name} = %{version}-%{release}
157Provides: %{name}-skin
1a438f79
SP
158
159%description skin-larry
160Larry skin for RoundCube Webmail.
161
162%description skin-larry -l pl.UTF-8
163Skórka Larry dla RoundCube Webmaila.
205b27a0 164
600b6f8b 165%prep
f8403417 166%setup -q %{?with_postfixadmin:-a 4}
600b6f8b 167%patch0 -p1
5d53966e 168%if %{with spamfilter}
6511b436 169%patch1 -p1
5d53966e 170%endif
1e701d3b 171%if %{with postfixadmin}
2c65974f 172#patch2 -p1
1e701d3b 173%endif
1353aee8 174#%patch3 -p1
51610214 175%if %{with password_anon_ldap_bind}
7859ddcb 176%patch4 -p1
177%endif
e1206cba 178
5737afb2
ER
179find -name .svn | xargs -r rm -rf
180
a87cdb0e 181# undos the source
e7167a32
ER
182%undos -f php,inc,js,css
183
df210e96
ER
184# fill proper shebang
185%{__sed} -i -e '1s,^#!.*php,#!/usr/bin/php,' bin/*.sh
04afd850
ER
186# these are php scripts really
187for a in $(grep -l '<?php' bin/*.sh); do
188 mv $a ${a%.sh}
189done
190%{__sed} -i s/indexcontacts.sh/indexcontacts/g bin/update
191%{__sed} -i s/updatedb.sh/updatedb/g bin/update
4dc5a7cb 192
971afbf3 193# tools to pack js
df210e96 194rm bin/jsshrink.sh
04afd850 195rm bin/cssshrink.sh
83f90f35 196
df210e96
ER
197mv config/config.inc.php{.sample,}
198
b9aeba97 199%if %{with postfixadmin}
fb493b0a 200mv rcpfa-%{rcpfa_ver} rcpfa
2c65974f 201cd rcpfa
a4b2ddbf
ER
202cp -p code/forwarding.html ../skins/default/templates
203cp -p code/password.html ../skins/default/templates
204cp -p code/vacation.html ../skins/default/templates
205cp -p code/pfa_forwarding.inc ../program/steps/settings
206cp -p code/pfa_password.inc ../program/steps/settings
207cp -p code/pfa_vacation.inc ../program/steps/settings
208cp -p code/pfa.php ../program/include
209
210%{__patch} -d .. -p1 < diffs/app.js.diff
211%{__patch} -d .. -p1 < diffs/db.inc.php.diff
212%{__patch} -d .. -p1 < diffs/func.inc.diff
213%{__patch} -d .. -p1 < diffs/index.php.diff
214%{__patch} -d .. -p1 < diffs/labels.inc.diff
215%{__patch} -d .. -p1 < diffs/main.inc.diff
df210e96 216%{__patch} -d .. -p1 < diffs/config.inc.php.diff
a4b2ddbf
ER
217%{__patch} -d .. -p1 < diffs/messages.inc.diff
218%{__patch} -d .. -p1 < diffs/rcube_user.php.diff
219%{__patch} -d .. -p1 < diffs/settingstabs.html.diff
b9aeba97 220%endif
6f843021 221
d648289b
ER
222# cleanup backups after patching
223find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
224
600b6f8b
PG
225%install
226rm -rf $RPM_BUILD_ROOT
e324f8fc 227install -d $RPM_BUILD_ROOT{%{_appdatadir},%{_applogdir},%{_archivelogdir},%{_sysconfdir}} \
e05ae475 228 $RPM_BUILD_ROOT{%{_appdir}/{bin,config,installer,program,skins},/etc/logrotate.d}
600b6f8b
PG
229
230# Main application part:
59b0d169 231cp -a program/* $RPM_BUILD_ROOT%{_appdir}/program
e7167a32 232cp -a bin/* $RPM_BUILD_ROOT%{_appdir}/bin
59b0d169 233cp -a index.php $RPM_BUILD_ROOT%{_appdir}
600b6f8b 234
3727377d 235# Skins installation
59b0d169 236cp -a skins/* $RPM_BUILD_ROOT%{_appdir}/skins
600b6f8b 237
98cf2bae
SP
238# Installer part
239cp -a installer/* $RPM_BUILD_ROOT%{_appdir}/installer
a0651488 240cp -a SQL $RPM_BUILD_ROOT%{_appdir}
98cf2bae 241
2a88dca9 242# Plugins
243cp -a plugins $RPM_BUILD_ROOT%{_appdir}/plugins
244
600b6f8b 245## Configuration:
e05ae475
ER
246for a in config/*.php; do
247 cp -p $a $RPM_BUILD_ROOT%{_sysconfdir}
248 ln -s %{_sysconfdir}/$(basename $a) $RPM_BUILD_ROOT%{_appdir}/config
249done
a4b2ddbf 250cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
864f8de1 251cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
a4b2ddbf
ER
252cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
253cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
32abe254 254
6a5cb541
ER
255# find locales
256%find_lang %{name}.lang
257# sed -ne 's/%lang(\([^)]\+\).*/\1/p' %{name}.lang | sort -u | grep _
258
259# now package plugins using filelist as well, as due lang tagging the files
260# section will go unmanageable
261for p in $RPM_BUILD_ROOT%{_appdir}/plugins/*; do
262 echo "%dir ${p#$RPM_BUILD_ROOT}"
263 for p in $p/*; do
264 d=${p##*/}
265 p=${p#$RPM_BUILD_ROOT}
266 case "$d" in
267 localization)
268 continue
269 ;;
df210e96 270 README | Changelog | composer.json | config.inc.php.dist)
6a5cb541
ER
271 echo "%doc $p"
272 ;;
273 *)
274 echo "$p"
275 ;;
276 esac
277 done
278done > plugins.lang
279cat plugins.lang >> %{name}.lang
280
5d23c484
JB
281%clean
282rm -rf $RPM_BUILD_ROOT
283
83b7476e
ER
284%post
285# replace default des string in config file for better security
36122e51 286makedesstr() {
83b7476e 287 openssl rand -hex 12
36122e51 288}
83b7476e 289
df210e96 290if grep -q '24ByteDESkey' %{_sysconfdir}/config.inc.php; then
449f964a
ER
291 des=$(makedesstr)
292 # precaution if random str generation failed
293 if [ c$(echo -n "$des" | wc -c) = c24 ]; then
df210e96 294 %{__sed} -i -e "s/rcmail-\!24ByteDESkey\*Str/$des/" %{_sysconfdir}/config.inc.php
a87cdb0e
ER
295 fi
296fi
297
5e4530ac 298# Note this on version upgrade
1353aee8
ER
299%triggerpostun -- %{name} < %{version}-0
300# don't do anything on --downgrade
301if [ $1 -le 1 ]; then
302 exit 0
303fi
304%banner -e %{name}-upgrade <<-EOF
5e4530ac 305Run %{_appdir}/bin/update to update to version %{version}.
83f90f35
ER
306(Be sure to have %{name}-setup installed when you run it)
307
5e4530ac
ER
308See %{_docdir}/%{name}-%{version}/UPGRADING* for more information.
309EOF
310
4fddc0f8 311%triggerin -- apache1 < 1.3.37-3, apache1-base
600b6f8b
PG
312%webapp_register apache %{_webapp}
313
4fddc0f8 314%triggerun -- apache1 < 1.3.37-3, apache1-base
600b6f8b
PG
315%webapp_unregister apache %{_webapp}
316
864f8de1 317%triggerin -- apache-base
600b6f8b
PG
318%webapp_register httpd %{_webapp}
319
864f8de1 320%triggerun -- apache-base
600b6f8b
PG
321%webapp_unregister httpd %{_webapp}
322
beb3779c
PG
323%triggerin -- lighttpd
324%webapp_register lighttpd %{_webapp}
325
326%triggerun -- lighttpd
327%webapp_unregister lighttpd %{_webapp}
328
6a5cb541 329%files -f %{name}.lang
600b6f8b 330%defattr(644,root,root,755)
1a438f79 331%doc CHANGELOG INSTALL README.md UPGRADING
600b6f8b 332%dir %attr(750,root,http) %{_sysconfdir}
32abe254
PG
333%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
334%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
beb3779c 335%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
df210e96
ER
336%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.inc.php
337%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/defaults.inc.php
338%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mimetypes.php
496e37a6 339%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
600b6f8b 340%dir %{_appdir}
7e88f091 341%{_appdir}/*.php
df210e96 342%{_appdir}/config
600b6f8b 343%dir %{_appdir}/program
59b0d169
ER
344%{_appdir}/program/include
345%{_appdir}/program/js
346%{_appdir}/program/lib
f4331adf 347%{_appdir}/program/resources
59b0d169 348%{_appdir}/program/steps
59b0d169 349%{_appdir}/program/localization/index.inc
6a5cb541
ER
350
351%dir %{_appdir}/plugins
59b0d169 352
290a707d 353%dir %{_appdir}/skins
8f3a4fab 354%dir %attr(770,root,http) %{_applogdir}
e324f8fc 355%dir %attr(751,root,logs) %{_archivelogdir}
600b6f8b 356%dir %attr(770,root,http) %{_appdatadir}
6511b436
ER
357
358# TODO: %ghost logfile(s)
3727377d 359
a10cd471 360%files setup
00ff8410 361%defattr(644,root,root,755)
70c48539
ER
362%dir %{_appdir}/bin
363%attr(755,root,root) %{_appdir}/bin/*
00ff8410
SP
364%dir %{_appdir}/installer
365%{_appdir}/installer/*.php
366%{_appdir}/installer/client.js
367%{_appdir}/installer/styles.css
00ff8410 368%{_appdir}/installer/images
a0651488 369%{_appdir}/SQL
00ff8410 370
1a438f79
SP
371%files skin-classic
372%defattr(644,root,root,755)
373%{_appdir}/skins/classic
374
375%files skin-larry
3727377d 376%defattr(644,root,root,755)
1a438f79 377%{_appdir}/skins/larry
This page took 0.185338 seconds and 4 git commands to generate.