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