Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 99 lines (78 sloc) 3.78 KB
version=$(cat version)
make clean build || exit $?
# --------------------------------------------------
echo "Copy Files"
rm -rf pkgroot
mkdir -p pkgroot
mkdir -p "pkgroot/$basedir"
cp -R src/core/kext/build/Release/KeyRemap4MacBook.kext "pkgroot/$basedir"
cp -R files/scripts "pkgroot/$basedir"
mkdir -p "pkgroot/$basedir/extra"
cp -R pkginfo/Resources/preflight "pkgroot/$basedir/extra/"
cp -R files/extra/ "pkgroot/$basedir/extra/"
cp -R files/extra/ "pkgroot/$basedir/extra/"
cp -R files/extra/ "pkgroot/$basedir/extra/"
mkdir -p "pkgroot/Library"
cp -R files/LaunchDaemons "pkgroot/Library"
cp -R files/LaunchAgents "pkgroot/Library"
mkdir -p "pkgroot/$basedir/bin"
cp -R "src/bin/dump_xml_compiler_result/build/Release/dump_xml_compiler_result" "pkgroot/$basedir/bin"
mkdir -p "pkgroot/$basedir/app"
cp -R "src/core/server/build/Release/" "pkgroot/$basedir/app"
cp -R "src/util/EventViewer/build/Release/" "pkgroot/$basedir/app"
cp -R "src/util/multitouchextension/build/Release/" "pkgroot/$basedir/app"
cp -R "src/util/cli/build/Release/" "pkgroot/$basedir/app"
cp -R "src/util/uninstaller/automator/" "pkgroot/$basedir/app"
mkdir -p "pkgroot/Library/PreferencePanes"
cp -R "src/util/prefpane/build/Release/KeyRemap4MacBook.prefPane" "pkgroot/Library/PreferencePanes"
# Setting file permissions.
# Note:
# If target files are already exists in system disk,
# PackageMaker uses their permissions.
# For example:
# If /Library/org.pqrs permission is 0777 by accidental reasons,
# the directory permission will be 0777 in
# even if we set this directory permission to 0755 by
# Then, we need to repair file permissions in postflight script.
# Please also see postflight.
sh "files/extra/" pkgroot
# --------------------------------------------------
echo "Exec PackageMaker"
rm -rf $archiveName/$pkgName
mkdir $archiveName
# Note: Don't add --no-recommend option.
# It might break /Library permission.
# (It overwrites /Library permission with pkgroot/Library permission.)
# - Mac OS X 10.6: /Library is 1775
# - Mac OS X 10.7: /Library is 0755
# - Mac OS X 10.8: /Library is 40755
$packagemaker \
--root pkgroot \
--info pkginfo/Info.plist \
--resources pkginfo/Resources \
--title "KeyRemap4MacBook $version" \
--no-relocate \
--discard-forks \
--out $archiveName/$pkgName
# --------------------------------------------------
echo "Fix"
ruby pkginfo/fixbom.rb $archiveName/$pkgName/Contents/ pkgroot/
# --------------------------------------------------
echo "Make Archive"
# Note:
# Some third vendor archiver fails to extract zip archive.
# Therefore, we use dmg instead of zip.
rm -f $archiveName.dmg
hdiutil create -nospotlight $archiveName.dmg -srcfolder $archiveName
rm -rf $archiveName
chmod 644 $archiveName.dmg
Jump to Line
Something went wrong with that request. Please try again.