#! /bin/sh if [ "x${1}" = "x--help" ] || [ "x${1}" = "x-h" ] ; then cat - << __EOF__ ./configure [options] Options: --help | -h Variables: WITH_ZSH [default '/bin/zsh'] WITH_ETC [default '/usr/local/etc/zblog'] WITH_SED [default 'sed'] WITH_DATE [default 'date'] Example: % WITH_ZSH='/usr/local/bin/zsh-4.2.6' \\ WITH_ETC='/etc/zblog' ./configure __EOF__ exit 0 fi com_zsh=${WITH_ZSH:-/bin/zsh} dir_etc=${WITH_ETC:-/usr/local/etc/zblog} com_sed=${WITH_SED:-sed} com_date=${WITH_DATE:-date} printf "checking for %s (%s)... " zsh ${com_zsh} if [ ! -x $(which ${com_zsh}) ] ; then printf "*NOT_FOUND*\n" exit 1 fi printf "okay.\n" printf "checking for %s (%s)... " etczblog ${dir_etc} if [ ! -d ${dir_etc} ] ; then printf "*NOT_FOUND*\n" printf " 'make install' will *not* install an example rc.\n" rm -f .install_rc else printf "okay.\n" touch .install_rc fi printf "checking for %s (%s)... " sed ${com_sed} if [ ! -x $(which ${com_set}) ] ; then printf "*NOT_FOUND*\n" exit 1 fi printf "okay.\n" printf "checking for %s (%s)... " date ${com_date} if [ ! -x $(which ${com_date}) ] ; then printf "*NOT_FOUND*\n" exit 1 fi printf "okay.\n" ### All okay, create zblog ### printf "\nCreating files:\n\tzblog\n" hook_list=$(./bin/genhooks.sh -s | sort) LC_ALL=C ${com_sed} "s,@@ZSH@@,${com_zsh},;s,@@ETC_ZBLOG@@,${dir_etc},;s,@@HOOK_LIST@@,${hook_list}," < ./zblog.in > zblog chmod 0755 zblog for configure in */configure do cd ${configure%/*} LC_ALL=C . ./configure cd .. done