# HG changeset patch # User Michael Schloh von Bennewitz # Date 1239828540 -7200 # Node ID 3214ed6c04f6012feff95d7be9f802535ae449e1 # Parent 3831ba5c7ba78c9e50adc56fcd38d36201a95384 Import package vendor original specs for necessary manipulations. diff -r 3831ba5c7ba7 -r 3214ed6c04f6 squirrelmail/config.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/squirrelmail/config.php Wed Apr 15 22:49:00 2009 +0200 @@ -0,0 +1,199 @@ + diff -r 3831ba5c7ba7 -r 3214ed6c04f6 squirrelmail/config_local_kolab.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/squirrelmail/config_local_kolab.php Wed Apr 15 22:49:00 2009 +0200 @@ -0,0 +1,62 @@ + diff -r 3831ba5c7ba7 -r 3214ed6c04f6 squirrelmail/defprefs.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/squirrelmail/defprefs.txt Wed Apr 15 22:49:00 2009 +0200 @@ -0,0 +1,54 @@ +left_refresh=300 +hour_format=1 +date_format=2 +reply_citation_style=author_said +mailfetch_newlog=off +javascript_on=1 +use_javascript_addr_book=1 +spamcop_method=web_form +show_xmailer_default=1 +pf_cleandisplay=1 +delete_move_next_t=off +delete_move_next_formATtop=off +delete_move_next_b=on +delete_move_next_formATbottom=on +show_user_on_left_pane=1 +show_ip_on_left_pane=1 +show_host_on_left_pane=0 +smallcal_bottom=1 +smallcal_separator=1 +smallcal_show=1 +smallcal_default=1 +smallcal_header=#770000 +smallcal_calendar=Personal +move_to_trash=1 +trash_folder=INBOX/Trash +save_as_draft=1 +draft_folder=INBOX/Drafts +move_to_sent=1 +sent_folder=INBOX/Sent +left_size=220 +folder_sizes_left_link=1 +folder_sizes_on_folder_page=0 +folder_sizes_subtotals=0 +wrap_at=72 +custom_css=sans-10.css +newmail_enable=on +newmail_changetitle=on +translate_server=babelfish +translate_location=center +translate_show_read=1 +mailfetch_port_0=110 +mailfetch_cypher=on +mailfetch_lmos_0=on +mailfetch_subfolder_0=INBOX +mailfetch_server_number=0 +use_signature=1 +prefix_sig=1 +search_memory=8 +order1=1 +order2=2 +order3=3 +order4=5 +order5=4 +order6=6 diff -r 3831ba5c7ba7 -r 3214ed6c04f6 squirrelmail/index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/squirrelmail/index.php Wed Apr 15 22:49:00 2009 +0200 @@ -0,0 +1,10 @@ + + diff -r 3831ba5c7ba7 -r 3214ed6c04f6 squirrelmail/opkg_large.png Binary file squirrelmail/opkg_large.png has changed diff -r 3831ba5c7ba7 -r 3214ed6c04f6 squirrelmail/opkg_small.png Binary file squirrelmail/opkg_small.png has changed diff -r 3831ba5c7ba7 -r 3214ed6c04f6 squirrelmail/rc.squirrelmail --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/squirrelmail/rc.squirrelmail Wed Apr 15 22:49:00 2009 +0200 @@ -0,0 +1,22 @@ +#!@l_prefix@/bin/openpkg rc +## +## rc.squirrelmail -- Run-Commands +## + +%config + squirrelmail_enable="$openpkg_rc_def" + squirrelmail_log_prolog="true" + squirrelmail_log_epilog="true" + squirrelmail_log_numfiles="10" + squirrelmail_log_minsize="1M" + squirrelmail_log_complevel="9" + +%daily -u @l_nusr@ + rcService squirrelmail enable yes || exit 0 + shtool rotate -f \ + -n ${squirrelmail_log_numfiles} -s ${squirrelmail_log_minsize} -d \ + -z ${squirrelmail_log_complevel} -m 644 -o @l_nusr@ -g @l_ngrp@ \ + -P "${squirrelmail_log_prolog}" \ + -E "${squirrelmail_log_epilog}" \ + @l_prefix@/var/squirrelmail/log/access.log + diff -r 3831ba5c7ba7 -r 3214ed6c04f6 squirrelmail/squirrelmail.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/squirrelmail/squirrelmail.conf Wed Apr 15 22:49:00 2009 +0200 @@ -0,0 +1,3 @@ + +Alias /webmail @l_prefix@/share/squirrelmail + diff -r 3831ba5c7ba7 -r 3214ed6c04f6 squirrelmail/squirrelmail.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/squirrelmail/squirrelmail.patch Wed Apr 15 22:49:00 2009 +0200 @@ -0,0 +1,50 @@ +Index: functions/display_messages.php +--- functions/display_messages.php.orig 2005-03-21 23:18:32 +0100 ++++ functions/display_messages.php 2005-07-30 21:15:29 +0200 +@@ -88,8 +88,8 @@ + "\"$width_and_height />
\n"; + } + echo ( $hide_sm_attributions ? '' : +- '' . sprintf (_("SquirrelMail version %s"), $version) . '
'. +- _("By the SquirrelMail Project Team") . "
\n" ). ++ '
'. ++ "
\n" ). + ''. + '
'. + ''. +Index: functions/imap_general.php +--- functions/imap_general.php.orig 2005-05-20 12:37:34 +0200 ++++ functions/imap_general.php 2005-07-30 21:14:27 +0200 +@@ -568,6 +568,7 @@ + + set_up_language($squirrelmail_language, true); + include_once(SM_PATH . 'functions/display_messages.php' ); ++ do_hook('invalid_login'); /* used with squirrelmail_logger */ + sqsession_destroy(); + /* terminate the session nicely */ + sqimap_logout($imap_stream); +Index: src/login.php +--- src/login.php.orig 2005-06-22 15:45:35 +0200 ++++ src/login.php 2005-07-30 21:15:39 +0200 +@@ -132,8 +132,8 @@ + ' />
' . "\n" + : '' ). + ( (isset($hide_sm_attributions) && $hide_sm_attributions) ? '' : +- '' . sprintf (_("SquirrelMail version %s"), $version) . '
' ."\n". +- ' ' . _("By the SquirrelMail Project Team") . '
' . "\n" ) . ++ '
' ."\n". ++ '
' . "\n" ) . + html_tag( 'table', + html_tag( 'tr', + html_tag( 'td', +Index: src/right_main.php +--- src/right_main.php.orig 2005-06-15 23:12:05 +0200 ++++ src/right_main.php 2005-07-30 21:14:27 +0200 +@@ -182,6 +182,7 @@ + ) + ) , + 'center', $color[9], 'width="70%" cellpadding="0" cellspacing="3" border="0"' ); ++ echo "
\n"; + } + } + } diff -r 3831ba5c7ba7 -r 3214ed6c04f6 squirrelmail/squirrelmail.patch.plugins --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/squirrelmail/squirrelmail.patch.plugins Wed Apr 15 22:49:00 2009 +0200 @@ -0,0 +1,87 @@ +Index: etc/squirrelmail/config.php +diff -Nau etc/squirrelmail/config.php.orig etc/squirrelmail/config.php +--- etc/squirrelmail/config.php.orig 2005-03-16 13:02:25 +0100 ++++ etc/squirrelmail/config.php 2005-03-16 12:31:51 +0100 +@@ -89,6 +89,19 @@ + $plugins[13] = 'squirrel_logger'; + $plugins[14] = 'translate'; + ++$plugins[15] = 'addgraphics'; ++$plugins[16] = 'avelsieve'; ++$plugins[17] = 'check_quota'; ++$plugins[18] = 'chg_sasl_passwd'; ++$plugins[19] = 'folder_sizes'; ++$plugins[20] = 'gpg'; ++$plugins[21] = 'ldifimport'; ++$plugins[22] = 'pupdate'; ++$plugins[23] = 'show_user_and_ip'; ++$plugins[24] = 'smallcal'; ++$plugins[25] = 'vkeyboard'; ++$plugins[26] = 'username'; ++ + /* NOP, for patch line placeholder (avoids fuzz) */ + $theme_css = ''; + $theme_default = 0; +Index: share/squirrelmail/plugins/gpg/setup.php +diff -Nau share/squirrelmail/plugins/gpg/setup.php.orig share/squirrelmail/plugins/gpg/setup.php +--- share/squirrelmail/plugins/gpg/setup.php.orig 2005-03-18 12:01:39.398171000 +0100 ++++ share/squirrelmail/plugins/gpg/setup.php 2005-03-18 12:03:35.986216000 +0100 +@@ -14,7 +14,9 @@ + * + */ + if (!defined (SM_PATH)){ +- if (file_exists('./gpg_functions.php')){ ++ if (file_exists('../../../plugins/gpg/gpg_functions.php')){ ++ define (SM_PATH , '../../../'); ++ } elseif (file_exists('../../plugins/gpg/gpg_functions.php')){ + define (SM_PATH , '../../'); + } elseif (file_exists('../plugins/gpg/gpg_functions.php')) { + define (SM_PATH, '../'); +Index: share/squirrelmail/plugins/chg_sasl_passwd/options.php +diff -Nau share/squirrelmail/plugins/chg_sasl_passwd/options.php.orig share/squirrelmail/plugins/chg_sasl_passwd/options.php +--- share/squirrelmail/plugins/chg_sasl_passwd/options.php.orig 2005-03-17 21:00:03.157951000 +0100 ++++ share/squirrelmail/plugins/chg_sasl_passwd/options.php 2005-03-18 14:16:40.480988000 +0100 +@@ -70,8 +70,8 @@ + ' "" + dir_path + "/../../src/signout.php?chg_sasl_passwd";' . "', 0);\n" . + "//-->\n\n"; + +- echo "

