Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
1 ##
2 ## squirrelmail.spec -- OpenPKG RPM Package Specification
3 ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
4 ##
5 ## Permission to use, copy, modify, and distribute this software for
6 ## any purpose with or without fee is hereby granted, provided that
7 ## the above copyright notice and this permission notice appear in all
8 ## copies.
9 ##
10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE.
22 ##
24 # package version
25 %define V_squirrelmail 1.4.22
26 %define V_locale 1.4.18-20090526
27 %define V_plugin_compat 2.0.16-1.0
28 %define V_plugin_logger 2.3.1-1.2.7
29 %define V_plugin_addgraphics 2.3-1.0.3
30 %define V_plugin_avelsieve 1.9.9
31 %define V_plugin_ldappwd 2.2-1.4.0
32 %define V_plugin_saslpwd 1.4.1-1.4
33 %define V_plugin_checkquota 2.2-1.4.0
34 %define V_plugin_foldersize 1.5-1.4.0
35 %define V_plugin_gnupg 2.1
36 %define V_plugin_ldif 1.4-1.2.x
37 %define V_plugin_update 0.7-1.4.2
38 %define V_plugin_userip 3.3-re-1.2.2
39 %define V_plugin_smallcal 0.8-1.2.3
40 %define V_plugin_vkeyboard 0.9.1
41 %define V_plugin_username 2.3-1.0.0
42 %define V_plugin_loginnotes 1.2-1.4.0
43 %define V_plugin_passforget 2.3-1.0.1
44 %define V_plugin_captcha 1.2.3-1.2.9
45 %define V_plugin_smime 1.0-1.1.1
46 %define V_plugin_debug 1.2-1.4
48 # package information
49 Name: squirrelmail
50 Summary: SquirrelMail Webmail Client
51 URL: http://www.squirrelmail.org/
52 Vendor: Squirrelmail Developers
53 Packager: OpenPKG Foundation e.V.
54 Distribution: OpenPKG Community
55 Class: EVAL
56 Group: Mail
57 License: GPL
58 Version: %{V_squirrelmail}
59 Release: 20120800
61 # package options
62 %option with_plugins no
64 # list of sources
65 Source0: http://switch.dl.sourceforge.net/squirrelmail/stable/%{V_squirrelmail}/squirrelmail-webmail-%{V_squirrelmail}.tar.bz2
66 Source1: http://switch.dl.sourceforge.net/squirrelmail/all_locales-%{V_locale}.tar.bz2
67 Source2: http://www.squirrelmail.org/plugins/compatibility-%{V_plugin_compat}.tar.gz
68 Source3: http://www.squirrelmail.org/plugins/squirrel_logger-%{V_plugin_logger}.tar.gz
69 Source4: http://www.squirrelmail.org/plugins/addgraphics-%{V_plugin_addgraphics}.tar.gz
70 Source5: http://www.squirrelmail.org/plugins/avelsieve-%{V_plugin_avelsieve}.tar.gz
71 Source6: http://www.squirrelmail.org/plugins/change_ldappass-%{V_plugin_ldappwd}.tar.gz
72 Source7: http://www.squirrelmail.org/plugins/chg_sasl_passwd-%{V_plugin_saslpwd}.tar.gz
73 Source8: http://www.squirrelmail.org/plugins/check_quota-%{V_plugin_checkquota}.tar.gz
74 Source9: http://www.squirrelmail.org/plugins/folder_sizes-%{V_plugin_foldersize}.tar.gz
75 Source10: http://www.squirrelmail.org/plugins/gpg-%{V_plugin_gnupg}.tar.gz
76 Source11: http://www.squirrelmail.org/plugins/ldifimport-%{V_plugin_ldif}.tar.gz
77 Source12: http://www.squirrelmail.org/plugins/pupdate.%{V_plugin_update}.tar.gz
78 Source13: http://www.squirrelmail.org/plugins/show_user_and_ip-%{V_plugin_userip}.tar.gz
79 Source14: http://www.squirrelmail.org/plugins/smallcal-%{V_plugin_smallcal}.tar.gz
80 Source15: http://www.squirrelmail.org/plugins/vkeyboard-%{V_plugin_vkeyboard}.tar.gz
81 Source16: http://www.squirrelmail.org/plugins/username-%{V_plugin_username}.tar.gz
82 Source17: http://www.squirrelmail.org/plugins/login_notes-%{V_plugin_loginnotes}.tar.gz
83 Source18: http://www.squirrelmail.org/plugins/password_forget-%{V_plugin_passforget}.tar.gz
84 Source19: http://www.squirrelmail.org/plugins/captcha-%{V_plugin_captcha}.tar.gz
85 Source20: http://www.squirrelmail.org/plugins/smime-%{V_plugin_smime}.tar.gz
86 Source21: http://www.squirrelmail.org/plugins/debugger-%{V_plugin_debug}.tar.gz
87 Source22: config.php
88 Source23: defprefs.txt
89 Source24: opkg_large.png
90 Source25: opkg_small.png
91 Source26: rc.squirrelmail
92 Source27: squirrelmail.conf
93 Source29: index.php
94 Patch0: squirrelmail.patch
95 Patch1: squirrelmail.patch.plugins
97 # build information
98 BuildPreReq: OpenPKG, openpkg >= 20100101
99 PreReq: OpenPKG, openpkg >= 20100101
100 PreReq: MTA, apache, apache-php
101 PreReq: apache-php::with_xml = yes
102 PreReq: apache-php::with_ldap = yes
104 %description
105 SquirrelMail is a standards based webmail package written in PHP. It
106 includes built in pure PHP support for the IMAP and SMTP protocols,
107 and all pages render in pure HTML 4.0 (with no Javascript) for
108 maximum compatibility across browsers. It has very few requirements
109 and is very easy to configure and install. SquirrelMail has all the
110 functionality you would want from an email client, including strong
111 MIME support, address books, and folder manipulation.
113 %track
114 prog squirrelmail = {
115 version = %{V_squirrelmail}
116 url = http://prdownloads.sourceforge.net/squirrelmail/
117 regex = squirrelmail-(\d+\.[02468]\.\d+[a-z]?)\.tar\.bz2
118 }
119 prog squirrelmail:locales = {
120 version = %{V_locale}
121 url = http://prdownloads.sourceforge.net/squirrelmail/
122 regex = all_locales-(\d+\.[02468]\.\d+-\d+)\.tar\.bz2
123 }
124 prog squirrelmail:compat = {
125 comment = "cs: untrackable due to CMS generated URLs"
126 disabled
127 version = %{V_plugin_compat}
128 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
129 regex = compatibility-(__VER__)\.tar\.gz
130 }
131 prog squirrelmail:logger = {
132 version = %{V_plugin_logger}
133 url = http://www.squeaksoft.com/products/SquirrelLogger/
134 regex = squirrel_logger.(__VER__)\.tar\.gz
135 }
136 prog squirrelmail:addgraphics = {
137 comment = "cs: untrackable due to CMS generated URLs"
138 disabled
139 version = %{V_plugin_addgraphics}
140 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
141 regex = addgraphics-(__VER__)\.tar\.gz
142 }
143 prog squirrelmail:avelsieve = {
144 comment = "cs: untrackable due to CMS generated URLs"
145 disabled
146 version = %{V_plugin_avelsieve}
147 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
148 regex = avelsieve-(\d+\.\d+\.\d+)\.tar\.gz
149 }
150 prog squirrelmail:saslpwd = {
151 comment = "cs: untrackable due to CMS generated URLs"
152 disabled
153 version = %{V_plugin_saslpwd}
154 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
155 regex = chg_sasl_passwd-(\d+\.\d+\.\d+-\d+\.\d+)\.tar\.gz
156 }
157 prog squirrelmail:ldappwd = {
158 comment = "cs: untrackable due to CMS generated URLs"
159 disabled
160 version = %{V_plugin_ldappwd}
161 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
162 regex = change_ldappass-(\d+\.\d+-\d+\.\d+\.\d+)\.tar\.gz
163 }
164 prog squirrelmail:checkquota = {
165 comment = "cs: untrackable due to CMS generated URLs"
166 disabled
167 version = %{V_plugin_checkquota}
168 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
169 regex = check_quota-(__VER__)\.tar\.gz
170 }
171 prog squirrelmail:foldersize = {
172 comment = "cs: untrackable due to CMS generated URLs"
173 disabled
174 version = %{V_plugin_foldersize}
175 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
176 regex = folder_sizes-(__VER__)\.tar\.gz
177 }
178 prog squirrelmail:gnupg = {
179 comment = "cs: untrackable due to CMS generated URLs"
180 disabled
181 version = %{V_plugin_gnupg}
182 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
183 regex = gpg-(\d+\.\d+)\.tar\.gz
184 }
185 prog squirrelmail:ldif = {
186 comment = "cs: untrackable due to CMS generated URLs"
187 disabled
188 version = %{V_plugin_ldif}
189 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
190 regex = ldifimport-(__VER__)\.tar\.gz
191 }
192 prog squirrelmail:update = {
193 comment = "cs: untrackable due to CMS generated URLs"
194 disabled
195 version = %{V_plugin_update}
196 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
197 regex = pupdate.(__VER__)\.tar\.gz
198 }
199 prog squirrelmail:userip = {
200 comment = "cs: untrackable due to CMS generated URLs"
201 disabled
202 version = %{V_plugin_userip}
203 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
204 regex = show_user_and_ip-(__VER__)\.tar\.gz
205 }
206 prog squirrelmail:smallcal = {
207 comment = "cs: untrackable due to CMS generated URLs"
208 disabled
209 version = %{V_plugin_smallcal}
210 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
211 regex = smallcal-(__VER__)\.tar\.gz
212 }
213 prog squirrelmail:vkeyboard = {
214 comment = "cs: untrackable due to CMS generated URLs"
215 disabled
216 version = %{V_plugin_vkeyboard}
217 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
218 regex = vkeyboard-(__VER__)\.tar\.gz
219 }
220 prog squirrelmail:username = {
221 comment = "cs: untrackable due to CMS generated URLs"
222 disabled
223 version = %{V_plugin_username}
224 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
225 regex = username-(__VER__)\.tar\.gz
226 }
227 prog squirrelmail:loginnotes = {
228 comment = "cs: untrackable due to CMS generated URLs"
229 disabled
230 version = %{V_plugin_loginnotes}
231 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
232 regex = login_notes--(__VER__)\.tar\.gz
233 }
234 prog squirrelmail:passforget = {
235 comment = "cs: untrackable due to CMS generated URLs"
236 disabled
237 version = %{V_plugin_passforget}
238 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
239 regex = password_forget-(__VER__)\.tar\.gz
240 }
241 prog squirrelmail:captcha = {
242 comment = "cs: untrackable due to CMS generated URLs"
243 disabled
244 version = %{V_plugin_captcha}
245 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
246 regex = captcha-(__VER__)\.tar\.gz
247 }
248 prog squirrelmail:smime = {
249 comment = "cs: untrackable due to CMS generated URLs"
250 disabled
251 version = %{V_plugin_smime}
252 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
253 regex = smime-(__VER__)\.tar\.gz
254 }
255 prog squirrelmail:debugger = {
256 comment = "cs: untrackable due to CMS generated URLs"
257 disabled
258 version = %{V_plugin_debug}
259 url = http://www.squirrelmail.org/plugins_category.php?category_id=all
260 regex = debugger-(__VER__)\.tar\.gz
261 }
263 %prep
264 %setup -q -n squirrelmail-webmail-%{V_squirrelmail}
265 %setup -q -D -T -a 1 -c -n squirrelmail-webmail-%{V_squirrelmail}/all_locales-%{V_locale}
266 %setup -q -D -T -a 2 -n squirrelmail-webmail-%{V_squirrelmail}
267 %setup -q -D -T -a 3 -n squirrelmail-webmail-%{V_squirrelmail}
268 mv compatibility squirrel_logger plugins/
269 %if "%{with_plugins}" == "yes"
270 %setup -q -D -T -a 4 -n squirrelmail-webmail-%{V_squirrelmail}
271 %setup -q -D -T -a 5 -n squirrelmail-webmail-%{V_squirrelmail}
272 %setup -q -D -T -a 6 -n squirrelmail-webmail-%{V_squirrelmail}
273 %setup -q -D -T -a 7 -n squirrelmail-webmail-%{V_squirrelmail}
274 %setup -q -D -T -a 8 -n squirrelmail-webmail-%{V_squirrelmail}
275 %setup -q -D -T -a 9 -n squirrelmail-webmail-%{V_squirrelmail}
276 %setup -q -D -T -a 10 -n squirrelmail-webmail-%{V_squirrelmail}
277 %setup -q -D -T -a 11 -n squirrelmail-webmail-%{V_squirrelmail}
278 %setup -q -D -T -a 12 -n squirrelmail-webmail-%{V_squirrelmail}
279 %setup -q -D -T -a 13 -n squirrelmail-webmail-%{V_squirrelmail}
280 %setup -q -D -T -a 14 -n squirrelmail-webmail-%{V_squirrelmail}
281 %setup -q -D -T -a 15 -n squirrelmail-webmail-%{V_squirrelmail}
282 %setup -q -D -T -a 16 -n squirrelmail-webmail-%{V_squirrelmail}
283 %setup -q -D -T -a 17 -n squirrelmail-webmail-%{V_squirrelmail}
284 %setup -q -D -T -a 18 -n squirrelmail-webmail-%{V_squirrelmail}
285 %setup -q -D -T -a 19 -n squirrelmail-webmail-%{V_squirrelmail}
286 %setup -q -D -T -a 20 -n squirrelmail-webmail-%{V_squirrelmail}
287 %setup -q -D -T -a 21 -n squirrelmail-webmail-%{V_squirrelmail}
289 # move additional plugins where other are already placed
290 for plug in addgraphics avelsieve check_quota chg_sasl_passwd \
291 change_ldappass folder_sizes gpg ldifimport pupdate \
292 show_user_and_ip smallcal vkeyboard username \
293 login_notes password_forget captcha smime debugger; do
294 mv $plug plugins/
295 done
296 %endif
298 # clean up login screen of distractions
299 %patch -p0
301 # rearrange documentation and remove archive script
302 mv themes/README.themes locale/README.locales doc/
303 for fil in `find plugins/ -name "README*" -o -name "Readme*" \
304 -o -name "INSTALL*" -o -name CHANGES -o -name HISTORY`; do
305 %{l_shtool} mkdir -f -p -m 755 doc/`dirname $fil`
306 mv -f $fil $_
307 done
308 rm -rf doc/plugins/squirrelspell/doc doc/plugins/squirrelspell/index.php
309 mv plugins/squirrelspell/doc/* doc/plugins/squirrelspell
310 rm -rf plugins/squirrelspell/doc
311 %if "%{with_plugins}" == "yes"
312 mv plugins/pupdate/docs/* doc/plugins/pupdate
313 rm -rf plugins/pupdate/docs
314 %endif
316 # postadjustment cosmetics
317 %{l_shtool} subst \
318 -e 's;\(\$color\[4\], .border="0" width=\)"350";\1"250";1' \
319 src/login.php
321 # set default prefs
322 cat %{SOURCE defprefs.txt} >>data/default_pref
324 %build
326 %install
327 # create directory structure
328 %{l_shtool} mkdir -f -p -m 755 \
329 $RPM_BUILD_ROOT%{l_prefix}/bin \
330 $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail \
331 $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/prefs \
332 $RPM_BUILD_ROOT%{l_prefix}/var/squirrelmail/spool/attach \
333 $RPM_BUILD_ROOT%{l_prefix}/var/squirrelmail/log
335 # install locales
336 ( cd all_locales-%{V_locale}
337 cp -rpf help images locale $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/
338 ) || exit $?
340 # install program
341 # install default_pref
342 %{l_shtool} install -c -m 644 \
343 data/default_pref \
344 $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/prefs/
346 # create initial administrator list
347 echo %{l_musr} >>$RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/admins
349 # copy over most functional directories, a lot of stuff
350 for dir in class doc functions include plugins src themes; do
351 cp -rpf $dir $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/
352 done
353 cp -rpf images/* $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/
354 cp -pf locale/timezones.cfg $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/locale/
356 # install main config files
357 l_fqdm=`%{l_shtool} echo -e %h%d`
358 %{l_shtool} install -c -m 644 %{l_value -s -a} \
359 -e 's;config/\(config_local.php\);\1;g' \
360 -e "s;@l_fqdm@;${l_fqdm};g" \
361 %{SOURCE config.php} \
362 config/config_default.php \
363 config/config_local.php \
364 $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/
365 %if "%{with_plugins}" == "yes"
366 ( cd $RPM_BUILD_ROOT%{l_prefix}
367 %{l_patch} -p0 <%{PATCH squirrelmail.patch.plugins}
368 rm -f $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/functions/*.orig
369 rm -f $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/src/*.orig
370 ) || exit $?
371 %endif
373 # install plugin config files
374 ( cd $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins
375 %if "%{with_plugins}" == "yes"
376 cp -pf check_quota/config.sample.php check_quota/config.php
377 cp -pf chg_sasl_passwd/config.php.sample chg_sasl_passwd/config.php
378 cp -pf show_user_and_ip/config.php.sample show_user_and_ip/config.php
379 %{l_shtool} install -c -m 644 \
380 -e "s;sm_logo\.png;opkg_small.png;" \
381 -e "s;SquirrelMail Logo;OpenPKG Logo;" \
382 -e "s;www\.squirrelmail\.org;www.openpkg.org;" \
383 -e "s;\/\/\(\$image_width.*\) = 308;\1 = 201;" \
384 -e "s;\/\/\(\$image_height.*\) = 111;\1 = 62;" \
385 addgraphics/config.php.typical.one.domain \
386 addgraphics/config.php
387 %{l_shtool} install -c -m 644 \
388 -e 's/^\(\$sieve_preferred_sasl_mech =\).*/\1 "PLAIN LOGIN CRAM-MD5 DIGEST-MD5";/' \
389 -e 's/^\(\$avelsieve_oldcyrus =\).*/\1 false;/' \
390 -e 's/^\(\$startitems =\).*/\1 4;/' \
391 avelsieve/config/config_sample.php \
392 avelsieve/config/config.php
393 %{l_shtool} install -c -m 644 \
394 change_ldappass/config_sample.php \
395 change_ldappass/config.php
396 %{l_shtool} install -c -m 644 \
397 login_notes/config.sample.php \
398 login_notes/config.php
399 %{l_shtool} install -c -m 644 \
400 password_forget/config_example.php \
401 password_forget/config.php
402 %{l_shtool} install -c -m 644 \
403 -e 's;^//\( *.CAPTCHA.,\);\1;g' \
404 -e 's,\(\$sl_dateformat *=\).*\(.\);$,\1 \2d.m.Y H:i:s\2;,g' \
405 -e 's,\(\$sl_logfile *=\).*\(.\);$,\1 \2%{l_prefix}/var/squirrelmail/log/squirrelmail.log\2;,g' \
406 squirrel_logger/config_example.php \
407 squirrel_logger/config.php
408 %{l_shtool} install -c -m 644 \
409 -e 's/\(\$log_CAPTCHA_events *=\).*/\1 1;/' \
410 -e 's,\(\$captcha_backend *=\).*\(.\);$,\1 \2recaptcha\2;,' \
411 captcha/config_example.php \
412 captcha/config.php
413 for captname in \
414 b2evo captcha_php csi freecap hec hn_captcha opencaptcha \
415 phpcaptcha quickcaptcha quickform recaptcha textcaptcha
416 do
417 mv \
418 captcha/backends/${captname}/${captname}_config_example.php \
419 captcha/backends/${captname}/${captname}_config.php
420 done
421 %{l_shtool} install -c -m 644 \
422 smime/config_example.php \
423 smime/config.php
424 %{l_shtool} subst \
425 -e 's;\(path_to_gpg=\)/usr/bin/gpg.*;\1%{l_prefix}/bin/gpg;' \
426 gpg/gpg_local_prefs.txt
427 %{l_shtool} install -c -m 644 \
428 -e 's;\(adminusername = "\)[^"]*;\1%{l_musr};' \
429 -e 's;corehide = 1;corehide = 0;' \
430 pupdate/config.php.sample \
431 pupdate/config.php
432 %{l_shtool} install -c -m 644 \
433 -e "s;\(\$vkeyboard_msgsize.*\)'medium';\1'x-small';" \
434 -e "s;\(\$vkeyboard_layout.*\)'us_english';\1'portuguese_abnt2';" \
435 -e "s;\(\$vkeyboard_height.*\)'250';\1'270';" \
436 vkeyboard/config.php.sample \
437 vkeyboard/config.php
438 cp -pf username/config.php.sample username/config.php
439 %{l_shtool} install -c -m 644 \
440 %{SOURCE opkg_small.png} \
441 $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/
442 %endif
443 ) || exit $?
445 # install squirrelmail configuration perl script
446 %{l_shtool} install -c -m 755 \
447 -e 's;chdir($dir);chdir("%{l_prefix}/etc/squirrelmail");g' \
448 -e 's;\.\./plugins;%{l_prefix}/share/squirrelmail/plugins;g' \
449 -e 's;\.\./themes;%{l_prefix}/share/squirrelmail/themes;g' \
450 -e 's;config/config_local.php;config_local.php;g' \
451 config/conf.pl \
452 $RPM_BUILD_ROOT%{l_prefix}/bin/squirrelconf
454 # use our own logo, a squirrel next to a OpenPKG package
455 %{l_shtool} install -c -m 644 \
456 %{SOURCE opkg_large.png} \
457 $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/
459 # install runcommand script
460 %{l_shtool} mkdir -f -p -m 755 \
461 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
462 %{l_shtool} install -c -m 755 %{l_value -s -a} \
463 %{SOURCE rc.squirrelmail} \
464 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
466 # correct path to optional perl interpreter
467 %{l_shtool} subst \
468 -e 's;#!/usr/bin/env perl;#! %{l_prefix}/bin/perl;' \
469 $RPM_BUILD_ROOT%{l_prefix}/bin/squirrelconf
471 # replace false /etc config paths throughout
472 %{l_shtool} subst \
473 -e 's;SM_PATH \. \(.\)config/;\1%{l_prefix}/etc/squirrelmail/;g' \
474 -e 's;require_once(SM_PATH \. \(.*\)%{l_prefix};require_once(\1%{l_prefix};g' \
475 $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/functions/*.php \
476 $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/include/*.php \
477 $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/administrator/*.php \
478 $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/calendar/*.php \
479 $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/src/*.php
481 # integration into Apache under /webmail
482 %{l_shtool} mkdir -f -p -m 755 \
483 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d
484 %{l_shtool} install -c -m 644 %{l_value -s -a} \
485 %{SOURCE squirrelmail.conf} \
486 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/
487 %{l_shtool} install -c -m 644 %{l_value -s -a} \
488 %{SOURCE index.php} \
489 $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/
491 # determine package ingredients and tag config files
492 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
493 %{l_files_std} \
494 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/etc/squirrelmail/*' \
495 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/prefs/*' \
496 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/squirrelspell/sqspell_config.php' \
497 %if "%{with_plugins}" == "yes"
498 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/addgraphics/config.php' \
499 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/avelsieve/config/config.php' \
500 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/check_quota/config.php' \
501 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/chg_sasl_passwd/config.php' \
502 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/change_ldappass/config.php' \
503 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/folder_sizes/folder_sizes.php' \
504 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/gpg/gpg_local_prefs.txt' \
505 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/ldifimport/config.php' \
506 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/pupdate/config.php' \
507 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/show_user_and_ip/config.php' \
508 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/squirrel_logger/config.php' \
509 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/vkeyboard/config.php' \
510 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/username/config.php' \
511 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/login_notes/config.php' \
512 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/password_forget/config.php' \
513 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/config.php' \
514 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/b2evo/b2evo_config.php' \
515 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/captcha_php/captcha_php_config.php' \
516 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/csi/csi_config.php' \
517 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/freecap/freecap_config.php' \
518 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/hec/hec_config.php' \
519 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/hn_captcha/hn_captcha_config.php' \
520 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/opencaptcha/opencaptcha_config.php' \
521 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/phpcaptcha/phpcaptcha_config.php' \
522 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/quickcaptcha/quickcaptcha_config.php' \
523 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/quickform/quickform_config.php' \
524 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/recaptcha/recaptcha_config.php' \
525 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/textcaptcha/textcaptcha_config.php' \
526 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/smime/config.php' \
527 '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/debugger/setup.php' \
528 %endif
529 '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/share/squirrelmail/prefs' \
530 '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/squirrelmail/spool/attach' \
531 '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/squirrelmail/log'
533 %files -f files
535 %clean
537 %preun
538 # before erase, remove log files
539 [ $1 -eq 0 ] || exit 0
540 rm -f $RPM_INSTALL_PREFIX/var/squirrelmail/log/*.log >/dev/null 2>&1 || true