squirrelmail/squirrelmail.spec

Tue, 28 Aug 2012 18:53:20 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:53:20 +0200
changeset 614
dd4810b9233b
parent 352
aa138c6f5dd6
child 722
657a1a956cbb
permissions
-rw-r--r--

Introduce forgotten dependency to GNU make for parallel build support.

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

mercurial