" . _("Your password has successfully been changed.") . "

\n"; +- echo '
' . _("Please") . '
" . _("Your password has successfully been changed.") . "
\n"; ++ echo '
\n"; + } +Index: share/squirrelmail/plugins/chg_sasl_passwd/setup.php +diff -Nau share/squirrelmail/plugins/chg_sasl_passwd/setup.php.orig share/squirrelmail/plugins/chg_sasl_passwd/setup.php +--- share/squirrelmail/plugins/chg_sasl_passwd/setup.php.orig 2005-03-03 00:38:44.000000000 +0100 ++++ share/squirrelmail/plugins/chg_sasl_passwd/setup.php 2005-03-18 14:29:52.513613000 +0100 +@@ -32,8 +32,12 @@ + + if (isset($_SERVER['QUERY_STRING']) && + stristr($_SERVER['QUERY_STRING'], 'chg_sasl_passwd') ) +- echo "
" . _("Your password has been changed. This requires that you logout and then log back in with the new password.") . +- "


\n" . _("Logging out automagically") . ".

\n"; ++ echo "

" . ++ "
" . _("Your password has been changed.") . ++ "
" . _("This requires that you logout and then") . ++ "
" . _("log back in with the new password.") . ++ "

" . _("Logging out automatically...") . ++ "



