#!/bin/sh
#
# Copyright 2004 Dagmar d'Surreal <rivyqntzne@tznvy.pbz>
# Available under the terms of the GNU GPL.
#

NAME="webfonts"
VERSION="1.0"
REVISION="5"
PKG_TARNAME="webfonts"
PKG_ARCH=noarch

PKG_SOURCEURL[0]='http://easynews.dl.sourceforge.net/sourceforge/corefonts/andale32.exe'
PKG_SOURCEMD5[0]="cbdc2fdd7d2ed0832795e86a8b9ee19a"

PKG_SOURCEURL[1]='http://easynews.dl.sourceforge.net/sourceforge/corefonts/webdin32.exe'
PKG_SOURCEMD5[1]="230a1d13a365b22815f502eb24d9149b"

PKG_SOURCEURL[2]='http://easynews.dl.sourceforge.net/sourceforge/corefonts/trebuc32.exe'
PKG_SOURCEMD5[2]="0d7ea16cac6261f8513a061fbfcdb2b5"

PKG_SOURCEURL[3]='http://easynews.dl.sourceforge.net/sourceforge/corefonts/georgi32.exe'
PKG_SOURCEMD5[3]="4d90016026e2da447593b41a8d8fa8bd"

PKG_SOURCEURL[4]='http://easynews.dl.sourceforge.net/sourceforge/corefonts/verdan32.exe'
PKG_SOURCEMD5[4]="12d2a75f8156e10607be1eaa8e8ef120"

PKG_SOURCEURL[5]='http://easynews.dl.sourceforge.net/sourceforge/corefonts/comic32.exe'
PKG_SOURCEMD5[5]="2b30de40bb5e803a0452c7715fc835d1"

PKG_SOURCEURL[6]='http://easynews.dl.sourceforge.net/sourceforge/corefonts/arialb32.exe'
PKG_SOURCEMD5[6]="c9089ae0c3b3d0d8c4b0a95979bb9ff0"

PKG_SOURCEURL[7]='http://easynews.dl.sourceforge.net/sourceforge/corefonts/impact32.exe'
PKG_SOURCEMD5[7]="7907c7dd6684e9bade91cff82683d9d7"

PKG_SOURCEURL[8]='http://easynews.dl.sourceforge.net/sourceforge/corefonts/arial32.exe'
PKG_SOURCEMD5[8]="9637df0e91703179f0723ec095a36cb5"

PKG_SOURCEURL[9]='http://easynews.dl.sourceforge.net/sourceforge/corefonts/times32.exe'
PKG_SOURCEMD5[9]="ed39c8ef91b9fb80f76f702568291bd5"

PKG_SOURCEURL[10]='http://easynews.dl.sourceforge.net/sourceforge/corefonts/courie32.exe'
PKG_SOURCEMD5[10]="4e412c772294403ab62fb2d247d85c60"

. $DLG_ROOT/config
. $DLG_ROOT/SCRIPTS/dropline-functions.sh

preparescratchspace
createdir $PKG_STAGEROOT$PKG_PREFIX/X11R6/lib/X11/fonts/TTF/

# Get/download all the files.
for sourcefile in 0 1 2 3 4 5 6 7 8 9 10; do
  obtainfile tmp ${PKG_SOURCEURL[$sourcefile]} ${PKG_SOURCEMD5[$sourcefile]}
  location[$sourcefile]=$tmp
done

for sourcefile in 0 1 2 3 4 5 6 7 8 9 10; do
  spewdo "cp ${location[$sourcefile]} $PKG_STAGEROOT$PKG_PREFIX/X11R6/lib/X11/fonts/TTF/"
done

for sourcefile in 0 1 2 3 4 5 6 7 8 9 10; do
  spewdo "cabextract -q -L -F *.ttf -d $PKG_STAGEROOT$PKG_PREFIX/X11R6/lib/X11/fonts/TTF/ ${location[$sourcefile]}"
  spewdo "cabextract -q -L -F *.txt -d $PKG_STAGEROOT$PKG_PREFIX/X11R6/lib/X11/fonts/TTF/ ${location[$sourcefile]}"
done

for filename in `find $PKG_STAGEROOT$PKG_PREFIX/X11R6/lib/X11/fonts/TTF/ -name *.ttf`; do
  spewdo "echo -n '' > $filename"
done

tidydocumentation
analyzebinaries
finalizepackage
packagize
cleanup
