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