jaromail

a commandline tool to easily and privately handle your e-mail
git clone git://parazyd.org/jaromail.git
Log | Files | Refs | Submodules | README

commit be7966789ccb862349ba0bc62d0d8f0841aaefd4
parent 4e5c13d53510e355afeb71bf46665948ee8a8c6c
Author: parazyd <parazyd@dyne.org>
Date:   Sun,  8 Oct 2017 21:48:29 +0200

remove build dir

Diffstat:
Dbuild/auto | 21---------------------
Dbuild/build-gnu.sh | 159-------------------------------------------------------------------------------
Dbuild/build-osx.sh | 241-------------------------------------------------------------------------------
Dbuild/build-win.sh | 100-------------------------------------------------------------------------------
Dbuild/cc-static.zsh | 184-------------------------------------------------------------------------------
Dbuild/clang-static-osx.sh | 68--------------------------------------------------------------------
Dbuild/install-gnu.sh | 75---------------------------------------------------------------------------
Dbuild/install-win.sh | 69---------------------------------------------------------------------
Dbuild/release-osx.sh | 193-------------------------------------------------------------------------------
9 files changed, 0 insertions(+), 1110 deletions(-)

diff --git a/build/auto b/build/auto @@ -1,21 +0,0 @@ -#!/usr/bin/env zsh - -os=`uname -o` -action=$1 - -[[ "$action" = "" ]] && { - print "usage: auto [ build | install ]" - return 1 -} - -case $os in - Cygwin) - print "Windows $action" - ./build/${action}-win.sh - ;; - GNU/Linux) - print "GNU/Linux $action" - ./build/${action}-gnu.sh - ;; -esac - diff --git a/build/build-gnu.sh b/build/build-gnu.sh @@ -1,159 +0,0 @@ -#!/usr/bin/env zsh - -distro=unknown - -builddir=`pwd` -# cc="${builddir}/cc-static.zsh" -cc="gcc -O3" -[[ "$OSTYPE" = linux-musl ]] && cc="gcc -Os -static" - -which apt-get > /dev/null && distro=debian -which yum > /dev/null && distro=fedora -which pacman > /dev/null && distro=arch - -target=all -{ test -z $1 } || { target="$1" } -# no other distro supported atm - -mkdir -p build/gnu - -debian_req() { - for p in "$@"; do - { dpkg --get-selections "$p" | grep -q "[[:space:]]install$" } || { - sudo apt-get install "$p" } || { - print "Failed to install $p" - return 1 - } - done - return 0 -} - - -{ test "$target" = "deps" } || { - test "$target" = "all" } && { - case $distro in - debian) - deps=(fetchmail msmtp mutt-kz pinentry-curses) - deps+=(wipe notmuch sqlite3 abook elinks) - deps+=(gcc make libglib2.0-dev) - - print "Building on Debian" - print "Checking software to install" - debian_req $deps - ;; - - fedora) - - print "Building on Fedora" - print "Checking software to install..." - which zsh || sudo yum install zsh - which mutt || sudo yum install mutt - which procmail || sudo yum install procmail - which msmtp || sudo yum install msmtp - which pinentry || sudo yum install pinentry - which fetchmail || sudo yum install fetchmail - which wipe || sudo yum install wipe - which abook || sudo yum install abook - which notmuch || sudo yum install notmuch - - print "Checking build dependencies" - which gcc || sudo yum install gcc - which bison || sudo yum install bison - which flex || sudo yum install flex - rpm -q glib2-devel || sudo yum install glib2-devel - rpm -q libgnome-keyring-devel || sudo yum install libgnome-keyring-devel - rpm -q bzip2-devel || sudo yum install bzip2-devel - rpm -q zlib-devel || sudo yum install zlib-devel - - ;; - - arch) - print "All dependencies installed via pacman/AUR" - print "Building on Arch..." - ;; - - *) - print "Error: no distro recognized, build by hand." - ;; - esac - - print "All dependencies installed" -} - -[[ "$target" = "mutt-kz" ]] && { - pushd src/mutt-kz - print "Compiling Mutt patched for notmuch ... " - print - ./configure --enable-notmuch --enable-sidebar --enable-hcache --enable-gpgme --enable-imap --enable-pop && - make - popd - print OK -} - -{ test "$target" = "fetchaddr" } || { - test "$target" = "all" } && { - pushd src - print -n "Compiling the address parser (RFC2047) ... " - ${=cc} -c helpers.c - ${=cc} -c rfc2047.c - ${=cc} -c rfc822.c - ${=cc} -c -DHAVE_ICONV fetchaddr.c - ${=cc} -o fetchaddr fetchaddr.o helpers.o rfc2047.o rfc822.o - popd - cp src/fetchaddr build/gnu/ - print OK -} - -{ test "$target" = "parsedate" } || { - test "$target" = "all" } && { - print -n "Compiling the date parsers (RFC822) ... " - pushd src - ${=cc} -o parsedate parsedate.c - popd - cp src/parsedate build/gnu/ - print OK -} - -{ test "$target" = "dotlock" } || { - test "$target" = "all" } && { - print -n "Compiling the file dotlock... " - pushd src - ${=cc} -c dotlock.c -I . -DDL_STANDALONE - ${=cc} -o dotlock dotlock.o - popd - cp src/dotlock build/gnu/ - print OK -} - -{ test "$target" = "gpgewrap" } || { - test "$target" = "all" } && { - print -n "Compiling the GnuPG wrapper... " - pushd src - ${=cc} -c gpgewrap.c -I . - ${=cc} -o gpgewrap gpgewrap.o - popd - cp src/gpgewrap build/gnu/ - print OK -} - - -# build mixmaster only if specified -{ test "$target" = "mixmaster" } && { - print "Compiling Mixmaster (anonymous remailer)" - pushd src/mixmaster-3.0/Src - mixmaster_sources=(main menustats mix rem rem1 rem2 chain chain1 chain2 nym) - mixmaster_sources+=(pgp pgpdb pgpdata pgpget pgpcreat pool mail rfc822 mime keymgt) - mixmaster_sources+=(compress stats crypto random rndseed util buffers maildir parsedate.tab) - bison parsedate.y - for s in ${=mixmaster_sources}; do ${=cc} -c ${s}.c; done - ${=cc} -o mixmaster *.o -lssl - popd - cp src/mixmaster-3.0/Src/mixmaster build/gnu -} - - -print -print "Done building JaroMail!" -print "Now run 'make install' as root to install jaromail in /usr/local" -print "use PREFIX=/home/private/jaromail to avoid system-wide installation." -print diff --git a/build/build-osx.sh b/build/build-osx.sh @@ -1,241 +0,0 @@ -#!/usr/bin/env zsh - -# this script creates a binary build for Apple/OSX -# it requires all needed macports to be installed: - - -# pinentry -# sudo port install pinentry +universal - -# msmtp -# sudo port install msmtp +universal - -# and local natives: fetchmail, procmail... - -builddir=`pwd` - -#cc="${builddir}/cc-static.zsh" -#cc="gcc-4.7" -#cpp="cpp-4.7" - -OSX_SDK=10.8 -#cc="llvm-gcc" -#cpp="llvm-cpp-4.2" -cflags+=(-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OSX_SDK}.sdk/usr/include) -ldflags+=(-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OSX_SDK}.sdk/usr/lib) - -#cc="gcc" -#cpp="cpp" - -# ${builddir}/clang-static-osx.sh" - -homebrew="/usr/local" - -#cflags="-arch x86_64 -arch i386 -O2" -cflags=(-I${homebrew}/include -I/usr/include) -cflags+=(-arch x86_64) -#cflags+=(-arch i386) -cflags+=(-O2) - - -ldflags=(-L${homebrew}/lib -L/usr/lib) - - -target=all -{ test -z $1 } || { target="$1" } -# no other distro supported atm - -pushd .. - -mkdir -p build/osx/dylib - -root=`pwd` - -copydeps() { - # copy a binary and all dependencies until 3rd level - # 1st argument is the binary (full path) - # 2nd is the .app where to copy it (relative) - - libs=(`otool -L $1 | awk ' - /^\// {next} /\/local/ {print $1}'`) - - exe=`basename $1` - bin=osx - lib=osx/dylib - cp -v $1 $bin/$exe - { test $? = 0 } || { print "Error copying $1" } - chmod +w $bin/$exe - strip $bin/$exe - for d in ${libs}; do - dylib=`basename $d` - print " $dylib" - # skip iconv and use the one provided system wide -# { test "$dylib" = "libiconv.2.dylib" } && { -# install_name_tool -change $d /usr/lib/libiconv.2.dylib $dst/Contents/MacOS/$exe -# continue } - # make sure destination is writable - dylibdest=$lib/`basename $d` - { test -r $dylibdest } || { cp -v "$d" "$dylibdest" } - install_name_tool -change $d \ - "/Applications/JaroMail.app/Contents/Frameworks/`basename $d`" $bin/$exe - done - -} - - -copydeps_brew() { - # copy a binary and all dependencies until 3rd level - # 1st argument is the binary (full path) - # 2nd is the .app where to copy it (relative) - - libs=(`otool -L $1 | awk ' - /^\// {next} /@rpath/ {print $1}'`) - - exe=`basename $1` - bin=osx - lib=osx/dylib - cp -v $1 $bin/$exe - { test $? = 0 } || { print "Error copying $1" } - chmod +w $bin/$exe - strip $bin/$exe - for d in ${libs}; do - dylib=${d#*/} - dylib_path=${homebrew}/lib/$dylib - - print " $dylib" - # make sure destination is writable - dylibdest=$lib/$dylib - - { test -r $dylibdest } || { cp -v "$dylib_path" "$dylibdest" } - install_name_tool -change "$d" \ - "/Applications/JaroMail.app/Contents/Frameworks/`basename $d`" $bin/$exe - done - -} - - -print "Building Jaro Mail binary stash for Apple/OSX" - - -if ! [ -r ${homebrew}/bin ]; then - print "Homebrew binaries not found in $homebrew" - return 1 -fi - -# { test "$target" = "abquery" } || { -# test "$target" = "all" } && { -# # build apple addressbook query -# print "Address book query" -# pushd src/ABQuery -# xcodebuild > /dev/null -# popd -# } - -{ test "$target" = "dfasyn" } || { - test "$target" = "all" } && { - pushd src/mairix/dfasyn - ./configure - make - popd -} - -{ test "$target" = "mairix" } || { - test "$target" = "all" } && { - pushd src/mairix - print "Building Mairix" - ./configure - make - popd -} - -{ test "$target" = "fetchaddr" } || { - test "$target" = "all" } && { -# build our own address parser - pushd src - print "Address parser" - $cc ${=cflags} -c fetchaddr.c - $cc ${=cflags} -c helpers.c - $cc ${=cflags} -c rfc2047.c - $cc ${=cflags} -c rfc822_mutt.c - $cc -o fetchaddr fetchaddr.o helpers.o rfc2047.o rfc822_mutt.o ${=ldflags}; - popd -} - -{ test "$target" = "fetchdate" } || { - test "$target" = "all" } && { -# build our own fetchdate - pushd src - $cc ${=cflags} ${=ldflags} -I mairix -c fetchdate.c - $cc ${=cflags} ${=ldflags} -DHAS_STDINT_H -DHAS_INTTYPES_H \ - -o fetchdate fetchdate.o \ - mairix/datescan.o mairix/db.o mairix/dotlock.o \ - mairix/expandstr.o mairix/glob.o mairix/md5.o \ - mairix/nvpscan.o mairix/rfc822.o mairix/stats.o \ - mairix/writer.o mairix/dates.o mairix/dirscan.o \ - mairix/dumper.o mairix/fromcheck.o mairix/hash.o mairix/mbox.o \ - mairix/nvp.o mairix/reader.o mairix/search.o mairix/tok.o - popd -} - - -{ test "$target" = "dotlock" } || { - test "$target" = "all" } && { -# build our own dotlock - pushd src - $cc ${=cflags} -c dotlock.c - $cc ${=ldflags} -o dotlock dotlock.o - popd -} - -# { test "$target" = "msmtp" } || { -# test "$target" = "all" } && { -# # build our own msmtp -# # port deps: libidn gnutls -# pushd src/msmtp -# print "SMTP Simple mail transport protocol agent" -# CC="$cc" LD=/usr/bin/ld CPP=/usr/bin/cpp \ -# ./configure --without-macosx-keyring --without-gnome-keyring \ -# > /dev/null ; make 2>&1 > /dev/null -# popd -# } - -pushd build -appdst=JaroMail.app - -# if brew is present then install a few needed packages -command -v brew -[[ $? = 0 ]] && { - brew install mutt - brew install fetchmail - brew install msmtp - brew install findutils - brew install elinks - brew install abook -} - -# copy all built binaries in place -{ test "$target" = "install" } || { - test "$target" = "all" } && { - - mkdir -p $bindst - mkdir -p $appdst/Contents/Frameworks - -# static ones do not require relocated links - cp -v ${root}/src/fetchdate osx - cp -v ${root}/src/fetchaddr osx -# cp -v ${root}/src/ABQuery/build/Release/lbdb-ABQuery - copydeps_brew ${homebrew}/bin/mutt - copydeps_brew ${homebrew}/bin/pgpewrap -# copydeps ${homebrew}/bin/procmail - copydeps_brew ${homebrew}/bin/fetchmail - copydeps_brew ${homebrew}/bin/elinks - copydeps_brew ${homebrew}/bin/gfind - copydeps_brew ${homebrew}/bin/msmtp - copydeps_brew ${homebrew}/bin/gpg - copydeps_brew ${homebrew}/bin/pinentry - copydeps_brew ${homebrew}/bin/pinentry-curses - copydeps_brew ${homebrew}/bin/abook - - # system wide - # rm build/osx/dylib/libiconv.2.dylib -} diff --git a/build/build-win.sh b/build/build-win.sh @@ -1,100 +0,0 @@ -#!/usr/bin/env zsh - -distro=cygwin - -builddir=`pwd` -# cc="${builddir}/cc-static.zsh" -cc="gcc -O3" - -pushd .. - -target=all -{ test -z $1 } || { target="$1" } -# no other distro supported atm - -mkdir -p build/win - -{ test "$target" = "deps" } || { - test "$target" = "all" } && { - # only babun's pact supported for now - deps=(fetchmail msmtp mutt pinentry-curses pinentry-w32) - deps+=(sqlite3 abook) - deps+=(make) - - print "Building on Cygwin" - print "Checking software to install" - for d in $deps; do - pact install $d - done - - print "All dependencies installed" -} - -{ test "$target" = "fetchaddr" } || { - test "$target" = "all" } && { - pushd src - print -n "Compiling the address parser (RFC2047) ... " - ${=cc} -c helpers.c - ${=cc} -c rfc2047.c - ${=cc} -c rfc822.c; - ${=cc} -c -DHAVE_ICONV fetchaddr.c; - ${=cc} -o fetchaddr fetchaddr.o helpers.o rfc2047.o rfc822.o - popd - cp src/fetchaddr build/win/ - print OK -} - -{ test "$target" = "parsedate" } || { - test "$target" = "all" } && { - print -n "Compiling the date parsers (RFC822) ... " - pushd src - ${=cc} -o parsedate parsedate.c - popd - cp src/parsedate build/win/ - print OK -} - -{ test "$target" = "dotlock" } || { - test "$target" = "all" } && { - print -n "Compiling the file dotlock... " - pushd src - ${=cc} -c dotlock.c -I . -DDL_STANDALONE - ${=cc} -o dotlock dotlock.o - popd - cp src/dotlock build/win/ - print OK -} - -{ test "$target" = "gpgewrap" } || { - test "$target" = "all" } && { - print -n "Compiling the GnuPG wrapper... " - pushd src - ${=cc} -c gpgewrap.c -I . - ${=cc} -o gpgewrap gpgewrap.o - popd - cp src/gpgewrap build/win/ - print OK -} - -# build mixmaster only if specified -{ test "$target" = "mixmaster" } && { - print "Compiling Mixmaster (anonymous remailer)" - pushd src/mixmaster-3.0/Src - mixmaster_sources=(main menustats mix rem rem1 rem2 chain chain1 chain2 nym) - mixmaster_sources+=(pgp pgpdb pgpdata pgpget pgpcreat pool mail rfc822 mime keymgt) - mixmaster_sources+=(compress stats crypto random rndseed util buffers maildir parsedate.tab) - bison parsedate.y - for s in ${=mixmaster_sources}; do ${=cc} -c ${s}.c; done - ${=cc} -o mixmaster *.o -lssl - popd - cp src/mixmaster-3.0/Src/mixmaster build/win -} - - -print -print "Done building JaroMail!" -print "Now run 'make install' as root to install jaromail in /usr/local" -print "use PREFIX=/home/private/jaromail to avoid system-wide installation." -print - -popd diff --git a/build/cc-static.zsh b/build/cc-static.zsh @@ -1,184 +0,0 @@ -#!/usr/bin/env zsh - -# Static build wrapper -# -# Copyleft (C) 2012 Denis Roio <jaromil@dyne.org> -# -# This source code is free software; you can redistribute it and/or -# modify it under the terms of the GNU Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This source code is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# Please refer to the GNU Public License for more details. -# -# You should have received a copy of the GNU Public License along with -# this source code; if not, write to: -# Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# this script modifies compiler commands to include all static -# libraries that are found. - - -# configuration variables - -typeset -a arguments cflags libdirs deps skip -typeset -lA libraries # map (name, static|dynamic) -typeset -h argc - -# check the operating system -case `uname` in - Linux) - cc=gcc -# cc=clang - libdirs+=/lib - libdirs+=/usr/lib - libdirs+=/usr/lib/i386-linux-gnu - libdirs+=/usr/local/lib - cflags+=(-O2) - libraries+=(ld-linux-x86 skip) - libraries+=(linux-vdso skip) - libraries+=(c skip) -# libraries+=(rt skip) - libraries+=(pthread shared) - libraries+=(dl shared) - libraries+=(m shared) - ;; - Darwin) - cc=clang - libdirs+=(/opt/local/lib) - cflags+=(-arch x86_64) - cflags+=(-arch i386) - ;; -esac - -########################## - -arguments=($@) - -linkdep() { - # # descend lib dependencies - dep="`basename ${1}`" - { test "$dep" = "" } && { print "Error: linkdep called with void argument"; return 1 } - - dep=${dep/lib/} # strip lib- prefix - - # check if known - { test "${libraries[$dep]}" = "skip" } && { - # to be skipped - print "$dep :: skip" - return 3 - } - - { test "${libraries[$dep]}" = "shared" } && { - # force shared - arguments+=("-l${dep}") - isshared=1 - print "$dep :: shared" - return 1 - } - - # check if a static lib is present - for l in ${=libdirs}; do - static="${l}/lib${dep}.a" - shared="${l}/lib${dep}.so" - { test -r "$shared" } || { shared="${l}/lib${dep}" } - - { ! test -r "$shared" } && { ! test -r "$static" } && { continue } - - # save deps - { test -r "$shared" } && { - for dd in `ldd $shared | awk '{print $1}'`; do - deps+=($dd); done - } - - if [ -r "$static" ]; then - print "$dep :: static :: $static <> ${arguments[$argc]}" - arguments[$argc]="" # remove from arguments - arguments+=($static); - libraries+=($dep static) - return 0 - - elif [ -r "$shared" ]; then - print "$dep :: shared :: $shared <> ${arguments[$argc]}" - arguments[$argc]="" # remove from arguments - arguments+=($shared); - isshared=true - libraries+=($dep dynamic) - - return 1 - - else print "$dep not found in ${l}"; return 10 - - fi - done - -} - -# check if we are linking -echo $arguments | grep -i ' -l' > /dev/null -{ test $? = 0 } && { - - argc=0 - for i in ${=arguments}; do - argc=$(( $argc + 1 )) - - # is it a new library path? - { test "$i[1,2]" = "-L" } && { - lib=${i/-L/} - libdirs=($lib $libdirs) - continue - } - - # is it a shared library link argument? - { test "$i[1,2]" = "-l" } && { - lib=${i/-l/} - - linkdep "lib${lib}" - } - done - - echo "-= Process sub dependencies" - # eliminate duplicates - typeset -U deps - - for d in ${=deps}; do - - # check if it was already made static - ds="`print ${d/lib/} | cut -d. -f1`" - - { test "$libraries[$ds]" = "static" } && { continue } - linkdep "lib${ds}" - done - - # check if full static - { test -z $isshared } && { cflags+=(-static) } -} - -# remove duplicate arguments -typeset -U arguments - -# execute -print "$cc ${=cflags} ${=arguments}" -$cc ${=cflags} ${=arguments} - - - -# TODO - - # Darwin) - # deps1=`otool -L ${libdir}/$lib.dylib | awk ' - # /^\// {next} /\/opt\/local/ {print $1}'` - # for d1 in ${(f)deps1}; do - # dep=`basename $d1` - # sdep=${dep/.*/.a} - # ddep=${dep/lib/-l} - # ddep=${ddep/.*/} - # if [ -r ${libdir}/${sdep} ]; then - # arguments+=(${libdir}/${sdep}) - # else arguments+=($ddep); fi - # done - - diff --git a/build/clang-static-osx.sh b/build/clang-static-osx.sh @@ -1,68 +0,0 @@ -#!/usr/bin/env zsh - -# Static build wrapper to be used with clang on osx -# -# Copyleft (C) 2012 Denis Roio <jaromil@dyne.org> -# -# This source code is free software; you can redistribute it and/or -# modify it under the terms of the GNU Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This source code is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# Please refer to the GNU Public License for more details. -# -# You should have received a copy of the GNU Public License along with -# this source code; if not, write to: -# Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# this script modifies compiler commands to include all -# static libraries that are found. - - -# configuration variables - -cc=gcc -libdir="/usr/local/lib" - -typeset -a arguments -typeset -a cflags - -cflags+=(-arch x86_64) -# cflags+=(-arch i386) - -########################## - -arguments=($@) - -# linking -echo $arguments | grep ' -l' > /dev/null -{ test $? = 0 } && { - c=1; for i in ${=arguments}; do - { test "$i[1,2]" = "-l" } && { - lib=${i/-l/lib} - arguments[$c]="${libdir}/${lib}.a" - # descend lib dependencies - deps1=`otool -L ${libdir}/$lib.dylib | awk ' - /^\// {next} /\/opt\/local/ {print $1}'` - for d1 in ${(f)deps1}; do - dep=`basename $d1` - sdep=${dep/.*/.a} - ddep=${dep/lib/-l} - ddep=${ddep/.*/} - if [ -r ${libdir}/${sdep} ]; then - arguments+=(${libdir}/${sdep}) - else arguments+=($ddep); fi - done - } - c=$(( $c + 1 )) - done -} - -# remove duplicate arguments -typeset -U arguments - -# execute -$cc ${=cflags} ${=arguments} diff --git a/build/install-gnu.sh b/build/install-gnu.sh @@ -1,75 +0,0 @@ -#!/usr/bin/env zsh - -PREFIX=${PREFIX:-/usr/local} - -# TODO: separate libexec from share -JARO_LIBEXEC=$PREFIX/share/jaromail -JARO_SHARE=$PREFIX/share/jaromail -touch $JARO_SHARE || { - print "Error: cannot write to $JARO_SHARE" - print "Run as root or set PREFIX to another location" - return 1 -} - -# cleanup previous installs -rm -rf "$JARO_SHARE" -mkdir -p "$JARO_SHARE" - -{ test $? = 0 } || { - print "No permissions to install system-wide."; return 1 } - -{ test -r doc } && { srcdir=. } -{ test -r install-gnu.sh } && { srcdir=.. } - -{ test -r $srcdir/src/fetchaddr } || { - print "Error: first build, then install."; return 1 } - -mkdir -p $JARO_SHARE/{.mutt,.stats} -cp -ra $srcdir/doc/* $JARO_SHARE/ -cp -ra $srcdir/src/mutt/* $JARO_SHARE/.mutt/ -cp -ra $srcdir/src/stats/* $JARO_SHARE/.stats/ - -# copy the executables -mkdir -p $JARO_LIBEXEC/{bin,zlibs} -cp $srcdir/src/jaro $JARO_LIBEXEC/bin -cp -ra $srcdir/build/gnu/* $JARO_LIBEXEC/bin -cp -r $srcdir/src/zlibs/* $JARO_LIBEXEC/zlibs/ -cp -r $srcdir/src/zuper/{zuper,zuper.init} $JARO_LIBEXEC/zlibs - -for l in `ls $JARO_LIBEXEC/zlibs/ | grep '.zwc$'`; do - rm -f $l -done - -for l in `ls $JARO_LIBEXEC/zlibs/ | grep -v '.zwc$'`; do - zcompile $JARO_LIBEXEC/zlibs/$l -done - -chmod -R a+rX "$JARO_SHARE" - -mkdir -p $PREFIX/bin -cat <<EOF > $PREFIX/bin/jaro -#!/usr/bin/env zsh -export JAROWORKDIR=${JARO_SHARE} -EOF - -# zmodload zsh/pcre -# if not installed system-wide then place the Mail into prefix -[[ "$PREFIX" =~ "^/usr" ]] || { - cat <<EOF >> $PREFIX/bin/jaro -export JAROMAILDIR=${PREFIX} -EOF -} -cat <<EOF >> $PREFIX/bin/jaro -${JARO_SHARE}/bin/jaro \${=@} -EOF -chmod +x $PREFIX/bin/jaro - -[[ "$PREFIX" =~ "^/usr" ]] || $PREFIX/bin/jaro init -print "Jaro Mail succesfully installed in: $PREFIX" -print "Executable path: $PREFIX/bin/jaro" -[[ "$PREFIX" =~ "^/usr" ]] && { - print "To initialize your Mail dir use: jaro init" - print "Default is $HOME/Mail" - print "Change it via environment variable JAROMAILDIR" -} -return 0 diff --git a/build/install-win.sh b/build/install-win.sh @@ -1,69 +0,0 @@ -#!/usr/bin/env zsh - -PREFIX=${PREFIX:-$HOME/Mail} - -# TODO: separate libexec from share -JARO_LIBEXEC=$HOME/Mail/system -JARO_SHARE=$HOME/Mail -mkdir -p $HOME/Mail -touch $JARO_SHARE || { - print "Error: cannot write to $JARO_SHARE" - print "Run as root or set PREFIX to another location" - return 1 -} - -# cleanup previous installs -rm -rf "$JARO_SHARE" -mkdir -p "$JARO_SHARE" - -{ test $? = 0 } || { - print "No permissions to install system-wide."; return 1 } - -srcdir=. - -{ test -r ./src/fetchaddr } || { - print "Error: first build, then install."; return 1 } - -mkdir -p $JARO_SHARE/{.mutt,.stats} -cp -ra $srcdir/doc/* $JARO_SHARE/ -cp -ra $srcdir/src/mutt/* $JARO_SHARE/.mutt/ -cp -ra $srcdir/src/stats/* $JARO_SHARE/.stats/ - -# copy the executables -mkdir -p $JARO_LIBEXEC/{bin,zlibs} -cp $srcdir/src/jaro $JARO_LIBEXEC/bin -cp -ra $srcdir/build/win/* $JARO_LIBEXEC/bin -cp -ra $srcdir/src/zlibs/* $JARO_LIBEXEC/zlibs/ -cp -ra $srcdir/doc/jaromail-manual.pdf $JARO_LIBEXEC/ - -for l in `ls $JARO_LIBEXEC/zlibs/ | grep '.zwc$'`; do - rm -f $l -done - -for l in `ls $JARO_LIBEXEC/zlibs/ | grep -v '.zwc$'`; do - zcompile $JARO_LIBEXEC/zlibs/$l -done - -# fix pinentry w32 path -[[ -r /usr/bin/pinentry ]] || { - ln -s /usr/bin/pinentry-w32 /usr/bin/pinentry -} - -mkdir -p /usr/local/bin -rm -f /usr/local/bin/jaro -cat <<EOF > /usr/local/bin/jaro -#!/usr/bin/env zsh -export JAROWORKDIR=${JARO_LIBEXEC} -export JAROMAILDIR=${PREFIX} -${JARO_LIBEXEC}/bin/jaro \$* -EOF -chmod +x /usr/local/bin/jaro - -source ${JARO_LIBEXEC}/bin/jaro source - -jaro init - -notice "Jaro Mail succesfully installed in: $PREFIX" -act "Executable path: /usr/local/bin/jaro" - -return 0 diff --git a/build/release-osx.sh b/build/release-osx.sh @@ -1,193 +0,0 @@ -#!/usr/bin/env zsh -# -# small script to pack a JaroMail release for OSX -# by Jaromil @dyne.org - -{ test "$1" = "" } && { - echo "usage: $0 version" - return 1 } - -dir=JaroMail -ver="$1" - - - -out="`basename ${dir}`-${ver}.dmg" - -echo "Making ${dir} release v$ver" - -{ test -r ${dir} } || { mkdir ${dir} } - -{ test "$ver" = "" } && { - echo "error: version not specified" - return 0 } - -appdst=JaroMail.app -WORKDIR=${appdst}/Contents/Resources/jaro -bindst=${WORKDIR}/bin - -mkdir -p $WORKDIR/{bin,zlibs,.mutt,.stats} - -# copying inside the fresh scripts -print "Compiling Jaro Mail ZLibs" -{ test -d ${WORKDIR}/zlibs } && { rm -f $WORKDIR/zlibs/* } -cp ../src/zlibs/* $WORKDIR/zlibs/ -for z in `find $WORKDIR/zlibs -type f`; do - zcompile -R ${z} -done - - -cp -r ../src/mutt/* $WORKDIR/.mutt/ -cp -r ../src/stats/* $WORKDIR/.stats/ -cp ../doc/Applications.txt $WORKDIR/ -cp ../doc/Filters.txt $WORKDIR/ -cp ../doc/Identity.txt $WORKDIR/ -cp ../doc/Aliases.txt $WORKDIR/ -cp ../doc/jaromail-manual.pdf $WORKDIR/jaromail-manual.pdf -cp ../doc/JaroMail.icns $appdst/Contents/Resources -mkdir -p $WORKDIR/Accounts -cp -r ../doc/Accounts/* $WORKDIR/Accounts/ - - -print "Copying binaries and adjusting relocations" -mkdir -p $bindst -cp ../src/jaro $bindst -cp -v osx/* $bindst -mkdir -p $appdst/Contents/Frameworks/ -cp -v osx/dylib/* $appdst/Contents/Frameworks/ - - -# setting up the OSX app wrappers -mkdir -p $appdst/Contents/MacOS -cat <<EOF > $appdst/Contents/MacOS/jaroenv.sh -#!/usr/bin/env zsh -export PATH="/Applications/JaroMail.app/Contents/Resources/jaro/bin:\$PATH" -export GNUPGHOME="\$HOME/.gnupg" -export JAROMAILDIR="\$HOME/Library/Application Support/JaroMail" -export JAROWORKDIR="/Applications/JaroMail.app/Contents/Resources/jaro" -export TERMINFO="/usr/share/terminfo" -EOF - -cat <<EOF > $appdst/Contents/MacOS/jaroshell.sh -#!/usr/bin/env zsh -. /Applications/JaroMail.app/Contents/MaxOS/jaroenv.sh -pushd "\$JAROMAILDIR" -clear -print "Welcome to Jaro Mail" -print type 'jaro help' for a list of commands" -jaro init -EOF -chmod +x $appdst/Contents/MacOS/jaroshell.sh - -cat <<EOF > $appdst/Contents/MacOS/JaroMail.command -#!/usr/bin/env zsh -# JaroMail startup script for Mac .app -# Copyright (C) 2012-2014 by Denis Roio <Jaromil@dyne.org> -# GNU GPL V3 (see COPYING) -osascript <<EOF -tell application "Finder" - set _home to system attribute "HOME" - set maildirs to _home & "/Library/Application Support/JaroMail" - make new Finder window to POSIX file maildirs - activate -end tell -tell application "System Events" to set terminalOn to (exists process "Terminal") -if application "Terminal" is not running then - tell application "Terminal" to activate -end if -tell application "Terminal" - if (terminalOn) then - do script "source /Applications/JaroMail.app/Contents/MacOS/jaroshell.sh" - else - do script "source /Applications/JaroMail.app/Contents/MacOS/jaroshell.sh" in front window - set custom title of front window to "Jaro Mail" - end if -end tell -EOF -echo "EOF" >> $appdst/Contents/MacOS/JaroMail.command - -chmod +x $appdst/Contents/MacOS/JaroMail.command - -cat <<EOF > $appdst/Contents/PkgInfo -APPLJAROMAIL -EOF - -cat <<EOF > $appdst/Contents/Info.plist -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>JaroMail.command</string> - <key>CFBundleIconFile</key> - <string>JaroMail.icns</string> - <key>CFBundleIdentifier</key> - <string>org.dyne.jaromail</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>JAROMAIL</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>1.0</string> - <key>CSResourcesFileMapped</key> - <true/> -</dict> -</plist> -EOF - - - - -# creating the directory and populating it -mkdir -p ${dir} -{ test -r JaroMail.app/Contents } && { - echo "updating to latest app build" - rm -rf ${dir}/JaroMail.app - cp -r JaroMail.app ${dir}/ -} -echo "Source app: `du -hs ${dir}/JaroMail.app`" - -v=README; cp -v -f ../${v}.md ${dir}/${v}.txt - -v=COPYING; cp -v -f ../${v}.txt ${dir}/${v}.txt -v=ChangeLog; cp -v -f ../${v}.md ${dir}/${v}.txt -v=jaromail-manual.pdf; cp -v -f ../doc/${v} ${dir}/${v} -ln -sf /Applications ${dir}/Applications - -echo "Generating release: $out" -echo "Source dir: `du -hs $dir`" -echo "proceed? (y|n)" -read -q ok -echo -{ test "$ok" = y } || { - echo "operation aborted." - return 0 } - -rm -f ${out} -hdiutil create -fs HFS+ -volname "$dir $ver" -srcfolder \ - ${dir} "${out}" - -{ test $? = 0 } || { - echo "error creating image: ${out}" - return 0 } - -ls -lh ${out} - -hdiutil internet-enable -yes ${out} - -rm -f ${out}.sha -shasum ${out} > ${out}.sha - -echo "sign release? (y|n)" -read -q ok -echo -{ test "$ok" = y } || { - echo "done." - return 1 } -gpg -b -a ${out}.sha