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