squirrelmail/squirrelmail.spec

Mon, 28 Jan 2013 17:37:18 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 28 Jan 2013 17:37:18 +0100
changeset 758
a2c6460cfb16
parent 537
37b427bb60b2
permissions
-rw-r--r--

Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.

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

mercurial