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