commit - 3baace3abe2d2718bdd5cebc5da4edf5a25b5f39
commit + 39f537acbd8fdf4e812ad004aa880526a36af1f7
blob - c6d98d05be00e5d6a19e725c37a14e6f92b304df
blob + 6a924576f2109adf453c165eda2e23b9e673ea5d
--- Makefile
+++ Makefile
-MDIR = ${HOME}/Mail/gameoftrees
OUTDIR = /var/www/marc
-CSUMDIR = ${HOME}/.cache/gotmarc/threadsum
-.PHONY: all assets images dirs gzip clean scaleimgs
+.PHONY: all images dirs gzip scaleimgs
-all: assets
- @env MDIR="${MDIR}" OUTDIR="${OUTDIR}" CSUMDIR="${CSUMDIR}" ./gotmarc
+all: dirs images ${OUTDIR}/style.css
-assets: dirs images ${OUTDIR}/style.css
-
images: ${OUTDIR}/got@2x.png ${OUTDIR}/got.png ${OUTDIR}/got-tiny@2x.png \
${OUTDIR}/got-tiny.png
cp $? $@
dirs:
- @mkdir -p ${CSUMDIR}
@mkdir -p ${OUTDIR}/mail/
@mkdir -p ${OUTDIR}/parts/
@mkdir -p ${OUTDIR}/text/
gzip:
gzip -fkr ${OUTDIR}
-clean:
- rm -rf ${OUTDIR}
-
-# -- maintainer targets --
-
scaleimgs:
convert images/got.orig.png -resize 200x200 images/got.png
convert images/got.orig.png -resize 128x128 images/got-tiny@2x.png
blob - 156d1af40f321e8496e0f17d0f101e9bd5c19bd3
blob + f3b3ba889c12c18a79f378037d2eaa1975a08a2b
--- gotmarc
+++ gotmarc
#!/bin/sh
+progname="$(basename "$0")"
+usage() {
+ echo "usage: $progname [-c csumdir] [-j n] [-m maildir] [-o outdir]" >&2
+ exit 1
+}
+
+libexec=.
+mblaze=.mblaze
+
+csumdir=$HOME/.cache/gotmarc/threadsum
+mdir=$HOME/Mail/gameoftrees
+outdir=/var/www/marc
+
+while getopts c:j:m:o: flag; do
+ case $flag in
+ c) csumdir="$OPTARG" ;;
+ j) MAKE_JOBS="$OPTARG" ;;
+ m) mdir="$OPTARG" ;;
+ o) outdir="$OPTARG" ;;
+ ?) usage ;;
+ esac
+done
+
# set up the env
+export CSUMDIR="$csumdir"
export MAKE_JOBS="${MAKE_JOBS:-1}"
-export MBLAZE=.mblaze
+export MBLAZE="$mblaze"
export MBLAZE_PAGER=cat
+export MDIR="$mdir"
export OUTDIR="${OUTDIR:-/var/www/marc}"
-: ${MDIR:?not defined}
-: ${CSUMDIR:?not defined}
+# make sure the directories are there
+set -e
+mkdir -p "$csumdir"
+mkdir -p "$outdir/mail"
+mkdir -p "$outdir/parts"
+mkdir -p "$outdir/text"
+mkdir -p "$outdir/thread"
+set +e
+export PATH="$libexec:$PATH"
+
fmt='%i-%R %16D<%64f>%128S'
-mlist "${MDIR}" | mthread -r | mscan -f "$fmt" | ./pe | ./mkindex
+mlist "${MDIR}" | mthread -r | mscan -f "$fmt" | pe | mkindex