#!/usr/bin/env bash
#-------------------------------------------------------------------------------
# Installing man pages in English and Japanese to following path
#   Englisth: /usr/local/man/man1
#   Japanese: /usr/local/man/ja/man1
#-------------------------------------------------------------------------------

# Choose Japanese encoding you like to install and remove the comment character.
manEnc=ja-euc
#manEnc=ja-sjis
#manEnc=ja-utf8

# Chage path name that man pages will be installed if nesessary.
manRoot=/usr/local/man

if [ ! -d "$manEnc" ] ; then
  echo '## invalid "manEnc" variable ##'
  exit
fi

# install
echo "cp -p ./$manEnc/*.1 $manRoot/ja/man1"
echo "cp -p ./en/*.1 $manRoot/man1"
mkdir -p $manRoot/man1
mkdir -p $manRoot/ja/man1
cp -p ./$manEnc/*.1 $manRoot/ja/man1
cp -p ./en/*.1 $manRoot/man1

# end message
echo "completed."

