BIN_DIR="$2"
VOLUME_NAME="$3"
+REL_DMG="${DMG_NAME}.dmg"
+
ORG_DIR="$PWD"
-EXTRA_SIZE=4096
+EXTRA_SIZE=2048
# ****************************** usage ********************************
DST_IMG="$1"
if test -e "${DST_IMG}"; then
- echo " deleting old dmg ..."
+ echo -n " deleting old dmg .."
rm "${DST_IMG}"
+ echo ".. ok."
fi
hdiutil create -size ${SIZE_KB}k ${DST_IMG} -layout NONE
function convertToReadOnlyCompressedImage() {
SRC_DMG="$1"
DST_DMG="$2"
+
+ if test -e "${DST_DMG}"; then
+ echo -n " deleting old release dmg .."
+ rm "${DST_DMG}"
+ echo ".. ok."
+ fi
+
+ #echo -n " converting ${SRC_DMG} to readonly/zip ${DST_DMG} .."
+
# convert .dmg into read-only zlib (-9) compressed release version
- hdiutil convert -format UDZO ${SRC_DMG} -o ${DST_DMG} -imagekey zlib-level=9
+ hdiutil convert -format UDZO "${SRC_DMG}" \
+ -o ${DST_DMG} -imagekey zlib-level=9
+ #echo ".. done."
}
function internetEnableDiskImage() {
calcSize;
echo " size: ${SIZE_KB}K"
+echo ""
setupDisk "${DMG_NAME}-build-$$.dmg"
+echo ""
echo -n " coping content to disk .."
cd $BIN_DIR
gnutar cf - . | ( cd "/Volumes/${VOLUME_NAME}" ; gnutar xf - )
cd $ORG_DIR
echo ".. done."
+echo ""
# once again eject, to synchronize
ejectDisk;
+echo ""
-REL_DMG="${DMG_NAME}.dmg"
convertToReadOnlyCompressedImage "${DMG_NAME}-build-$$.dmg" "${REL_DMG}"
+echo ""
internetEnableDiskImage "${REL_DMG}"
+echo ""
# delete src image
+echo -n " deleting temporary build dmg .."
rm -f "${DMG_NAME}-build-$$.dmg"
+echo ".. ok."
+
+echo "built dmg:"
+ls -la "${REL_DMG}"
echo >>$F "Version ${PKG_VERSION}"
echo >>$F "Description ${PKG_VERSION}"
- echo >>$F "PackageLocation ../"
+ # TODO: find documentation for this one
+ # echo >>$F "PackageLocation ../Packages"
echo >>$F "FastInstall NO"
echo >>$F "Require Reboot NO" # TODO: consolidate
#echo >>$F "Install Fat YES" # TODO: consolidate
echo >>$F "LibrarySubdirectory Standard"
-
- ln -s ${PKG_RSRC_DIR}/English.lproj/${PKG_NAME}.info \
- ${PKG_RSRC_DIR}/English.lproj/Install.info
+
+ GIOLDDIR="$PWD"
+ cd "${PKG_RSRC_DIR}/English.lproj/"
+ ln -s "${PKG_NAME}.info" Install.info
+ cd "$GIOLDDIR"
echo ".. done."
}