\n"; + + /* Switch back to the SquirrelMail domain */ + textdomain('squirrelmail'); +Index: share/squirrelmail/plugins/check_quota/config.sample.php +diff -uaN share/squirrelmail/plugins/check_quota/config.sample.php.orig share/squirrelmail/plugins/check_quota/config.sample.php +--- share/squirrelmail/plugins/check_quota/config.sample.php.orig 2008-01-03 06:39:34.000000000 +0100 ++++ share/squirrelmail/plugins/check_quota/config.sample.php 2008-01-03 06:39:48.000000000 +0100 +@@ -25,7 +25,7 @@ + * 0: UNIX / 1: IMAP / 2: cPanel + */ + +-$settings['quota_type'] = 0; ++$settings['quota_type'] = 1; + + + /* + diff -r 3831ba5c7ba7 -r 3214ed6c04f6 squirrelmail/squirrelmail.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/squirrelmail/squirrelmail.spec Wed Apr 15 22:49:00 2009 +0200 @@ -0,0 +1,457 @@ +## +## squirrelmail.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# package version +%define V_squirrelmail 1.4.17 +%define V_locale 1.4.13-20071220 +%define V_plugin_compat 2.0.9-1.0 +%define V_plugin_logger 1.4.0-1.0.6 +%define V_plugin_addgraphics 2.3-1.0.3 +%define V_plugin_avelsieve 1.9.7 +%define V_plugin_saslpwd 1.4.1-1.4 +%define V_plugin_checkquota 2.2-1.4.0 +%define V_plugin_foldersize 1.5-1.4.0 +%define V_plugin_gnupg 2.0.1-1.4.2 +%define V_plugin_ldif 1.4-1.2.x +%define V_plugin_update 0.7-1.4.2 +%define V_plugin_userip 3.3-re-1.2.2 +%define V_plugin_smallcal 0.8-1.2.3 +%define V_plugin_vkeyboard 0.9 +%define V_plugin_username 2.3-1.0.0 + +# package information +Name: squirrelmail +Summary: SquirrelMail Webmail Client +URL: http://www.squirrelmail.org/ +Vendor: Squirrelmail Developers +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: EVAL +Group: Mail +License: GPL +Version: %{V_squirrelmail} +Release: 20090327 + +# package options +%option with_plugins no +%option with_kolab no + +# list of sources +Source0: http://switch.dl.sourceforge.net/squirrelmail/squirrelmail-%{V_squirrelmail}.tar.bz2 +Source1: http://switch.dl.sourceforge.net/squirrelmail/all_locales-%{V_locale}.tar.bz2 +Source2: http://www.squirrelmail.org/plugins/compatibility-%{V_plugin_compat}.tar.gz +Source3: http://www.squeaksoft.com/products/SquirrelLogger/squirrel_logger.%{V_plugin_logger}.tar.gz +Source4: http://www.squirrelmail.org/plugins/addgraphics-%{V_plugin_addgraphics}.tar.gz +Source5: http://www.squirrelmail.org/plugins/avelsieve-%{V_plugin_avelsieve}.tar.gz +Source6: http://www.squirrelmail.org/plugins/chg_sasl_passwd-%{V_plugin_saslpwd}.tar.gz +Source7: http://www.squirrelmail.org/plugins/check_quota-%{V_plugin_checkquota}.tar.gz +Source8: http://www.squirrelmail.org/plugins/folder_sizes-%{V_plugin_foldersize}.tar.gz +Source9: http://www.squirrelmail.org/plugins/gpg.%{V_plugin_gnupg}.tar.gz +Source10: http://www.squirrelmail.org/plugins/ldifimport-%{V_plugin_ldif}.tar.gz +Source11: http://www.squirrelmail.org/plugins/pupdate.%{V_plugin_update}.tar.gz +Source12: http://www.squirrelmail.org/plugins/show_user_and_ip-%{V_plugin_userip}.tar.gz +Source13: http://www.squirrelmail.org/plugins/smallcal-%{V_plugin_smallcal}.tar.gz +Source14: http://www.squirrelmail.org/plugins/vkeyboard-%{V_plugin_vkeyboard}.tar.gz +Source15: http://www.squirrelmail.org/plugins/username-%{V_plugin_username}.tar.gz +Source16: config.php +Source17: defprefs.txt +Source18: opkg_large.png +Source19: opkg_small.png +Source20: rc.squirrelmail +Source21: squirrelmail.conf +Source22: config_local_kolab.php +Source23: index.php +Patch0: squirrelmail.patch +Patch1: squirrelmail.patch.plugins + +# build information +Prefix: %{l_prefix} +BuildRoot: %{l_buildroot} +BuildPreReq: OpenPKG, openpkg >= 20060823 +PreReq: OpenPKG, openpkg >= 20060823 +PreReq: MTA, apache, apache-php, apache-php::with_xml = yes +AutoReq: no +AutoReqProv: no + +%description + SquirrelMail is a standards-based webmail package written in PHP. It + includes built-in pure PHP support for the IMAP and SMTP protocols, + and all pages render in pure HTML 4.0 (with no Javascript) for + maximum compatibility across browsers. It has very few requirements + and is very easy to configure and install. SquirrelMail has all the + functionality you would want from an email client, including strong + MIME support, address books, and folder manipulation. + +%track + prog squirrelmail = { + version = %{V_squirrelmail} + url = http://prdownloads.sourceforge.net/squirrelmail/ + regex = squirrelmail-(\d+\.[02468]\.\d+[a-z]?)\.tar\.bz2 + } + prog squirrelmail:locales = { + version = %{V_locale} + url = http://prdownloads.sourceforge.net/squirrelmail/ + regex = all_locales-(\d+\.[02468]\.\d+-\d+)\.tar\.bz2 + } + prog squirrelmail:compat = { + comment = "cs: untrackable due to CMS generated URLs" + disabled + version = %{V_plugin_compat} + url = http://www.squirrelmail.org/plugins_category.php?category_id=all + regex = compatibility-(__VER__)\.tar\.gz + } + prog squirrelmail:logger = { + version = %{V_plugin_logger} + url = http://www.squeaksoft.com/products/SquirrelLogger/ + regex = squirrel_logger.(__VER__)\.tar\.gz + } + prog squirrelmail:addgraphics = { + comment = "cs: untrackable due to CMS generated URLs" + disabled + version = %{V_plugin_addgraphics} + url = http://www.squirrelmail.org/plugins_category.php?category_id=all + regex = addgraphics-(__VER__)\.tar\.gz + } + prog squirrelmail:avelsieve = { + comment = "cs: untrackable due to CMS generated URLs" + disabled + version = %{V_plugin_avelsieve} + url = http://www.squirrelmail.org/plugins_category.php?category_id=all + regex = avelsieve-(\d+\.\d+\.\d+)\.tar\.gz + } + prog squirrelmail:saslpwd = { + comment = "cs: untrackable due to CMS generated URLs" + disabled + version = %{V_plugin_saslpwd} + url = http://www.squirrelmail.org/plugins_category.php?category_id=all + regex = chg_sasl_passwd-(\d+\.\d+\.\d+-\d+\.\d+)\.tar\.gz + } + prog squirrelmail:checkquota = { + comment = "cs: untrackable due to CMS generated URLs" + disabled + version = %{V_plugin_checkquota} + url = http://www.squirrelmail.org/plugins_category.php?category_id=all + regex = check_quota-(__VER__)\.tar\.gz + } + prog squirrelmail:foldersize = { + comment = "cs: untrackable due to CMS generated URLs" + disabled + version = %{V_plugin_foldersize} + url = http://www.squirrelmail.org/plugins_category.php?category_id=all + regex = folder_sizes-(__VER__)\.tar\.gz + } + prog squirrelmail:gnupg = { + comment = "cs: untrackable due to CMS generated URLs" + disabled + version = %{V_plugin_gnupg} + url = http://www.squirrelmail.org/plugins_category.php?category_id=all + regex = gpg.(\d+\.\d+\.\d+-\d+\.\d+\.\d+)\.tar\.gz + } + prog squirrelmail:ldif = { + comment = "cs: untrackable due to CMS generated URLs" + disabled + version = %{V_plugin_ldif} + url = http://www.squirrelmail.org/plugins_category.php?category_id=all + regex = ldifimport-(__VER__)\.tar\.gz + } + prog squirrelmail:update = { + comment = "cs: untrackable due to CMS generated URLs" + disabled + version = %{V_plugin_update} + url = http://www.squirrelmail.org/plugins_category.php?category_id=all + regex = pupdate.(__VER__)\.tar\.gz + } + prog squirrelmail:userip = { + comment = "cs: untrackable due to CMS generated URLs" + disabled + version = %{V_plugin_userip} + url = http://www.squirrelmail.org/plugins_category.php?category_id=all + regex = show_user_and_ip-(__VER__)\.tar\.gz + } + prog squirrelmail:smallcal = { + comment = "cs: untrackable due to CMS generated URLs" + disabled + version = %{V_plugin_smallcal} + url = http://www.squirrelmail.org/plugins_category.php?category_id=all + regex = smallcal-(__VER__)\.tar\.gz + } + prog squirrelmail:vkeyboard = { + comment = "cs: untrackable due to CMS generated URLs" + disabled + version = %{V_plugin_vkeyboard} + url = http://www.squirrelmail.org/plugins_category.php?category_id=all + regex = vkeyboard-(__VER__)\.tar\.gz + } + prog squirrelmail:username = { + comment = "cs: untrackable due to CMS generated URLs" + disabled + version = %{V_plugin_username} + url = http://www.squirrelmail.org/plugins_category.php?category_id=all + regex = username-(__VER__)\.tar\.gz + } + +%prep + %setup -q -c -n squirrelmail + %setup -q -D -T -a 1 -c -n squirrelmail/all_locales-%{V_locale} + %setup -q -D -T -a 2 -n squirrelmail + %setup -q -D -T -a 3 -n squirrelmail + mv compatibility squirrelmail-%{V_squirrelmail}/plugins + mv squirrel_logger squirrelmail-%{V_squirrelmail}/plugins +%if "%{with_plugins}" == "yes" + %setup -q -D -T -a 4 -n squirrelmail + %setup -q -D -T -a 5 -n squirrelmail + %setup -q -D -T -a 6 -n squirrelmail + %setup -q -D -T -a 7 -n squirrelmail + %setup -q -D -T -a 8 -n squirrelmail + %setup -q -D -T -a 9 -n squirrelmail + %setup -q -D -T -a 10 -n squirrelmail + %setup -q -D -T -a 11 -n squirrelmail + %setup -q -D -T -a 12 -n squirrelmail + %setup -q -D -T -a 13 -n squirrelmail + %setup -q -D -T -a 14 -n squirrelmail + %setup -q -D -T -a 15 -n squirrelmail + + # move additional plugins where other are already placed + for plug in addgraphics avelsieve check_quota chg_sasl_passwd \ + folder_sizes gpg ldifimport pupdate show_user_and_ip \ + smallcal vkeyboard username; do + mv $plug squirrelmail-%{V_squirrelmail}/plugins + done +%endif + + # clean up login screen of distractions + ( cd squirrelmail-%{V_squirrelmail} + %patch -p0 + ) || exit $? + + # rearrange documentation and remove archive script + ( cd squirrelmail-%{V_squirrelmail} + mv AUTHORS ChangeLog COPYING INSTALL README UPGRADE doc/ + mv ReleaseNotes doc/ReleaseNotes.txt + mv themes/README.themes doc/ + for fil in `find plugins/ -name "README*" -o -name "Readme*" \ + -o -name "INSTALL*" -o -name CHANGES -o -name HISTORY`; do + %{l_shtool} mkdir -f -p -m 755 doc/`dirname $fil` + mv -f $fil $_ + done + mv doc/plugins/squirrelspell/doc/README doc/plugins/squirrelspell + rm -rf doc/plugins/squirrelspell/doc doc/plugins/squirrelspell/index.php + mv plugins/squirrelspell/doc/* doc/plugins/squirrelspell + rm -rf plugins/squirrelspell/doc + rm -f plugins/make_archive.pl +%if "%{with_plugins}" == "yes" + mv plugins/pupdate/docs/* doc/plugins/pupdate + rm -rf plugins/pupdate/docs +%endif + + # postadjustment cosmetics + %{l_shtool} subst \ + -e 's;\(#ffffff., .border="0" width=\)"350";\1"250";1' \ + src/login.php + + # set default prefs + cat %{SOURCE defprefs.txt} >>data/default_pref + ) || exit $? + +%build + +%install + rm -rf $RPM_BUILD_ROOT + + # create directory structure + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/bin \ + $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail \ + $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/prefs \ + $RPM_BUILD_ROOT%{l_prefix}/var/squirrelmail/spool/attach \ + $RPM_BUILD_ROOT%{l_prefix}/var/squirrelmail/log + + # install locales + ( cd all_locales-%{V_locale} + cp -rpf help images locale $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/ + ) || exit $? + + # install program + ( cd squirrelmail-%{V_squirrelmail} + + # install default_pref + %{l_shtool} install -c -m 644 \ + data/default_pref \ + $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/prefs/ + + # create initial administrator list + echo %{l_musr} >>$RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/admins + + # copy over most functional directories, a lot of stuff + for dir in class doc functions include plugins src themes; do + cp -rpf $dir $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/ + done + cp -rpf images/* $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/ + cp -pf locale/timezones.cfg $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/locale/ + + # install main config files + l_fqdm=`%{l_shtool} echo -e %h%d` + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + -e 's;config/\(config_local.php\);\1;g' \ + -e "s;@l_fqdm@;${l_fqdm};g" \ + %{SOURCE config.php} \ + config/config_default.php \ + config/config_local.php \ + $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/ +%if "%{with_plugins}" == "yes" + ( cd $RPM_BUILD_ROOT%{l_prefix} + %{l_patch} -p0 <%{PATCH squirrelmail.patch.plugins} + rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/*.orig + rm -f $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/gpg/*.orig + rm -f $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/chg_sasl_passwd/*.orig + ) || exit $? +%endif + + # install plugin config files + ( cd $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins + %{l_shtool} subst \ + -e 's;../data/access_log;../../../var/squirrelmail/log/access.log;' \ + -e 's;\(\$sl_dateformat = \)"m/d/Y G:i:s";\1"d/m/Y G:i:s";' \ + squirrel_logger/setup.php +%if "%{with_plugins}" == "yes" + cp -pf check_quota/config.sample.php check_quota/config.php + cp -pf chg_sasl_passwd/config.php.sample chg_sasl_passwd/config.php + cp -pf show_user_and_ip/config.php.sample show_user_and_ip/config.php + %{l_shtool} install -c -m 644 \ + -e "s;sm_logo\.png;opkg_small.png;" \ + -e "s;SquirrelMail Logo;OpenPKG Logo;" \ + -e "s;www\.squirrelmail\.org;www.openpkg.org;" \ + -e "s;\/\/\(\$image_width.*\) = 308;\1 = 201;" \ + -e "s;\/\/\(\$image_height.*\) = 111;\1 = 62;" \ + addgraphics/config.php.typical.one.domain \ + addgraphics/config.php + %{l_shtool} install -c -m 644 \ + -e 's/^\(\$sieve_preferred_sasl_mech =\).*/\1 "PLAIN LOGIN CRAM-MD5 DIGEST-MD5";/' \ + -e 's/^\(\$avelsieve_oldcyrus =\).*/\1 false;/' \ + -e 's/^\(\$startitems =\).*/\1 4;/' \ + avelsieve/config/config_sample.php \ + avelsieve/config/config.php + %{l_shtool} subst \ + -e 's;\(path_to_gpg=\)/usr/bin/gpg.*;\1%{l_prefix}/bin/gpg;' \ + gpg/gpg_local_prefs.txt + %{l_shtool} install -c -m 644 \ + -e 's;\(adminusername = "\)[^"]*;\1%{l_musr};' \ + -e 's;corehide = 1;corehide = 0;' \ + pupdate/config.php.sample \ + pupdate/config.php + %{l_shtool} install -c -m 644 \ + -e "s;\(\$vkeyboard_msgsize.*\)'medium';\1'x-small';" \ + -e "s;\(\$vkeyboard_layout.*\)'us_english';\1'portuguese_abnt2';" \ + -e "s;\(\$vkeyboard_height.*\)'250';\1'270';" \ + vkeyboard/config.php.sample \ + vkeyboard/config.php + cp -pf username/config.php.sample username/config.php + %{l_shtool} install -c -m 644 \ + %{SOURCE opkg_small.png} \ + $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/ +%endif + ) || exit $? + + # install squirrelmail configuration perl script + %{l_shtool} install -c -m 755 \ + -e 's;chdir($dir);chdir("%{l_prefix}/etc/squirrelmail");g' \ + -e 's;\.\./plugins;%{l_prefix}/share/squirrelmail/plugins;g' \ + -e 's;\.\./themes;%{l_prefix}/share/squirrelmail/themes;g' \ + -e 's;config/config_local.php;config_local.php;g' \ + config/conf.pl \ + $RPM_BUILD_ROOT%{l_prefix}/bin/squirrelconf + + # use our own logo, a squirrel next to a OpenPKG package + %{l_shtool} install -c -m 644 \ + %{SOURCE opkg_large.png} \ + $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/ + ) || exit $? + + # install runcommand script + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + %{SOURCE rc.squirrelmail} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ + + # replace false /etc config paths throughout + %{l_shtool} subst \ + -e 's;SM_PATH \. \(.\)config/;\1%{l_prefix}/etc/squirrelmail/;g' \ + -e 's;require_once(SM_PATH \. \(.*\)%{l_prefix};require_once(\1%{l_prefix};g' \ + $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/functions/*.php \ + $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/include/*.php \ + $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/abook_take/*.php \ + $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/administrator/*.php \ + $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/calendar/*.php \ + $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/src/*.php + + # integration into Apache under /webmail + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + %{SOURCE squirrelmail.conf} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/ + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + %{SOURCE index.php} \ + $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/ + + # optional KOLAB configuration +%if "%{with_kolab}" == "yes" + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + %{SOURCE config_local_kolab.php} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/config_local.php +%endif + + # determine package ingredients and tag config files + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ + %{l_files_std} \ + '%config %{l_prefix}/etc/squirrelmail/*' \ + '%config %{l_prefix}/share/squirrelmail/prefs/*' \ + '%config %{l_prefix}/share/squirrelmail/plugins/squirrelspell/sqspell_config.php' \ +%if "%{with_plugins}" == "yes" + '%config %{l_prefix}/share/squirrelmail/plugins/addgraphics/config.php' \ + '%config %{l_prefix}/share/squirrelmail/plugins/avelsieve/config/config.php' \ + '%config %{l_prefix}/share/squirrelmail/plugins/check_quota/config.php' \ + '%config %{l_prefix}/share/squirrelmail/plugins/chg_sasl_passwd/config.php' \ + '%config %{l_prefix}/share/squirrelmail/plugins/folder_sizes/folder_sizes.php' \ + '%config %{l_prefix}/share/squirrelmail/plugins/gpg/gpg_local_prefs.txt' \ + '%config %{l_prefix}/share/squirrelmail/plugins/ldifimport/config.php' \ + '%config %{l_prefix}/share/squirrelmail/plugins/pupdate/config.php' \ + '%config %{l_prefix}/share/squirrelmail/plugins/show_user_and_ip/config.php' \ + '%config %{l_prefix}/share/squirrelmail/plugins/vkeyboard/config.php' \ + '%config %{l_prefix}/share/squirrelmail/plugins/username/config.php' \ +%endif + '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/share/squirrelmail/prefs' \ + '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/squirrelmail/spool/attach' \ + '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/squirrelmail/log' + +%files -f files + +%clean + rm -rf $RPM_BUILD_ROOT + +%preun + # before erase, remove log files + [ $1 -eq 0 ] || exit 0 + rm -f $RPM_INSTALL_PREFIX/var/squirrelmail/log/*.log >/dev/null 2>&1 || true +