applesystemfonts stable port information

Package: applesystemfonts
Version: 1.1
Revision: 3
BuildDepends: fink (>= 0.24.12)
Depends: xfontpath, x11, fondu
Type: nosource
NoSourceDirectory: true
PatchFile: %n.patch
PatchFile-MD5: 951b7b471098ab069181088cf7c73658
PatchScript: sed 's|@PREFIX@|%p|' < %{PatchFile} | patch -p1
CompileScript: <<
echo No compilation needed
echo
echo This package is created on the fly > dummy
echo at installation time. >> dummy
<<
InstallScript: mkdir -p %i/bin && install -m 755 fix-ttffont-filename.sh %i/bin
DocFiles: dummy
PostInstScript: <<
/usr/bin/install -d -m 755 `%p/bin/xfontpath basedir`/applettf
cd `%p/bin/xfontpath basedir`/applettf
/usr/bin/find /Library/Fonts /Network/Library/Fonts /System/Library/Fonts /Users/*/Library/Fonts -name \*.dfont -print | while read file
do
%p/bin/fondu -force "$file"
done
for file in "Arial" "Arial Black" "Arial Narrow" "Arial Rounded Bold" "Brush Script" \
"Comic Sans MS" "Courier New" "Georgia" "Inkpen2" "Opus" "Verdana" "Webdings"
do
[ ! -e /Library/Fonts/"$file" ] || %p/bin/fondu -force /Library/Fonts/"$file"
done
/usr/bin/find /Library/Fonts /Network/Library/Fonts /Users/*/Library/Fonts /System/Library/Fonts -name \*.ttf -print | while read FONTFILE
do
FONTNAME=`basename "$FONTFILE"`
rm -f "$FONTNAME"
ln -s "$FONTFILE" "${FONTNAME//\ /_}"
done
# remove some notoriously rotten fonts
rm -f GujaratiMT.ttf NISC18030.ttf .Keyboard.ttf .LastResort.ttf

# Rename Chinese TrueType Font files into Roman letters if exist.
%p/bin/fix-ttffont-filename.sh

echo "generating fonts.scale"
# work around a bug in Apple's X11's mkfontscale, it forgets to close files
ulimit -n 1000
/usr/X11R6/bin/mkfontscale
echo "generating fonts.dir"
/usr/X11R6/bin/mkfontdir
%p/bin/xfontpath --silent install applettf
echo "All done. You may need to restart X to get antialiased fonts"
echo "in some applications."
<<
PreRmScript: <<
rm -rf `%p/bin/xfontpath basedir`/applettf
%p/bin/xfontpath --silent remove applettf
<<
Description: Make Apple system fonts available to X11R6
DescDetail: <<
This package will extract the TrueType fonts from your
Apple System and Library directories and make them
available to X11R6.

Warning: Once installed, this package can get *VERY* large
depending on how many fonts you have in your system.
TrueType fonts will get symlinked, so they won't take much
space, but any dfont files in the /Library or
/System/Library directories will get converted to TrueType
and copied to your fink tree.
<<
DescPackaging: <<
This version doesn't package the fonts, it converts them
at installation time. There is no licensing question
with this approach.
Earlier versions by Benjamin Reed
<<
License: Public Domain
Maintainer: Martin Costabel

applesystemfonts stable port .patch

--- /dev/null 2011-01-19 23:49:59.000000000 +0900
+++ ./fix-ttffont-filename.sh 2011-01-17 21:01:58.000000000 +0900
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+tt_fonts_dir="`@PREFIX@/bin/xfontpath basedir`/applettf"
+
+evallines(){
+ while read line; do
+ eval $line
+ done
+}
+
+cd $tt_fonts_dir
+
+cat < +if [ -L 儷宋_Pro.ttf ]; then mv 儷宋_Pro.ttf LiSongPro.ttf ; fi
+if [ -L 儷黑_Pro.ttf ]; then mv 儷黑_Pro.ttf LiHeiPro.ttf ; fi
+if [ -L 华文仿宋.ttf ]; then mv 华文仿宋.ttf STFangsong.ttf; fi
+if [ -L 华文宋体.ttf ]; then mv 华文宋体.ttf STSong.ttf ; fi
+if [ -L 华文楷体.ttf ]; then mv 华文楷体.ttf STKaiti.ttf ; fi
+if [ -L 华文细黑.ttf ]; then mv 华文细黑.ttf STXihei.ttf ; fi
+if [ -L 华文黑体.ttf ]; then mv 华文黑体.ttf STHeiti.ttf ; fi
+EOF

applesystemfonts _unstable_ port .patch