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