set -eu camellia_path_check VERSION=dash-0.5.12 fetch() { wget -nc https://gondor.apana.org.au/~herbert/dash/files/dash-0.5.12.tar.gz echo "6a474ac46e8b0b32916c4c60df694c82058d3297d8b385b74508030ca4a8f28a dash-0.5.12.tar.gz" | sha256sum --check tar xf ${VERSION}.tar.gz } prep() { [ -d ${VERSION} ] || (fetch) cd ${VERSION} [ -e Makefile ] || ./configure CC=x86_64-camellia-gcc "CFLAGS=-Wno-error=format -Wno-error=unused-but-set-variable" --prefix"=$PREFIX" --host=x86_64-camellia } case $1 in install) (prep; make; make install) ;; clean) (prep; make clean) ;; *) echo "usage: $0 install|clean"; false ;; esac