squirrelmail/squirrelmail.spec

changeset 157
3214ed6c04f6
child 159
5524672ebbe7
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/squirrelmail/squirrelmail.spec	Wed Apr 15 22:49:00 2009 +0200
     1.3 @@ -0,0 +1,457 @@
     1.4 +##
     1.5 +##  squirrelmail.spec -- OpenPKG RPM Package Specification
     1.6 +##  Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   package version
    1.28 +%define       V_squirrelmail        1.4.17
    1.29 +%define       V_locale              1.4.13-20071220
    1.30 +%define       V_plugin_compat       2.0.9-1.0
    1.31 +%define       V_plugin_logger       1.4.0-1.0.6
    1.32 +%define       V_plugin_addgraphics  2.3-1.0.3
    1.33 +%define       V_plugin_avelsieve    1.9.7
    1.34 +%define       V_plugin_saslpwd      1.4.1-1.4
    1.35 +%define       V_plugin_checkquota   2.2-1.4.0
    1.36 +%define       V_plugin_foldersize   1.5-1.4.0
    1.37 +%define       V_plugin_gnupg        2.0.1-1.4.2
    1.38 +%define       V_plugin_ldif         1.4-1.2.x
    1.39 +%define       V_plugin_update       0.7-1.4.2
    1.40 +%define       V_plugin_userip       3.3-re-1.2.2
    1.41 +%define       V_plugin_smallcal     0.8-1.2.3
    1.42 +%define       V_plugin_vkeyboard    0.9
    1.43 +%define       V_plugin_username     2.3-1.0.0
    1.44 +
    1.45 +#   package information
    1.46 +Name:         squirrelmail
    1.47 +Summary:      SquirrelMail Webmail Client
    1.48 +URL:          http://www.squirrelmail.org/
    1.49 +Vendor:       Squirrelmail Developers
    1.50 +Packager:     OpenPKG Foundation e.V.
    1.51 +Distribution: OpenPKG Community
    1.52 +Class:        EVAL
    1.53 +Group:        Mail
    1.54 +License:      GPL
    1.55 +Version:      %{V_squirrelmail}
    1.56 +Release:      20090327
    1.57 +
    1.58 +#   package options
    1.59 +%option       with_plugins  no
    1.60 +%option       with_kolab    no
    1.61 +
    1.62 +#   list of sources
    1.63 +Source0:      http://switch.dl.sourceforge.net/squirrelmail/squirrelmail-%{V_squirrelmail}.tar.bz2
    1.64 +Source1:      http://switch.dl.sourceforge.net/squirrelmail/all_locales-%{V_locale}.tar.bz2
    1.65 +Source2:      http://www.squirrelmail.org/plugins/compatibility-%{V_plugin_compat}.tar.gz
    1.66 +Source3:      http://www.squeaksoft.com/products/SquirrelLogger/squirrel_logger.%{V_plugin_logger}.tar.gz
    1.67 +Source4:      http://www.squirrelmail.org/plugins/addgraphics-%{V_plugin_addgraphics}.tar.gz
    1.68 +Source5:      http://www.squirrelmail.org/plugins/avelsieve-%{V_plugin_avelsieve}.tar.gz
    1.69 +Source6:      http://www.squirrelmail.org/plugins/chg_sasl_passwd-%{V_plugin_saslpwd}.tar.gz
    1.70 +Source7:      http://www.squirrelmail.org/plugins/check_quota-%{V_plugin_checkquota}.tar.gz
    1.71 +Source8:      http://www.squirrelmail.org/plugins/folder_sizes-%{V_plugin_foldersize}.tar.gz
    1.72 +Source9:      http://www.squirrelmail.org/plugins/gpg.%{V_plugin_gnupg}.tar.gz
    1.73 +Source10:     http://www.squirrelmail.org/plugins/ldifimport-%{V_plugin_ldif}.tar.gz
    1.74 +Source11:     http://www.squirrelmail.org/plugins/pupdate.%{V_plugin_update}.tar.gz
    1.75 +Source12:     http://www.squirrelmail.org/plugins/show_user_and_ip-%{V_plugin_userip}.tar.gz
    1.76 +Source13:     http://www.squirrelmail.org/plugins/smallcal-%{V_plugin_smallcal}.tar.gz
    1.77 +Source14:     http://www.squirrelmail.org/plugins/vkeyboard-%{V_plugin_vkeyboard}.tar.gz
    1.78 +Source15:     http://www.squirrelmail.org/plugins/username-%{V_plugin_username}.tar.gz
    1.79 +Source16:     config.php
    1.80 +Source17:     defprefs.txt
    1.81 +Source18:     opkg_large.png
    1.82 +Source19:     opkg_small.png
    1.83 +Source20:     rc.squirrelmail
    1.84 +Source21:     squirrelmail.conf
    1.85 +Source22:     config_local_kolab.php
    1.86 +Source23:     index.php
    1.87 +Patch0:       squirrelmail.patch
    1.88 +Patch1:       squirrelmail.patch.plugins
    1.89 +
    1.90 +#   build information
    1.91 +Prefix:       %{l_prefix}
    1.92 +BuildRoot:    %{l_buildroot}
    1.93 +BuildPreReq:  OpenPKG, openpkg >= 20060823
    1.94 +PreReq:       OpenPKG, openpkg >= 20060823
    1.95 +PreReq:       MTA, apache, apache-php, apache-php::with_xml = yes
    1.96 +AutoReq:      no
    1.97 +AutoReqProv:  no
    1.98 +
    1.99 +%description
   1.100 +    SquirrelMail is a standards-based webmail package written in PHP. It
   1.101 +    includes built-in pure PHP support for the IMAP and SMTP protocols,
   1.102 +    and all pages render in pure HTML 4.0 (with no Javascript) for
   1.103 +    maximum compatibility across browsers. It has very few requirements
   1.104 +    and is very easy to configure and install. SquirrelMail has all the
   1.105 +    functionality you would want from an email client, including strong
   1.106 +    MIME support, address books, and folder manipulation.
   1.107 +
   1.108 +%track
   1.109 +    prog squirrelmail = {
   1.110 +        version   = %{V_squirrelmail}
   1.111 +        url       = http://prdownloads.sourceforge.net/squirrelmail/
   1.112 +        regex     = squirrelmail-(\d+\.[02468]\.\d+[a-z]?)\.tar\.bz2
   1.113 +    }
   1.114 +    prog squirrelmail:locales = {
   1.115 +        version   = %{V_locale}
   1.116 +        url       = http://prdownloads.sourceforge.net/squirrelmail/
   1.117 +        regex     = all_locales-(\d+\.[02468]\.\d+-\d+)\.tar\.bz2
   1.118 +    }
   1.119 +    prog squirrelmail:compat = {
   1.120 +        comment   = "cs: untrackable due to CMS generated URLs"
   1.121 +        disabled
   1.122 +        version   = %{V_plugin_compat}
   1.123 +        url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   1.124 +        regex     = compatibility-(__VER__)\.tar\.gz
   1.125 +    }
   1.126 +    prog squirrelmail:logger = {
   1.127 +        version   = %{V_plugin_logger}
   1.128 +        url       = http://www.squeaksoft.com/products/SquirrelLogger/
   1.129 +        regex     = squirrel_logger.(__VER__)\.tar\.gz
   1.130 +    }
   1.131 +    prog squirrelmail:addgraphics = {
   1.132 +        comment   = "cs: untrackable due to CMS generated URLs"
   1.133 +        disabled
   1.134 +        version   = %{V_plugin_addgraphics}
   1.135 +        url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   1.136 +        regex     = addgraphics-(__VER__)\.tar\.gz
   1.137 +    }
   1.138 +    prog squirrelmail:avelsieve = {
   1.139 +        comment   = "cs: untrackable due to CMS generated URLs"
   1.140 +        disabled
   1.141 +        version   = %{V_plugin_avelsieve}
   1.142 +        url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   1.143 +        regex     = avelsieve-(\d+\.\d+\.\d+)\.tar\.gz
   1.144 +    }
   1.145 +    prog squirrelmail:saslpwd = {
   1.146 +        comment   = "cs: untrackable due to CMS generated URLs"
   1.147 +        disabled
   1.148 +        version   = %{V_plugin_saslpwd}
   1.149 +        url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   1.150 +        regex     = chg_sasl_passwd-(\d+\.\d+\.\d+-\d+\.\d+)\.tar\.gz
   1.151 +    }
   1.152 +    prog squirrelmail:checkquota = {
   1.153 +        comment   = "cs: untrackable due to CMS generated URLs"
   1.154 +        disabled
   1.155 +        version   = %{V_plugin_checkquota}
   1.156 +        url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   1.157 +        regex     = check_quota-(__VER__)\.tar\.gz
   1.158 +    }
   1.159 +    prog squirrelmail:foldersize = {
   1.160 +        comment   = "cs: untrackable due to CMS generated URLs"
   1.161 +        disabled
   1.162 +        version   = %{V_plugin_foldersize}
   1.163 +        url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   1.164 +        regex     = folder_sizes-(__VER__)\.tar\.gz
   1.165 +    }
   1.166 +    prog squirrelmail:gnupg = {
   1.167 +        comment   = "cs: untrackable due to CMS generated URLs"
   1.168 +        disabled
   1.169 +        version   = %{V_plugin_gnupg}
   1.170 +        url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   1.171 +        regex     = gpg.(\d+\.\d+\.\d+-\d+\.\d+\.\d+)\.tar\.gz
   1.172 +    }
   1.173 +    prog squirrelmail:ldif = {
   1.174 +        comment   = "cs: untrackable due to CMS generated URLs"
   1.175 +        disabled
   1.176 +        version   = %{V_plugin_ldif}
   1.177 +        url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   1.178 +        regex     = ldifimport-(__VER__)\.tar\.gz
   1.179 +    }
   1.180 +    prog squirrelmail:update = {
   1.181 +        comment   = "cs: untrackable due to CMS generated URLs"
   1.182 +        disabled
   1.183 +        version   = %{V_plugin_update}
   1.184 +        url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   1.185 +        regex     = pupdate.(__VER__)\.tar\.gz
   1.186 +    }
   1.187 +    prog squirrelmail:userip = {
   1.188 +        comment   = "cs: untrackable due to CMS generated URLs"
   1.189 +        disabled
   1.190 +        version   = %{V_plugin_userip}
   1.191 +        url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   1.192 +        regex     = show_user_and_ip-(__VER__)\.tar\.gz
   1.193 +    }
   1.194 +    prog squirrelmail:smallcal = {
   1.195 +        comment   = "cs: untrackable due to CMS generated URLs"
   1.196 +        disabled
   1.197 +        version   = %{V_plugin_smallcal}
   1.198 +        url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   1.199 +        regex     = smallcal-(__VER__)\.tar\.gz
   1.200 +    }
   1.201 +    prog squirrelmail:vkeyboard = {
   1.202 +        comment   = "cs: untrackable due to CMS generated URLs"
   1.203 +        disabled
   1.204 +        version   = %{V_plugin_vkeyboard}
   1.205 +        url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   1.206 +        regex     = vkeyboard-(__VER__)\.tar\.gz
   1.207 +    }
   1.208 +    prog squirrelmail:username = {
   1.209 +        comment   = "cs: untrackable due to CMS generated URLs"
   1.210 +        disabled
   1.211 +        version   = %{V_plugin_username}
   1.212 +        url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   1.213 +        regex     = username-(__VER__)\.tar\.gz
   1.214 +    }
   1.215 +
   1.216 +%prep
   1.217 +    %setup -q -c -n squirrelmail
   1.218 +    %setup -q -D -T -a 1 -c -n squirrelmail/all_locales-%{V_locale}
   1.219 +    %setup -q -D -T -a 2 -n squirrelmail
   1.220 +    %setup -q -D -T -a 3 -n squirrelmail
   1.221 +    mv compatibility squirrelmail-%{V_squirrelmail}/plugins
   1.222 +    mv squirrel_logger squirrelmail-%{V_squirrelmail}/plugins
   1.223 +%if "%{with_plugins}" == "yes"
   1.224 +    %setup -q -D -T -a 4 -n squirrelmail
   1.225 +    %setup -q -D -T -a 5 -n squirrelmail
   1.226 +    %setup -q -D -T -a 6 -n squirrelmail
   1.227 +    %setup -q -D -T -a 7 -n squirrelmail
   1.228 +    %setup -q -D -T -a 8 -n squirrelmail
   1.229 +    %setup -q -D -T -a 9 -n squirrelmail
   1.230 +    %setup -q -D -T -a 10 -n squirrelmail
   1.231 +    %setup -q -D -T -a 11 -n squirrelmail
   1.232 +    %setup -q -D -T -a 12 -n squirrelmail
   1.233 +    %setup -q -D -T -a 13 -n squirrelmail
   1.234 +    %setup -q -D -T -a 14 -n squirrelmail
   1.235 +    %setup -q -D -T -a 15 -n squirrelmail
   1.236 +
   1.237 +    #   move additional plugins where other are already placed
   1.238 +    for plug in addgraphics avelsieve check_quota chg_sasl_passwd \
   1.239 +                folder_sizes gpg ldifimport pupdate show_user_and_ip \
   1.240 +                smallcal vkeyboard username; do
   1.241 +        mv $plug squirrelmail-%{V_squirrelmail}/plugins
   1.242 +    done
   1.243 +%endif
   1.244 +
   1.245 +    #   clean up login screen of distractions
   1.246 +    ( cd squirrelmail-%{V_squirrelmail}
   1.247 +      %patch -p0
   1.248 +    ) || exit $?
   1.249 +
   1.250 +    #   rearrange documentation and remove archive script
   1.251 +    ( cd squirrelmail-%{V_squirrelmail}
   1.252 +      mv AUTHORS ChangeLog COPYING INSTALL README UPGRADE doc/
   1.253 +      mv ReleaseNotes doc/ReleaseNotes.txt
   1.254 +      mv themes/README.themes doc/
   1.255 +      for fil in `find plugins/ -name "README*" -o -name "Readme*" \
   1.256 +                 -o -name "INSTALL*" -o -name CHANGES -o -name HISTORY`; do
   1.257 +          %{l_shtool} mkdir -f -p -m 755 doc/`dirname $fil`
   1.258 +          mv -f $fil $_
   1.259 +      done
   1.260 +      mv doc/plugins/squirrelspell/doc/README doc/plugins/squirrelspell
   1.261 +      rm -rf doc/plugins/squirrelspell/doc doc/plugins/squirrelspell/index.php
   1.262 +      mv plugins/squirrelspell/doc/* doc/plugins/squirrelspell
   1.263 +      rm -rf plugins/squirrelspell/doc
   1.264 +      rm -f plugins/make_archive.pl
   1.265 +%if "%{with_plugins}" == "yes"
   1.266 +      mv plugins/pupdate/docs/* doc/plugins/pupdate
   1.267 +      rm -rf plugins/pupdate/docs
   1.268 +%endif
   1.269 +
   1.270 +      #   postadjustment cosmetics
   1.271 +      %{l_shtool} subst \
   1.272 +          -e 's;\(#ffffff., .border="0" width=\)"350";\1"250";1' \
   1.273 +          src/login.php
   1.274 +
   1.275 +      #   set default prefs
   1.276 +      cat %{SOURCE defprefs.txt} >>data/default_pref
   1.277 +    ) || exit $?
   1.278 +
   1.279 +%build
   1.280 +
   1.281 +%install
   1.282 +    rm -rf $RPM_BUILD_ROOT
   1.283 +
   1.284 +    #   create directory structure
   1.285 +    %{l_shtool} mkdir -f -p -m 755 \
   1.286 +        $RPM_BUILD_ROOT%{l_prefix}/bin \
   1.287 +        $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail \
   1.288 +        $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/prefs \
   1.289 +        $RPM_BUILD_ROOT%{l_prefix}/var/squirrelmail/spool/attach \
   1.290 +        $RPM_BUILD_ROOT%{l_prefix}/var/squirrelmail/log
   1.291 +
   1.292 +    #   install locales
   1.293 +    ( cd all_locales-%{V_locale}
   1.294 +      cp -rpf help images locale $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/
   1.295 +    ) || exit $?
   1.296 +
   1.297 +    #   install program
   1.298 +    ( cd squirrelmail-%{V_squirrelmail}
   1.299 +
   1.300 +      #   install default_pref
   1.301 +      %{l_shtool} install -c -m 644 \
   1.302 +          data/default_pref \
   1.303 +          $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/prefs/
   1.304 +
   1.305 +      #   create initial administrator list
   1.306 +      echo %{l_musr} >>$RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/admins
   1.307 +
   1.308 +      #   copy over most functional directories, a lot of stuff
   1.309 +      for dir in class doc functions include plugins src themes; do
   1.310 +          cp -rpf $dir $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/
   1.311 +      done
   1.312 +      cp -rpf images/* $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/
   1.313 +      cp -pf locale/timezones.cfg $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/locale/
   1.314 +
   1.315 +      #   install main config files
   1.316 +      l_fqdm=`%{l_shtool} echo -e %h%d`
   1.317 +      %{l_shtool} install -c -m 644 %{l_value -s -a} \
   1.318 +          -e 's;config/\(config_local.php\);\1;g' \
   1.319 +          -e "s;@l_fqdm@;${l_fqdm};g" \
   1.320 +          %{SOURCE config.php} \
   1.321 +          config/config_default.php \
   1.322 +          config/config_local.php \
   1.323 +          $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/
   1.324 +%if "%{with_plugins}" == "yes"
   1.325 +      ( cd $RPM_BUILD_ROOT%{l_prefix}
   1.326 +        %{l_patch} -p0 <%{PATCH squirrelmail.patch.plugins}
   1.327 +        rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/*.orig
   1.328 +        rm -f $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/gpg/*.orig
   1.329 +        rm -f $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/chg_sasl_passwd/*.orig
   1.330 +      ) || exit $?
   1.331 +%endif
   1.332 +
   1.333 +      #   install plugin config files
   1.334 +      ( cd $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins
   1.335 +        %{l_shtool} subst \
   1.336 +            -e 's;../data/access_log;../../../var/squirrelmail/log/access.log;' \
   1.337 +            -e 's;\(\$sl_dateformat = \)"m/d/Y G:i:s";\1"d/m/Y G:i:s";' \
   1.338 +            squirrel_logger/setup.php
   1.339 +%if "%{with_plugins}" == "yes"
   1.340 +        cp -pf check_quota/config.sample.php check_quota/config.php
   1.341 +        cp -pf chg_sasl_passwd/config.php.sample chg_sasl_passwd/config.php
   1.342 +        cp -pf show_user_and_ip/config.php.sample show_user_and_ip/config.php
   1.343 +        %{l_shtool} install -c -m 644 \
   1.344 +            -e "s;sm_logo\.png;opkg_small.png;" \
   1.345 +            -e "s;SquirrelMail Logo;OpenPKG Logo;" \
   1.346 +            -e "s;www\.squirrelmail\.org;www.openpkg.org;" \
   1.347 +            -e "s;\/\/\(\$image_width.*\) = 308;\1 = 201;" \
   1.348 +            -e "s;\/\/\(\$image_height.*\) = 111;\1 = 62;" \
   1.349 +            addgraphics/config.php.typical.one.domain \
   1.350 +            addgraphics/config.php
   1.351 +        %{l_shtool} install -c -m 644 \
   1.352 +            -e 's/^\(\$sieve_preferred_sasl_mech =\).*/\1 "PLAIN LOGIN CRAM-MD5 DIGEST-MD5";/' \
   1.353 +            -e 's/^\(\$avelsieve_oldcyrus =\).*/\1 false;/' \
   1.354 +            -e 's/^\(\$startitems =\).*/\1 4;/' \
   1.355 +            avelsieve/config/config_sample.php \
   1.356 +            avelsieve/config/config.php
   1.357 +        %{l_shtool} subst \
   1.358 +            -e 's;\(path_to_gpg=\)/usr/bin/gpg.*;\1%{l_prefix}/bin/gpg;' \
   1.359 +            gpg/gpg_local_prefs.txt
   1.360 +        %{l_shtool} install -c -m 644 \
   1.361 +            -e 's;\(adminusername = "\)[^"]*;\1%{l_musr};' \
   1.362 +            -e 's;corehide = 1;corehide = 0;' \
   1.363 +            pupdate/config.php.sample \
   1.364 +            pupdate/config.php
   1.365 +        %{l_shtool} install -c -m 644 \
   1.366 +            -e "s;\(\$vkeyboard_msgsize.*\)'medium';\1'x-small';" \
   1.367 +            -e "s;\(\$vkeyboard_layout.*\)'us_english';\1'portuguese_abnt2';" \
   1.368 +            -e "s;\(\$vkeyboard_height.*\)'250';\1'270';" \
   1.369 +            vkeyboard/config.php.sample \
   1.370 +            vkeyboard/config.php
   1.371 +        cp -pf username/config.php.sample username/config.php
   1.372 +        %{l_shtool} install -c -m 644 \
   1.373 +            %{SOURCE opkg_small.png} \
   1.374 +            $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/
   1.375 +%endif
   1.376 +      ) || exit $?
   1.377 +
   1.378 +      #   install squirrelmail configuration perl script
   1.379 +      %{l_shtool} install -c -m 755 \
   1.380 +          -e 's;chdir($dir);chdir("%{l_prefix}/etc/squirrelmail");g' \
   1.381 +          -e 's;\.\./plugins;%{l_prefix}/share/squirrelmail/plugins;g' \
   1.382 +          -e 's;\.\./themes;%{l_prefix}/share/squirrelmail/themes;g' \
   1.383 +          -e 's;config/config_local.php;config_local.php;g' \
   1.384 +          config/conf.pl \
   1.385 +          $RPM_BUILD_ROOT%{l_prefix}/bin/squirrelconf
   1.386 +
   1.387 +      #   use our own logo, a squirrel next to a OpenPKG package
   1.388 +      %{l_shtool} install -c -m 644 \
   1.389 +          %{SOURCE opkg_large.png} \
   1.390 +          $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/
   1.391 +    ) || exit $?
   1.392 +
   1.393 +    #   install runcommand script
   1.394 +    %{l_shtool} mkdir -f -p -m 755 \
   1.395 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   1.396 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.397 +        %{SOURCE rc.squirrelmail} \
   1.398 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   1.399 +
   1.400 +    #   replace false /etc config paths throughout
   1.401 +    %{l_shtool} subst \
   1.402 +        -e 's;SM_PATH \. \(.\)config/;\1%{l_prefix}/etc/squirrelmail/;g' \
   1.403 +        -e 's;require_once(SM_PATH \. \(.*\)%{l_prefix};require_once(\1%{l_prefix};g' \
   1.404 +        $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/functions/*.php \
   1.405 +        $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/include/*.php \
   1.406 +        $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/abook_take/*.php \
   1.407 +        $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/administrator/*.php \
   1.408 +        $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/calendar/*.php \
   1.409 +        $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/src/*.php
   1.410 +
   1.411 +    #   integration into Apache under /webmail
   1.412 +    %{l_shtool} mkdir -f -p -m 755 \
   1.413 +        $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d
   1.414 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   1.415 +        %{SOURCE squirrelmail.conf} \
   1.416 +        $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/
   1.417 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   1.418 +        %{SOURCE index.php} \
   1.419 +        $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/
   1.420 +
   1.421 +    #   optional KOLAB configuration
   1.422 +%if "%{with_kolab}" == "yes"
   1.423 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   1.424 +        %{SOURCE config_local_kolab.php} \
   1.425 +        $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/config_local.php
   1.426 +%endif
   1.427 +
   1.428 +    #   determine package ingredients and tag config files
   1.429 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   1.430 +        %{l_files_std} \
   1.431 +        '%config %{l_prefix}/etc/squirrelmail/*' \
   1.432 +        '%config %{l_prefix}/share/squirrelmail/prefs/*' \
   1.433 +        '%config %{l_prefix}/share/squirrelmail/plugins/squirrelspell/sqspell_config.php' \
   1.434 +%if "%{with_plugins}" == "yes"
   1.435 +        '%config %{l_prefix}/share/squirrelmail/plugins/addgraphics/config.php' \
   1.436 +        '%config %{l_prefix}/share/squirrelmail/plugins/avelsieve/config/config.php' \
   1.437 +        '%config %{l_prefix}/share/squirrelmail/plugins/check_quota/config.php' \
   1.438 +        '%config %{l_prefix}/share/squirrelmail/plugins/chg_sasl_passwd/config.php' \
   1.439 +        '%config %{l_prefix}/share/squirrelmail/plugins/folder_sizes/folder_sizes.php' \
   1.440 +        '%config %{l_prefix}/share/squirrelmail/plugins/gpg/gpg_local_prefs.txt' \
   1.441 +        '%config %{l_prefix}/share/squirrelmail/plugins/ldifimport/config.php' \
   1.442 +        '%config %{l_prefix}/share/squirrelmail/plugins/pupdate/config.php' \
   1.443 +        '%config %{l_prefix}/share/squirrelmail/plugins/show_user_and_ip/config.php' \
   1.444 +        '%config %{l_prefix}/share/squirrelmail/plugins/vkeyboard/config.php' \
   1.445 +        '%config %{l_prefix}/share/squirrelmail/plugins/username/config.php' \
   1.446 +%endif
   1.447 +        '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/share/squirrelmail/prefs' \
   1.448 +        '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/squirrelmail/spool/attach' \
   1.449 +        '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/squirrelmail/log'
   1.450 +
   1.451 +%files -f files
   1.452 +
   1.453 +%clean
   1.454 +    rm -rf $RPM_BUILD_ROOT
   1.455 +
   1.456 +%preun
   1.457 +    #   before erase, remove log files
   1.458 +    [ $1 -eq 0 ] || exit 0
   1.459 +    rm -f $RPM_INSTALL_PREFIX/var/squirrelmail/log/*.log >/dev/null 2>&1 || true
   1.460 +

mercurial