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