3 # smarc was written by Omar Polo <op@openbsd.org> and is placed in the
4 # public domain. The author hereby disclaims copyright to this source
7 progname="$(basename "$0")"
9 u="usage: $progname [-c cachedir] [-j n]"
10 u="$u [-m maildir] [-o outdir] [-t tmpldir]"
15 # changed at install-time
20 # fix perl include path for in-repo hacking
21 if [ "$libexec" = . ]; then
22 export PERL5LIB="$PWD${PERL5LIB:+:}$PERL5LIB"
25 cachedir=$HOME/.cache/smarc
29 while getopts c:j:m:o:t: flag; do
31 c) cachedir="$OPTARG" ;;
32 j) MAKE_JOBS="$OPTARG" ;;
34 o) outdir="$OPTARG" ;;
35 t) tmpldir="$OPTARG" ;;
41 export CSUMDIR="$cachedir/threadsum"
42 export MAKE_JOBS="${MAKE_JOBS:-1}"
43 export MBLAZE="$mblaze"
44 export MBLAZE_PAGER=cat
46 export OUTDIR="${outdir:-/var/www/smarc}"
47 export TMPLDIR="$tmpldir"
50 # make sure the directories are there
53 mkdir -p "$OUTDIR/mail"
54 mkdir -p "$OUTDIR/parts"
55 mkdir -p "$OUTDIR/text"
56 mkdir -p "$OUTDIR/thread"
59 export PATH="$libexec:$PATH"
61 fmt='%i-%R %16D<%64f>%128S'
62 mlist "${MDIR}" | mthread -r | mscan -f "$fmt" | pe | mkindex