]> git.pld-linux.org Git - packages/roundcubemail.git/blob - roundcubemail.spec
- BR: rpm-pythonprov
[packages/roundcubemail.git] / roundcubemail.spec
1 # TODO:
2 # - use gpl-dependant tarball, instead of full tarball and removing all bundled libs again?
3 #   see: http://www.roundcubeforum.net/3-news-announcements/32-news-announcements/6601-roundcube-news-new-version-0-4-beta-released.html
4 # - move bin/* to -setup which are related to upgrading/setup
5 # - use system js/tiny_mce
6 # - use system js/jquery
7 # - use system magic db: program/lib/magic
8 # - package: http://blog.ilohamail.org/ and remove boundled classess from it
9 # - Some php-database backend. Suggests?
10 # - test/finish and then enable by default password-anon-ldap-bind patch
11 #
12 %bcond_with     spamfilter      # Build with spamfilter patch
13 %bcond_with     postfixadmin    # Build with postfixadmin support patch
14 %bcond_with     password_anon_ldap_bind # apply with password-anon-ldap-bind patch.
15
16 %define         rcpfa_ver       1.0.5
17 %define         php_min_version 5.2.3
18 %include        /usr/lib/rpm/macros.php
19 Summary:        RoundCube Webmail
20 Summary(pl.UTF-8):      RoundCube Webmail - poczta przez WWW
21 Name:           roundcubemail
22 Version:        0.5
23 Release:        3
24 License:        GPL v2
25 Group:          Applications/Mail
26 Source0:        http://downloads.sourceforge.net/roundcubemail/%{name}-%{version}.tar.gz
27 # Source0-md5:  66111e52784221c56c477adb60cc7f5c
28 Source1:        apache.conf
29 Source2:        %{name}.logrotate
30 Source3:        lighttpd.conf
31 Source4:        http://nejc.skoberne.net/wp-content/uploads/2008/11/rcpfa-105.tgz
32 # Source4-md5:  dc23bcd894f693db74fce53b09ab58d6
33 Source5:        find-lang.sh
34 Patch0:         %{name}-config.patch
35 Patch1:         %{name}-spam.patch
36 Patch2:         %{name}-postfixadmin-pl_locales.patch
37 Patch3:         %{name}-faq-page.patch
38 Patch4:         %{name}-password-anon-ldap-bind.patch
39 Patch5:         use-iconv.patch
40 URL:            http://www.roundcube.net/
41 BuildRequires:  rpm-php-pearprov >= 4.4.2-11
42 BuildRequires:  rpm-pythonprov
43 BuildRequires:  rpmbuild(macros) >= 1.566
44 BuildRequires:  sed >= 4.0
45 Requires:       %{name}-skin
46 Requires:       php-common >= 4:%{php_min_version}
47 Requires:       php-date
48 Requires:       php-dom
49 Requires:       php-iconv
50 Requires:       php-imap
51 Requires:       php-pcre
52 Requires:       php-pear-DB
53 Requires:       php-pear-Mail_Mime
54 Requires:       php-pear-Net_IDNA2 >= 0.1.1
55 Requires:       php-pear-Net_SMTP
56 Requires:       php-session
57 Requires:       php-simplexml
58 Requires:       php-sockets
59 Requires:       php-spl
60 Requires:       php-xml
61 Requires:       rpm-whiteout >= 1.22
62 Requires:       webapps
63 Requires:       webserver(alias)
64 Requires:       webserver(indexfile)
65 Requires:       webserver(php)
66 Suggests:       php(fileinfo)
67 Suggests:       php-gd
68 Suggests:       php-json
69 Suggests:       php-mbstring
70 Suggests:       php-mcrypt
71 Suggests:       php-openssl
72 Suggests:       php-pear-Auth_SASL
73 Suggests:       php-pear-Net_LDAP2
74 Suggests:       php-pear-Net_Sieve
75 Suggests:       php-pear-Net_Socket
76 Suggests:       php-xml
77 Conflicts:      logrotate < 3.7-4
78 BuildArch:      noarch
79 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
80
81 %define         _webapps        /etc/webapps
82 %define         _webapp         roundcube
83 %define         _sysconfdir     %{_webapps}/%{_webapp}
84 %define         _appdir         %{_datadir}/%{_webapp}
85 %define         _appdatadir     /var/lib/roundcube
86 %define         _applogdir      /var/log/roundcube
87 %define         _archivelogdir  /var/log/archive/roundcube
88
89 %define         find_lang       sh %{SOURCE5} %{buildroot}
90
91 # bad depsolver
92 %define         _noautopear     pear
93
94 # exclude optional php dependencies
95 %define         _noautophp      php-sqlite php-mysql php-mysqli php-pgsql php-hash php-json php-xml
96
97 # put it together for rpmbuild
98 %define         _noautoreq      %{?_noautophp} %{?_noautopear}
99
100 %description
101 RoundCube Webmail is a browser-based multilingual IMAP client with an
102 application-like user interface. It provides full functionality you
103 expect from an e-mail client, including MIME support, address book,
104 folder manipulation and message filters. RoundCube Webmail is written
105 in PHP and requires the MySQL database. The user interface is fully
106 skinnable using XHTML and CSS 2.
107
108 %description -l pl.UTF-8
109 RoundCube Webmail to oparty na przeglądarce wielojęzyczny klient PHP z
110 interfejsem użytkownika podobnym do aplikacji. Udostępnia pełną
111 funkcjonalność jakiej można oczekiwać od klienta pocztowego, w tym
112 obsługę MIME, książkę adresową, operacje na folderach i filtry
113 wiadomości. RoundCube Webmail jest napisany w PHP i wymaga bazy danych
114 MySQL. Interfejs użytkownika można w pełni obudować skórką przy użyciu
115 XHTML-a i CSS 2.
116
117 %package setup
118 Summary:        Installer script for RoundCube Webmail
119 Summary(pl.UTF-8):      Skrypt instalacyjny RoundCube Webmaila
120 Group:          Applications/WWW
121 Requires:       %{name} = %{version}-%{release}
122
123 %description setup
124 This package provides installer script for RoundCube Webmail.
125
126 %description setup -l pl.UTF-8
127 Ten pakiet zawiera skrypt instalacyjny RoundCube Webmaila.
128
129 %package skin-default
130 Summary:        Default skin for RoundCube Webmail
131 Summary(pl.UTF-8):      Domyślna skórka dla RoundCube Webmaila
132 Group:          Applications/WWW
133 Requires:       %{name} = %{version}-%{release}
134 Provides:       %{name}-skin
135
136 %description skin-default
137 Default skin for RoundCube Webmail.
138
139 %description skin-default -l pl.UTF-8
140 Domyślna skórka dla RoundCube Webmaila.
141
142 %prep
143 %setup -q %{?with_postfixadmin:-a 4}
144 %patch0 -p1
145 %if %{with spamfilter}
146 %patch1 -p1
147 %endif
148 %if %{with postfixadmin}
149 #patch2 -p1
150 %endif
151 #%patch3 -p1
152 %if %{with password_anon_ldap_bind}
153 %patch4 -p1
154 %endif
155 %patch5 -p1
156
157 find -name .svn | xargs -r rm -rf
158
159 # undos the source
160 %undos -f php,inc,js,css
161
162 # kill extensions and fill proper shebang
163 %{__sed} -i -e '1s,^#!.*php,#!%{__php},' bin/*.sh
164 for a in bin/*.sh; do
165         mv $a ${a%.sh}
166 done
167
168 # unpacked js sources
169 find -name '*.src' | xargs rm -v
170
171 # rm utf8.class and deps, we use iconv extension
172 rm program/lib/utf8.class.php
173 rm -r program/lib/encoding
174
175 # php-pear-PEAR-core 1.9.0 (used indirectly)
176 rm program/lib/PEAR.php
177 rm program/lib/PEAR5.php
178
179 # php-pear-Net_Socket 1.0.9 (used by password, managesieve plugins)
180 rm program/lib/Net/Socket.php
181
182 # php-pear-Net_SMTP 1.4.2 (nothing seem to use it)
183 rm program/lib/Net/SMTP.php
184
185 # php-pear-Auth_SASL 1.0.4 (used by managesieve)
186 rm program/lib/Auth/SASL.php
187 rm -r program/lib/Auth/SASL
188
189 # php-pear-Mail_Mime 1.8.0 (nothing seems to use it)
190 rm program/lib/Mail/mime.php
191 rm program/lib/Mail/mimePart.php
192
193 # php-pear-Net_Sieve 1.3.0
194 rm plugins/managesieve/lib/Net/Sieve.php
195
196 # 0.1.1 snapshot (at least r301175)
197 rm program/lib/Net/IDNA2.php
198 rm -r program/lib/Net/IDNA2
199
200 # now empty dirs
201 rmdir program/lib/Auth
202 rmdir program/lib/Mail
203 rmdir program/lib/Net
204 rmdir plugins/managesieve/lib/Net
205
206 # unknown MDB2 version (newer than released 2.5.0b2, or modified by rc)
207 #rm program/lib/MDB2.php
208
209 # pear package junk
210 rm -v plugins/*/package.xml
211
212 mv config/db.inc.php.dist config/db.inc.php
213 mv config/main.inc.php.dist config/main.inc.php
214 %if %{with postfixadmin}
215 mv rcpfa-%{rcpfa_ver} rcpfa
216 cd rcpfa
217 cp code/forwarding.html ../skins/default/templates
218 cp code/password.html ../skins/default/templates
219 cp code/vacation.html ../skins/default/templates
220 cp code/pfa_forwarding.inc ../program/steps/settings
221 cp code/pfa_password.inc ../program/steps/settings
222 cp code/pfa_vacation.inc ../program/steps/settings
223 cp code/pfa.php ../program/include
224
225 patch -d .. -p1 < diffs/app.js.diff
226 patch -d .. -p1 < diffs/db.inc.php.diff
227 patch -d .. -p1 < diffs/func.inc.diff
228 patch -d .. -p1 < diffs/index.php.diff
229 patch -d .. -p1 < diffs/labels.inc.diff
230 patch -d .. -p1 < diffs/main.inc.diff
231 patch -d .. -p1 < diffs/main.inc.php.diff
232 patch -d .. -p1 < diffs/messages.inc.diff
233 patch -d .. -p1 < diffs/rcube_user.php.diff
234 patch -d .. -p1 < diffs/settingstabs.html.diff
235 %endif
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 config/db.inc.php $RPM_BUILD_ROOT%{_appdir}/config/db.inc.php.dist
253 cp -a config/main.inc.php $RPM_BUILD_ROOT%{_appdir}/config/main.inc.php.dist
254 cp -a SQL $RPM_BUILD_ROOT%{_appdir}
255
256 # Plugins
257 cp -a plugins $RPM_BUILD_ROOT%{_appdir}/plugins
258
259 ## Configuration:
260 cp -a config/db.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/db.inc.php
261 cp -a config/main.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/main.inc.php
262 ln -sf %{_sysconfdir}/db.inc.php $RPM_BUILD_ROOT%{_appdir}/config/db.inc.php
263 ln -sf %{_sysconfdir}/main.inc.php $RPM_BUILD_ROOT%{_appdir}/config/main.inc.php
264
265 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
266 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
267 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
268 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
269
270 # find locales
271 %find_lang %{name}.lang
272 # sed -ne 's/%lang(\([^)]\+\).*/\1/p' %{name}.lang | sort -u | grep _
273
274 # now package plugins using filelist as well, as due lang tagging the files
275 # section will go unmanageable
276 for p in $RPM_BUILD_ROOT%{_appdir}/plugins/*; do
277         echo "%dir ${p#$RPM_BUILD_ROOT}"
278         for p in $p/*; do
279                 d=${p##*/}
280                 p=${p#$RPM_BUILD_ROOT}
281                 case "$d" in
282                 localization)
283                         continue
284                         ;;
285                 README | Changelog | config.inc.php.dist)
286                         echo "%doc $p"
287                         ;;
288                 *)
289                         echo "$p"
290                         ;;
291                 esac
292         done
293 done > plugins.lang
294 cat plugins.lang >> %{name}.lang
295
296 %clean
297 rm -rf $RPM_BUILD_ROOT
298
299 %pretrans
300 if [ ! -f %{_sysconfdir}/db.inc.php -o ! -f %{_sysconfdir}/main.inc.php ]; then
301         # import configs from previously manually installed site
302         d=/home/services/httpd/html/config
303         if [ -f $d/db.inc.php -o -f $d/main.inc.php ]; then
304                 echo >&2 "Importing site configs from $d"
305                 mkdir -p %{_sysconfdir}
306                 if [ -f $d/db.inc.php ]; then
307                         [ -f %{_sysconfdir}/db.inc.php ] && mv -f %{_sysconfdir}/db.inc.php{,.rpmorig}
308                         cp -af $d/db.inc.php %{_sysconfdir}/db.inc.php
309                 fi
310                 if [ -f $d/main.inc.php ]; then
311                         [ -f %{_sysconfdir}/main.inc.php ] && mv -f %{_sysconfdir}/main.inc.php{,.rpmorig}
312                         cp -af $d/main.inc.php %{_sysconfdir}/main.inc.php
313                 fi
314         fi
315 fi
316
317 # Note this on version upgrade
318 %triggerpostun -- %{name} < %{version}-0
319 # don't do anything on --downgrade
320 if [ $1 -le 1 ]; then
321         exit 0
322 fi
323 %banner -e %{name}-upgrade <<-EOF
324 Run %{_appdir}/bin/update to update to version %{version}.
325 (Be sure to have %{name}-setup installed when you run it)
326
327 See %{_docdir}/%{name}-%{version}/UPGRADING* for more information.
328 EOF
329
330 %triggerin -- apache1 < 1.3.37-3, apache1-base
331 %webapp_register apache %{_webapp}
332
333 %triggerun -- apache1 < 1.3.37-3, apache1-base
334 %webapp_unregister apache %{_webapp}
335
336 %triggerin -- apache < 2.2.0, apache-base
337 %webapp_register httpd %{_webapp}
338
339 %triggerun -- apache < 2.2.0, apache-base
340 %webapp_unregister httpd %{_webapp}
341
342 %triggerin -- lighttpd
343 %webapp_register lighttpd %{_webapp}
344
345 %triggerun -- lighttpd
346 %webapp_unregister lighttpd %{_webapp}
347
348 %files -f %{name}.lang
349 %defattr(644,root,root,755)
350 %doc CHANGELOG INSTALL README UPGRADING
351 %dir %attr(750,root,http) %{_sysconfdir}
352 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
353 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
354 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
355 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
356 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
357 %dir %{_appdir}
358 %{_appdir}/*.php
359 %dir %{_appdir}/bin
360 %attr(755,root,root) %{_appdir}/bin/*
361 %dir %{_appdir}/config
362 %{_appdir}/config/*.php
363 %dir %{_appdir}/program
364 %{_appdir}/program/*.gif
365 %{_appdir}/program/include
366 %{_appdir}/program/js
367 %{_appdir}/program/lib
368 %{_appdir}/program/steps
369 %{_appdir}/program/localization/index.inc
370
371 %dir %{_appdir}/plugins
372
373 %dir %{_appdir}/skins
374 %dir %attr(770,root,http) %{_applogdir}
375 %dir %attr(751,root,logs) %{_archivelogdir}
376 %dir %attr(770,root,http) %{_appdatadir}
377
378 # TODO: %ghost logfile(s)
379
380 %files setup
381 %defattr(644,root,root,755)
382 %dir %{_appdir}/installer
383 %{_appdir}/installer/*.php
384 %{_appdir}/installer/client.js
385 %{_appdir}/installer/styles.css
386 %{_appdir}/installer/welcome.html
387 %{_appdir}/installer/images
388 %{_appdir}/config/*.php.dist
389 %{_appdir}/SQL
390
391 %files skin-default
392 %defattr(644,root,root,755)
393 %{_appdir}/skins/default
This page took 0.097684 seconds and 4 git commands to generate.