squirrelmail/squirrelmail.spec

Fri, 03 Aug 2012 15:54:42 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 03 Aug 2012 15:54:42 +0200
changeset 458
153370aaf13f
parent 351
879299505589
child 537
37b427bb60b2
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

     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.21
    26 %define       V_locale              1.4.18-20090526
    27 %define       V_plugin_compat       2.0.14-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.7
    31 %define       V_plugin_saslpwd      1.4.1-1.4
    32 %define       V_plugin_ldappwd      2.2-1.4.0
    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
    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.2-1.0.1
    44 %define       V_plugin_captcha      1.2.3-1.2.9
    45 %define       V_plugin_smime        0.7-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:      20110708
    61 #   package options
    62 %option       with_plugins  no
    64 #   list of sources
    65 Source0:      http://switch.dl.sourceforge.net/squirrelmail/squirrelmail-%{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/chg_sasl_passwd-%{V_plugin_saslpwd}.tar.gz
    72 Source7:      http://www.squirrelmail.org/plugins/change_ldappass-%{V_plugin_ldappwd}.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 Prefix:       %{l_prefix}
    99 BuildRoot:    %{l_buildroot}
   100 BuildPreReq:  OpenPKG, openpkg >= 20060823
   101 PreReq:       OpenPKG, openpkg >= 20060823
   102 PreReq:       MTA, apache, apache-php, apache-php::with_xml = yes
   103 AutoReq:      no
   104 AutoReqProv:  no
   106 %description
   107     SquirrelMail is a standards based webmail package written in PHP. It
   108     includes built in pure PHP support for the IMAP and SMTP protocols,
   109     and all pages render in pure HTML 4.0 (with no Javascript) for
   110     maximum compatibility across browsers. It has very few requirements
   111     and is very easy to configure and install. SquirrelMail has all the
   112     functionality you would want from an email client, including strong
   113     MIME support, address books, and folder manipulation.
   115 %track
   116     prog squirrelmail = {
   117         version   = %{V_squirrelmail}
   118         url       = http://prdownloads.sourceforge.net/squirrelmail/
   119         regex     = squirrelmail-(\d+\.[02468]\.\d+[a-z]?)\.tar\.bz2
   120     }
   121     prog squirrelmail:locales = {
   122         version   = %{V_locale}
   123         url       = http://prdownloads.sourceforge.net/squirrelmail/
   124         regex     = all_locales-(\d+\.[02468]\.\d+-\d+)\.tar\.bz2
   125     }
   126     prog squirrelmail:compat = {
   127         comment   = "cs: untrackable due to CMS generated URLs"
   128         disabled
   129         version   = %{V_plugin_compat}
   130         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   131         regex     = compatibility-(__VER__)\.tar\.gz
   132     }
   133     prog squirrelmail:logger = {
   134         version   = %{V_plugin_logger}
   135         url       = http://www.squeaksoft.com/products/SquirrelLogger/
   136         regex     = squirrel_logger.(__VER__)\.tar\.gz
   137     }
   138     prog squirrelmail:addgraphics = {
   139         comment   = "cs: untrackable due to CMS generated URLs"
   140         disabled
   141         version   = %{V_plugin_addgraphics}
   142         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   143         regex     = addgraphics-(__VER__)\.tar\.gz
   144     }
   145     prog squirrelmail:avelsieve = {
   146         comment   = "cs: untrackable due to CMS generated URLs"
   147         disabled
   148         version   = %{V_plugin_avelsieve}
   149         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   150         regex     = avelsieve-(\d+\.\d+\.\d+)\.tar\.gz
   151     }
   152     prog squirrelmail:saslpwd = {
   153         comment   = "cs: untrackable due to CMS generated URLs"
   154         disabled
   155         version   = %{V_plugin_saslpwd}
   156         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   157         regex     = chg_sasl_passwd-(\d+\.\d+\.\d+-\d+\.\d+)\.tar\.gz
   158     }
   159     prog squirrelmail:ldappwd = {
   160         comment   = "cs: untrackable due to CMS generated URLs"
   161         disabled
   162         version   = %{V_plugin_ldappwd}
   163         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   164         regex     = change_ldappass-(\d+\.\d+-\d+\.\d+\.\d+)\.tar\.gz
   165     }
   166     prog squirrelmail:checkquota = {
   167         comment   = "cs: untrackable due to CMS generated URLs"
   168         disabled
   169         version   = %{V_plugin_checkquota}
   170         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   171         regex     = check_quota-(__VER__)\.tar\.gz
   172     }
   173     prog squirrelmail:foldersize = {
   174         comment   = "cs: untrackable due to CMS generated URLs"
   175         disabled
   176         version   = %{V_plugin_foldersize}
   177         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   178         regex     = folder_sizes-(__VER__)\.tar\.gz
   179     }
   180     prog squirrelmail:gnupg = {
   181         comment   = "cs: untrackable due to CMS generated URLs"
   182         disabled
   183         version   = %{V_plugin_gnupg}
   184         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   185         regex     = gpg-(\d+\.\d+)\.tar\.gz
   186     }
   187     prog squirrelmail:ldif = {
   188         comment   = "cs: untrackable due to CMS generated URLs"
   189         disabled
   190         version   = %{V_plugin_ldif}
   191         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   192         regex     = ldifimport-(__VER__)\.tar\.gz
   193     }
   194     prog squirrelmail:update = {
   195         comment   = "cs: untrackable due to CMS generated URLs"
   196         disabled
   197         version   = %{V_plugin_update}
   198         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   199         regex     = pupdate.(__VER__)\.tar\.gz
   200     }
   201     prog squirrelmail:userip = {
   202         comment   = "cs: untrackable due to CMS generated URLs"
   203         disabled
   204         version   = %{V_plugin_userip}
   205         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   206         regex     = show_user_and_ip-(__VER__)\.tar\.gz
   207     }
   208     prog squirrelmail:smallcal = {
   209         comment   = "cs: untrackable due to CMS generated URLs"
   210         disabled
   211         version   = %{V_plugin_smallcal}
   212         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   213         regex     = smallcal-(__VER__)\.tar\.gz
   214     }
   215     prog squirrelmail:vkeyboard = {
   216         comment   = "cs: untrackable due to CMS generated URLs"
   217         disabled
   218         version   = %{V_plugin_vkeyboard}
   219         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   220         regex     = vkeyboard-(__VER__)\.tar\.gz
   221     }
   222     prog squirrelmail:username = {
   223         comment   = "cs: untrackable due to CMS generated URLs"
   224         disabled
   225         version   = %{V_plugin_username}
   226         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   227         regex     = username-(__VER__)\.tar\.gz
   228     }
   229     prog squirrelmail:loginnotes = {
   230         comment   = "cs: untrackable due to CMS generated URLs"
   231         disabled
   232         version   = %{V_plugin_loginnotes}
   233         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   234         regex     = login_notes--(__VER__)\.tar\.gz
   235     }
   236     prog squirrelmail:passforget = {
   237         comment   = "cs: untrackable due to CMS generated URLs"
   238         disabled
   239         version   = %{V_plugin_passforget}
   240         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   241         regex     = password_forget-(__VER__)\.tar\.gz
   242     }
   243     prog squirrelmail:captcha = {
   244         comment   = "cs: untrackable due to CMS generated URLs"
   245         disabled
   246         version   = %{V_plugin_captcha}
   247         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   248         regex     = captcha-(__VER__)\.tar\.gz
   249     }
   250     prog squirrelmail:smime = {
   251         comment   = "cs: untrackable due to CMS generated URLs"
   252         disabled
   253         version   = %{V_plugin_smime}
   254         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   255         regex     = smime-(__VER__)\.tar\.gz
   256     }
   257     prog squirrelmail:debugger = {
   258         comment   = "cs: untrackable due to CMS generated URLs"
   259         disabled
   260         version   = %{V_plugin_debug}
   261         url       = http://www.squirrelmail.org/plugins_category.php?category_id=all
   262         regex     = debugger-(__VER__)\.tar\.gz
   263     }
   265 %prep
   266     %setup -q -c -n squirrelmail
   267     %setup -q -D -T -a 1 -c -n squirrelmail/all_locales-%{V_locale}
   268     %setup -q -D -T -a 2 -n squirrelmail
   269     %setup -q -D -T -a 3 -n squirrelmail
   270     mv compatibility squirrelmail-%{V_squirrelmail}/plugins
   271     mv squirrel_logger squirrelmail-%{V_squirrelmail}/plugins
   272 %if "%{with_plugins}" == "yes"
   273     %setup -q -D -T -a 4 -n squirrelmail
   274     %setup -q -D -T -a 5 -n squirrelmail
   275     %setup -q -D -T -a 6 -n squirrelmail
   276     %setup -q -D -T -a 7 -n squirrelmail
   277     %setup -q -D -T -a 8 -n squirrelmail
   278     %setup -q -D -T -a 9 -n squirrelmail
   279     %setup -q -D -T -a 10 -n squirrelmail
   280     %setup -q -D -T -a 11 -n squirrelmail
   281     %setup -q -D -T -a 12 -n squirrelmail
   282     %setup -q -D -T -a 13 -n squirrelmail
   283     %setup -q -D -T -a 14 -n squirrelmail
   284     %setup -q -D -T -a 15 -n squirrelmail
   285     %setup -q -D -T -a 16 -n squirrelmail
   286     %setup -q -D -T -a 17 -n squirrelmail
   287     %setup -q -D -T -a 18 -n squirrelmail
   288     %setup -q -D -T -a 19 -n squirrelmail
   289     %setup -q -D -T -a 20 -n squirrelmail
   290     %setup -q -D -T -a 21 -n squirrelmail
   292     #   move additional plugins where other are already placed
   293     for plug in addgraphics avelsieve check_quota chg_sasl_passwd \
   294                 change_ldappass folder_sizes gpg ldifimport pupdate \
   295                 show_user_and_ip smallcal vkeyboard username \
   296                 login_notes password_forget captcha smime debugger; do
   297         mv $plug squirrelmail-%{V_squirrelmail}/plugins
   298     done
   299 %endif
   301     #   clean up login screen of distractions
   302     ( cd squirrelmail-%{V_squirrelmail}
   303       %patch -p0
   304     ) || exit $?
   306     #   rearrange documentation and remove archive script
   307     ( cd squirrelmail-%{V_squirrelmail}
   308       mv AUTHORS ChangeLog COPYING INSTALL README UPGRADE doc/
   309       mv ReleaseNotes doc/ReleaseNotes.txt
   310       mv themes/README.themes doc/
   311       for fil in `find plugins/ -name "README*" -o -name "Readme*" \
   312                  -o -name "INSTALL*" -o -name CHANGES -o -name HISTORY`; do
   313           %{l_shtool} mkdir -f -p -m 755 doc/`dirname $fil`
   314           mv -f $fil $_
   315       done
   316       rm -rf doc/plugins/squirrelspell/doc doc/plugins/squirrelspell/index.php
   317       mv plugins/squirrelspell/doc/* doc/plugins/squirrelspell
   318       rm -rf plugins/squirrelspell/doc
   319 %if "%{with_plugins}" == "yes"
   320       mv plugins/pupdate/docs/* doc/plugins/pupdate
   321       rm -rf plugins/pupdate/docs
   322 %endif
   324       #   postadjustment cosmetics
   325       %{l_shtool} subst \
   326           -e 's;\(\$color\[4\], .border="0" width=\)"350";\1"250";1' \
   327           src/login.php
   329       #   set default prefs
   330       cat %{SOURCE defprefs.txt} >>data/default_pref
   331     ) || exit $?
   333 %build
   335 %install
   336     rm -rf $RPM_BUILD_ROOT
   338     #   create directory structure
   339     %{l_shtool} mkdir -f -p -m 755 \
   340         $RPM_BUILD_ROOT%{l_prefix}/bin \
   341         $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail \
   342         $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/prefs \
   343         $RPM_BUILD_ROOT%{l_prefix}/var/squirrelmail/spool/attach \
   344         $RPM_BUILD_ROOT%{l_prefix}/var/squirrelmail/log
   346     #   install locales
   347     ( cd all_locales-%{V_locale}
   348       cp -rpf help images locale $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/
   349     ) || exit $?
   351     #   install program
   352     ( cd squirrelmail-%{V_squirrelmail}
   354       #   install default_pref
   355       %{l_shtool} install -c -m 644 \
   356           data/default_pref \
   357           $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/prefs/
   359       #   create initial administrator list
   360       echo %{l_musr} >>$RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/admins
   362       #   copy over most functional directories, a lot of stuff
   363       for dir in class doc functions include plugins src themes; do
   364           cp -rpf $dir $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/
   365       done
   366       cp -rpf images/* $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/
   367       cp -pf locale/timezones.cfg $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/locale/
   369       #   install main config files
   370       l_fqdm=`%{l_shtool} echo -e %h%d`
   371       %{l_shtool} install -c -m 644 %{l_value -s -a} \
   372           -e 's;config/\(config_local.php\);\1;g' \
   373           -e "s;@l_fqdm@;${l_fqdm};g" \
   374           %{SOURCE config.php} \
   375           config/config_default.php \
   376           config/config_local.php \
   377           $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/
   378 %if "%{with_plugins}" == "yes"
   379       ( cd $RPM_BUILD_ROOT%{l_prefix}
   380         %{l_patch} -p0 <%{PATCH squirrelmail.patch.plugins}
   381         rm -f $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/functions/*.orig
   382         rm -f $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/src/*.orig
   383       ) || exit $?
   384 %endif
   386       #   install plugin config files
   387       ( cd $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins
   388 %if "%{with_plugins}" == "yes"
   389         cp -pf check_quota/config.sample.php check_quota/config.php
   390         cp -pf chg_sasl_passwd/config.php.sample chg_sasl_passwd/config.php
   391         cp -pf show_user_and_ip/config.php.sample show_user_and_ip/config.php
   392         %{l_shtool} install -c -m 644 \
   393             -e "s;sm_logo\.png;opkg_small.png;" \
   394             -e "s;SquirrelMail Logo;OpenPKG Logo;" \
   395             -e "s;www\.squirrelmail\.org;www.openpkg.org;" \
   396             -e "s;\/\/\(\$image_width.*\) = 308;\1 = 201;" \
   397             -e "s;\/\/\(\$image_height.*\) = 111;\1 = 62;" \
   398             addgraphics/config.php.typical.one.domain \
   399             addgraphics/config.php
   400         %{l_shtool} install -c -m 644 \
   401             -e 's/^\(\$sieve_preferred_sasl_mech =\).*/\1 "PLAIN LOGIN CRAM-MD5 DIGEST-MD5";/' \
   402             -e 's/^\(\$avelsieve_oldcyrus =\).*/\1 false;/' \
   403             -e 's/^\(\$startitems =\).*/\1 4;/' \
   404             avelsieve/config/config_sample.php \
   405             avelsieve/config/config.php
   406         %{l_shtool} install -c -m 644 \
   407             change_ldappass/config_sample.php \
   408             change_ldappass/config.php
   409         %{l_shtool} install -c -m 644 \
   410             login_notes/config.sample.php \
   411             login_notes/config.php
   412         %{l_shtool} install -c -m 644 \
   413             password_forget/config_example.php \
   414             password_forget/config.php
   415         %{l_shtool} install -c -m 644 \
   416             -e 's;^//\( *.CAPTCHA.,\);\1;g' \
   417             -e 's,\(\$sl_dateformat *=\).*\(.\);$,\1 \2d.m.Y H:i:s\2;,g' \
   418             -e 's,\(\$sl_logfile *=\).*\(.\);$,\1 \2%{l_prefix}/var/squirrelmail/log/squirrelmail.log\2;,g' \
   419             squirrel_logger/config_example.php \
   420             squirrel_logger/config.php
   421         %{l_shtool} install -c -m 644 \
   422             -e 's/\(\$log_CAPTCHA_events *=\).*/\1 1;/' \
   423             -e 's,\(\$captcha_backend *=\).*\(.\);$,\1 \2recaptcha\2;,' \
   424             captcha/config_example.php \
   425             captcha/config.php
   426         for captname in \
   427             b2evo captcha_php csi freecap hec hn_captcha opencaptcha \
   428             phpcaptcha quickcaptcha quickform recaptcha textcaptcha
   429             do
   430                 mv \
   431                    captcha/backends/${captname}/${captname}_config_example.php \
   432                    captcha/backends/${captname}/${captname}_config.php
   433         done
   434         %{l_shtool} install -c -m 644 \
   435             smime/config_example.php \
   436             smime/config.php
   437         %{l_shtool} subst \
   438             -e 's;\(path_to_gpg=\)/usr/bin/gpg.*;\1%{l_prefix}/bin/gpg;' \
   439             gpg/gpg_local_prefs.txt
   440         %{l_shtool} install -c -m 644 \
   441             -e 's;\(adminusername = "\)[^"]*;\1%{l_musr};' \
   442             -e 's;corehide = 1;corehide = 0;' \
   443             pupdate/config.php.sample \
   444             pupdate/config.php
   445         %{l_shtool} install -c -m 644 \
   446             -e "s;\(\$vkeyboard_msgsize.*\)'medium';\1'x-small';" \
   447             -e "s;\(\$vkeyboard_layout.*\)'us_english';\1'portuguese_abnt2';" \
   448             -e "s;\(\$vkeyboard_height.*\)'250';\1'270';" \
   449             vkeyboard/config.php.sample \
   450             vkeyboard/config.php
   451         cp -pf username/config.php.sample username/config.php
   452         %{l_shtool} install -c -m 644 \
   453             %{SOURCE opkg_small.png} \
   454             $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/
   455 %endif
   456       ) || exit $?
   458       #   install squirrelmail configuration perl script
   459       %{l_shtool} install -c -m 755 \
   460           -e 's;chdir($dir);chdir("%{l_prefix}/etc/squirrelmail");g' \
   461           -e 's;\.\./plugins;%{l_prefix}/share/squirrelmail/plugins;g' \
   462           -e 's;\.\./themes;%{l_prefix}/share/squirrelmail/themes;g' \
   463           -e 's;config/config_local.php;config_local.php;g' \
   464           config/conf.pl \
   465           $RPM_BUILD_ROOT%{l_prefix}/bin/squirrelconf
   467       #   use our own logo, a squirrel next to a OpenPKG package
   468       %{l_shtool} install -c -m 644 \
   469           %{SOURCE opkg_large.png} \
   470           $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/
   471     ) || exit $?
   473     #   install runcommand script
   474     %{l_shtool} mkdir -f -p -m 755 \
   475         $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   476     %{l_shtool} install -c -m 755 %{l_value -s -a} \
   477         %{SOURCE rc.squirrelmail} \
   478         $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   480     #   correct path to optional perl interpreter
   481     %{l_shtool} subst \
   482         -e 's;#!/usr/bin/env perl;#! %{l_prefix}/bin/perl;' \
   483         $RPM_BUILD_ROOT%{l_prefix}/bin/squirrelconf
   485     #   replace false /etc config paths throughout
   486     %{l_shtool} subst \
   487         -e 's;SM_PATH \. \(.\)config/;\1%{l_prefix}/etc/squirrelmail/;g' \
   488         -e 's;require_once(SM_PATH \. \(.*\)%{l_prefix};require_once(\1%{l_prefix};g' \
   489         $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/functions/*.php \
   490         $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/include/*.php \
   491         $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/administrator/*.php \
   492         $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/calendar/*.php \
   493         $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/src/*.php
   495     #   integration into Apache under /webmail
   496     %{l_shtool} mkdir -f -p -m 755 \
   497         $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d
   498     %{l_shtool} install -c -m 644 %{l_value -s -a} \
   499         %{SOURCE squirrelmail.conf} \
   500         $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/
   501     %{l_shtool} install -c -m 644 %{l_value -s -a} \
   502         %{SOURCE index.php} \
   503         $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/
   505     #   determine package ingredients and tag config files
   506     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   507         %{l_files_std} \
   508         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/etc/squirrelmail/*' \
   509         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/prefs/*' \
   510         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/squirrelspell/sqspell_config.php' \
   511 %if "%{with_plugins}" == "yes"
   512         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/addgraphics/config.php' \
   513         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/avelsieve/config/config.php' \
   514         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/check_quota/config.php' \
   515         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/chg_sasl_passwd/config.php' \
   516         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/change_ldappass/config.php' \
   517         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/folder_sizes/folder_sizes.php' \
   518         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/gpg/gpg_local_prefs.txt' \
   519         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/ldifimport/config.php' \
   520         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/pupdate/config.php' \
   521         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/show_user_and_ip/config.php' \
   522         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/squirrel_logger/config.php' \
   523         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/vkeyboard/config.php' \
   524         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/username/config.php' \
   525         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/login_notes/config.php' \
   526         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/password_forget/config.php' \
   527         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/config.php' \
   528         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/b2evo/b2evo_config.php' \
   529         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/captcha_php/captcha_php_config.php' \
   530         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/csi/csi_config.php' \
   531         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/freecap/freecap_config.php' \
   532         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/hec/hec_config.php' \
   533         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/hn_captcha/hn_captcha_config.php' \
   534         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/opencaptcha/opencaptcha_config.php' \
   535         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/phpcaptcha/phpcaptcha_config.php' \
   536         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/quickcaptcha/quickcaptcha_config.php' \
   537         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/quickform/quickform_config.php' \
   538         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/recaptcha/recaptcha_config.php' \
   539         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/captcha/backends/textcaptcha/textcaptcha_config.php' \
   540         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/smime/config.php' \
   541         '%attr(640,%{l_musr},%{l_ngrp}) %config %{l_prefix}/share/squirrelmail/plugins/debugger/setup.php' \
   542 %endif
   543         '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/share/squirrelmail/prefs' \
   544         '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/squirrelmail/spool/attach' \
   545         '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/squirrelmail/log'
   547 %files -f files
   549 %clean
   550     rm -rf $RPM_BUILD_ROOT
   552 %preun
   553     #   before erase, remove log files
   554     [ $1 -eq 0 ] || exit 0
   555     rm -f $RPM_INSTALL_PREFIX/var/squirrelmail/log/*.log >/dev/null 2>&1 || true

mercurial