---
name: ja-mikachan-ttfonts
version: 9.1
origin: japanese/mikachan-ttfonts
comment: Handwritten Japanese TrueType fonts by Mika-chan
arch: freebsd:9:x86:64
www: http://mikachan-font.com/
maintainer: turutani@scphys.kyoto-u.ac.jp
prefix: /usr/local
licenselogic: single
flatsize: 2857404
desc: |
  Mika-chan wrote a full set of Japanese fonts by hand, scanned,
  then translated it to a TrueTypeFont package.

  WWW: http://mikachan-font.com/
categories: [x11-fonts, japanese]
files:
  /usr/local/lib/X11/fonts/TrueType/fonts.dir.mika: 0b8275e399b67736c9db863174d48212aff537a4d9777ec3d56b149a05007ea6
  /usr/local/lib/X11/fonts/TrueType/mika.ttf: d466733b3ca08158f535a0ea1b9b5b5310005d30644a39ce4fad9cef97d5f0c8
scripts:
  install: |
    #!/bin/sh
    FONTDIR=${PKG_PREFIX}/lib/X11/fonts/TrueType
    if [ "$2" = "PRE-INSTALL" ]; then
      if [ ! -d ${FONTDIR} ]; then
        echo "*********************************************************"
        echo "Please add ${FONTDIR} to your font path"
        echo "and load 'xtt' module in /etc/XF86Config."
        echo "*********************************************************"
        mkdir $FONTDIR
      fi
      exit 0
    fi
    cd ${FONTDIR}
    touch fonts.dir
    sed -e '/-mikachan-/d' fonts.dir > fonts.dir.tmp
    numfonts=$(echo $(cat fonts.dir.tmp fonts.dir.mika | wc -l) - 2 | bc)
    echo ${numfonts} > fonts.dir
    sed -e 1d fonts.dir.tmp >> fonts.dir
    sed -e 1d fonts.dir.mika >> fonts.dir
    rm -f fonts.dir.tmp fonts.alias.tmp
  deinstall: |
    #!/bin/sh
    if [ "$2" != "DEINSTALL" ]; then
      exit 0
    fi
    FONTDIR=${PKG_PREFIX}/lib/X11/fonts/TrueType
    cd ${FONTDIR}
    sed -e '/-mikachan-/d' fonts.dir > fonts.dir.tmp
    numfonts=$(echo $(cat fonts.dir.tmp | wc -l) - 1 | bc)
    echo ${numfonts} > fonts.dir
    sed -e 1d fonts.dir.tmp >> fonts.dir
    rm -f fonts.dir.tmp
