#!/bin/bash case "@HOST@" in *-apple-darwin*) #Add FontForge to the X11 applications menu, so that mac users don't have # to deal with xterms or messing around with paths #Mac OS/X 10.1 did not have plutil (it didn't have X11 either) if test -d ~/Library/Preferences -a -e /usr/bin/plutil ; then if test \! -e ~/Library/Preferences/com.apple.x11.plist ; then cat <~/Library/Preferences/com.apple.x11.plist apps_menu Terminal xterm n FontForge @prefix@/bin/fontforge f EOF plutil -convert binary1 ~/Library/Preferences/com.apple.x11.plist elif grep -q fontforge ~/Library/Preferences/com.apple.x11.plist ; then cat /dev/null # It's already in the menu, no need to add it else if grep -q "xml version=" ~/Library/Preferences/com.apple.x11.plist ; then # It's already in xml format cp ~/Library/Preferences/com.apple.x11.plist /tmp/x11.xml else plutil -convert xml1 -o /tmp/x11.xml ~/Library/Preferences/com.apple.x11.plist fi if grep -q apps_menu ~/Library/Preferences/com.apple.x11.plist ; then cat >/tmp/fontforge-sed-script <\\ FontForge\\ @prefix@/bin/fontforge\\ f\\ } EOF else cat >/tmp/fontforge-sed-script <apps_menu\\ \\ \\ Terminal\\ xterm\\ n\\ \\ \\ FontForge\\ @prefix@/bin/fontforge\\ f\\ \\ EOF fi sed -f /tmp/fontforge-sed-script /tmp/x11.xml >/tmp/x11_1.xml plutil -convert binary1 -o ~/Library/Preferences/com.apple.x11.plist /tmp/x11_1.xml rm -f /tmp/x11_1.xml /tmp/fontforge-sed-script /tmp/x11.xml fi fi ;; esac