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