Лясны жыхар (soko1) wrote in sokolsoft,
Лясны жыхар
soko1
sokolsoft

  • Music:

mutt-tools

была у меня когда-то идея создать пакет (mutt-tools), в который входили бы программы для принятия, отправки и чтения почты. причем, чтоб эти программы, их конфиги, и почта лежали в одном каталоге, который можно было бы без проблем перетащить на другой компьютер; написать легкий конфигуратор, при помощи которого можно было бы без проблем настроить конфиги этих 3 программ (fetchmail - для получения, msmtp - для отправки и mutt - для чтения почты), инсталятор и подробная док-ция. так вот, остановился я только на инсталяторе, так и не дописав его. провозился долгое время с возможностью накладки патчей под определенную ОС...выливаю то что сделал, но то что еще не готово к употреблению.

#!/bin/sh

# OPTIONS

# general options
log_file="mutt-tools.log"
maildir="~/Mail"
prefix="/usr/local/share/mutt-tools"
configdir="$maildir/configs"
os=`uname -s`
make="make"

# fechmail options
fetchmail="fetchmail-6.2.5"
fetchmail_conf_options="--prefix=$prefix/$fetchmail --with-hesiod=no"

# mutt options
mutt="mutt-1.5.11"

# procmail options
procmail="procmail-3.22"

# msmtp options
msmtp="msmtp-1.4.4"

# END OPTIONS

set -e

echo
echo "-=Welcom to installer \"Mutt-tools\"!=-"
echo

echo "Install \"Mutt-tools\" (y/n)?"
read key
if [ $key != "y" ]; then
        echo "Install cancelled..."
        exit
fi

cd src

echo "Default path install directory: $prefix"
echo "Change other directory (y/n)?"
read key
if [ $key = "y" ]; then
        echo "Give path:"
        read prefix
fi

echo "Default path mail-files directory: $maildir"
echo "Change other directory (y/n)?"
read key
if [ $key = "y" ]; then
        echo "Give path:"
        read maildir
fi

echo "Default path config-files directory: $configdir"
echo "Change other directory (y/n)?"
read key
if [ $key = "y" ]; then
        echo "Give path:"
        read configdir
fi

echo "Extracting files..."

(cd fetchmail && tar xzpvf $fetchmail.tar.gz && cd ../) 2>/dev/null
(cd mutt && tar xzpvf $mutt.tar.gz && cd ../) 2>/dev/null
(cd procmail && tar xzpvf $procmail.tar.gz && cd ../) 2>/dev/null
(cd msmtp && tar xjpvf $msmtp.tar.bz2 && cd ../) 2>/dev/null

# if FreeBSD OS
if [ $os = "FreeBSD" ]; then
        conf_options_other=" CPPFLAGS=\"-I /usr/local/include\" LDFLAGS=\"-L /usr/local/lib\" CFLAGS=\"-I /usr/local/include\""
        make="gmake"

        # patching fetchmail
        echo "Patching $fetchmail from $os..."
        cd fetchmail/$fetchmail
        (gzip -cd ../fetchmail-patch-6.2.5.2.gz | patch -p1) 2>/dev/null
        (cp ../files/fetchmailconf ../$fetchmail) 2>/dev/null
        (cat ../files/patch-aclocal.m4 | patch -p1) 2>/dev/null
        (cat ../files/patch-ah | patch -p1) 2>/dev/null
        (cat ../files/patch-ai | patch -p1) 2>/dev/null
        (cat ../files/patch-aj | patch -p1) 2>/dev/null
        (cat ../files/patch-configure | patch -p1) 2>/dev/null
        (cd po && cat ../../files/patch-al | patch -p1 && cd ../) 2>/dev/null
#       (cat ../files/patch-libintl | patch -p1) 2>/dev/null
        cd ../../

        # patching mutt
        echo "Pathing $mutt from $os..."
        cd mutt/$mutt
        (cat ../files/extra-patch-aspell | patch -p1) 2>/dev/null
        (cat ../files/extra-patch-maildir-header-cache | patch -p1) 2>/dev/null
        (cat ../files/extra-patch-maildir-mtime | patch -p1) 2>/dev/null
        (cat ../files/extra-patch-maildir-mtime-nntp | patch -p1) 2>/dev/null
#       (cat ../files/extra-patch-pgp-dw | patch -p2) 2>/dev/null
        (cat ../files/extra-patch-reverse_reply | patch -p1) 2>/dev/null
        (cat ../files/extra-patch-sidebar | patch -p1) 2>/dev/null
        (cat ../files/extra-patch-smime-outlook | patch -p1) 2>/dev/null
#       (cat ../files/patch-02 | patch -p1) 2>/dev/null
        (cat ../files/patch-05 | patch -p1) 2>/dev/null
        (cat ../files/patch-08 | patch -p1) 2>/dev/null
        (cat ../files/patch-Makefile.am.doc | patch -p1) 2>/dev/null
        (cat ../files/patch-color-eol | patch -p1) 2>/dev/null
        (cat ../files/patch-date-conditional | patch -p1) 2>/dev/null
#       (cat ../files/patch-examples | patch -p1) 2>/dev/null
        (cat ../files/patch-hcache-db | patch -p1) 2>/dev/null
        (cat ../files/patch-init.c | patch -p1) 2>/dev/null
        (cat ../files/patch-mktemp | patch -p1) 2>/dev/null
        (cat ../files/patch-pop_auth.c | patch -p1) 2>/dev/null
#       (cat ../files/patch-smime-self | patch -p1) 2>/dev/null
#       (cat ../files/patch-smime-sender | patch -p1) 2>/dev/null
#       (cat ../files/patch-threadcomplete | patch -p1) 2>/dev/null
#       (cat ../files/patch-contrib-Makefile.in | patch -p1) 2>/dev/null
#       (cd contrib && cat ../../files/extra-patch-nodoc-contrib | patch -p1 && ../) 2>/dev/null
        (cd doc && cat ../../files/patch-doc-manual.xml.head | patch -p1 && cd ../) 2>/dev/null
        (cd doc && cat ../../files/extra-patch-doc-ref | patch -p1 && cd ../) 2>/dev/null
        (cd doc && cat ../../files/extra-patch-doc-xml | patch -p1 && cd ../) 2>/dev/null
        cd ../../

        # patching 
        echo "Pathing $procmail from $os..."
        #...

        fetchmail_conf_options=$fetchmail_conf_options$conf_options_other
fi

cd fetchmail/$fetchmail

echo "Configuring $fetchmail..."
(sh configure $fetchmail_conf_options)
echo "Compilling $fetchmail..."
($make) >/dev/null 2>/dev/null
  • Post a new comment

    Error

    default userpic
  • 27 comments