## ## Slackware build script for Microsoft's corefonts 1.0 ## Copyright (c) 2008 by Michal Nazarewicz (mina86/AT/tlen.pl) ## Licensed under the Academic Free License version 3.0 ## ## Based on msttcorefonts-2.0-1.spec ## available from http://corefonts.sourceforge.net/ ## ## ## Usage: ## ## corefonts.SlackBuild ## Downloads files from random mirror and builds package. ## corefonts.SlackBuild skip-download ## Skips downloading files (but still checks ## their integrity) and builds package. ## corefonts.SlackBuild ## Downloads files from ## http://.dl.sourceforge.net/sourceforge/corefonts ## and builts package. ## corefonts.SlackBuild ## Downloads files from and builts package. ## PKG_NAME=corefonts PKG_VERSION=1.0 PKG_BUILD=${BUILD-1} if [ -z "$TMP" ]; then TMP=/tmp fi PKG_DIR=$TMP/$PKG_NAME-$PKG_VERSION-noarch-$PKG_BUILD PKG_FILE=$PKG_DIR.tgz DL_DIR=$TMP/$PKG_NAME-$PKG_VERSION-DOWNLOAD-DATA set -e ## Check required tools if ! which md5sum >/dev/null 2>&1; then echo This script requires md5sum to be installed. >&2 exit 1 fi if ! which wget >/dev/null 2>&1 && ! which curl >/dev/null 2>&1; then echo This script requires either wget or curl to be installed. >&2 exit 1 fi if [ x"$1" = xskip-download ]; then cd "$DL_DIR" else ## Choose mirror if [ $# -eq 0 ]; then set -- easynews heanet superb-west internap switch ufpr \ surfnet umn kent mesh superb-east jaist fi if [ $# -ne 1 ]; then mirror=$(( $(printf %d\\n 0x$(head -c 4 /dev/urandom | md5sum | cut -c1-4)) % $# )) shift $mirror fi case "$1" in *://*) mirror=$1 ;; *) mirror="http://$1.dl.sourceforge.net/sourceforge/corefonts" esac echo echo "Downloading files from $mirror..." echo "Downloaded files will be left in $DL_DIR" echo ## Prepare URLs list set -- for file in andale32.exe arial32.exe arialb32.exe comic32.exe \ courie32.exe georgi32.exe impact32.exe times32.exe trebuc32.exe \ webdin32.exe verdan32.exe wd97vwr32.exe; do set -- "$@" "$mirror/$file" done ## Download files mkdir -p "$DL_DIR" cd "$DL_DIR" if which wget >/dev/null 2>&1; then wget -c -- "$@" else curl -O -C - -- "$@" fi fi ## Check files echo 'Verifying integrity...' cat <install/slack-desc corefonts: corefonts (Microsoft's TrueType fonts) corefonts: corefonts: The TrueType core fonts for the web that was once available from corefonts: Microsoft's web page. They are commonly used on the Web and thus corefonts: having them may help viewing web pages. corefonts: corefonts: Note, that it is not legal to redistribute this package. Instead one corefonts: should redistribute SlackBuild script used to generate it. The corefonts: SlackBuild script is based on RPM SRC package provided at corefonts: http://corefonts.sourceforge.net/. EOF cat <install/doinst.sh if [ -x /usr/bin/mkfontdir ] || [ -x /usr/X11R6/bin/mkfontdir ]; then cd /usr/share/fonts/TTF mkfontscale . mkfontdir -e /usr/share/fonts/encodings -e /usr/share/fonts/encodings/large . fi if [ -x /usr/bin/fc-cache ]; then /usr/bin/fc-cache -f fi EOF chmod 755 install/doinst.sh ## And finally create package echo echo Creating package echo /sbin/makepkg -l y -c n "$PKG_FILE" ## And we're done cat <