3 # This script installs the Emerald CTAN package from
4 # https://www.ctan.org/tex-archive/fonts/emerald/
5 # into $TEXMFLOCAL, which is usually /usr/local/share/texmf
7 # This script will download emerald.zip if it's not already present.
8 # It must be run as root.
10 # Created by David Griffith <dave@661.org>
11 # Released into the public domain 2016
14 # 0 Script completed installation successfully.
16 # 1 Unable to find kpsewhich(1), maybe TeX isn't installed?
17 # 2 Unable to find unzip(1).
18 # 3 Script not run as root.
19 # 4 Unable to download package.
22 EMERALD_URL="http://mirrors.ctan.org/fonts/emerald.zip"
23 EMERALD_PKG=emerald.zip
28 TEXMFLOCAL=`kpsewhich -var-value TEXMFLOCAL`
30 echo "Emerald CTAN package installer..."
32 if [ ! $(command -v kpsewhich) ] ; then
33 echo " ** Cannot find kpsewhich! Is TeX really installed?"
37 if [ ! $(command -v unzip) ] ; then
38 echo " ** Cannot find unzip! Please install it and try again."
42 if [ `ps -o uid= $$` -ne 0 ] ; then
43 echo " ** This script must be run as root"
47 if [ -f $EMERALD_PKG ] ; then
48 echo "Found $EMERALD_PKG right here."
50 echo "Attempting download from $EMERALD_URL..."
51 if [ $(command -v curl) ] ; then
52 echo "Downloading $EMERALD_URL using curl."
53 command curl -L $EMERALD_URL -o $EMERALD_PKG
54 elif [ $(command -v wget) ] ; then
55 echo "Downloading $EMERALD_URL using wget."
56 command wget $EMERALD_URL -O $EMERALD_PKG
58 echo " ** Neither curl nor wget are present."
59 echo " ** Please download the emerald package manually,"
60 echo " ** put it in this directory, and try again."
65 echo "Unpacking $EMERALD_PKG..."
68 echo "Installing to $TEXMFLOCAL..."
69 echo "Making directories..."
70 install -m $DPERM -d $TEXMFLOCAL/fonts/afm/emerald \
71 $TEXMFLOCAL/fonts/map/dvips \
72 $TEXMFLOCAL/fonts/tfm/emerald \
73 $TEXMFLOCAL/fonts/type1/emerald \
74 $TEXMFLOCAL/fonts/vf/emerald
76 install -m $DPERM -d $TEXMFLOCAL/other $TEXMFLOCAL/tex/latex/emerald
77 install -m $DPERM -d $TEXMFLOCAL $TEXMFLOCAL/web2c
79 echo "Installing stuff..."
80 install -m $PERM -D $PKGDIR/fonts/afm/emerald/* $TEXMFLOCAL/fonts/afm/emerald
81 install -m $PERM -D $PKGDIR/fonts/map/dvips/emerald.map $TEXMFLOCAL/fonts/map/dvips
82 install -m $PERM -D $PKGDIR/fonts/tfm/emerald/* $TEXMFLOCAL/fonts/tfm/emerald
83 install -m $PERM -D $PKGDIR/fonts/type1/emerald/* $TEXMFLOCAL/fonts/type1/emerald
84 install -m $PERM -D $PKGDIR/fonts/vf/emerald/* $TEXMFLOCAL/fonts/vf/emerald
85 install -m $PERM -D $PKGDIR/other/* $TEXMFLOCAL/other
86 install -m $PERM -D $PKGDIR/tex/latex/emerald/* $TEXMFLOCAL/tex/latex/emerald
88 echo "Map emerald.map" >> $TEXMFLOCAL/web2c/updmap.cfg