X-Git-Url: http://git.onelab.eu/?p=sface.git;a=blobdiff_plain;f=macos%2Fbuild-dmg.sh;h=07cf8011b071e556994d1fab6c02d04e6fc43508;hp=836e0624c5d0dd493b329deccd1262fdf7e11774;hb=dbbfa474c21a64527aa0f3e4c0af911737783d76;hpb=69d71c0f183588cfce274a6853de0819a92412f9 diff --git a/macos/build-dmg.sh b/macos/build-dmg.sh index 836e062..07cf801 100755 --- a/macos/build-dmg.sh +++ b/macos/build-dmg.sh @@ -1,10 +1,8 @@ #!/bin/sh # PURPOSE -# package a combination of sfa+sface into a snow leopard dmg install disk -# -# NOTES -# we leverage the first similar packaging initially made by Baris Metin +# package a combination of sfa+sface into a dmg install disk +# supports leopard and snow leopard # # REQUIREMENTS # sface-skel-snow-leopard.dmg is the skeleton that has Qt and all the other third-party software @@ -14,6 +12,25 @@ # the script expects the taglevels for both sfa and sface, # in order to retrieve the corresponding code and to label the resulting package properly # alternatively, a build-dir and tags file can be used instead +# Should have the folowing tools installed +# git: to retrieve code +# rpm: to retrieve the version numbers in specfiles + +# NOTES +# we initially leveraged the first similar packaging initially made by Baris Metin +# as of sface-0.1-9 we have bootstrapped our own skeleton images, +# i.e. you can use vn as a skeleton for vn+1 +# about that, the way the background image gets (or not) found +# on the final system is as follows +# before compressing the image, you should open the image through the finder +# and tweak it, as described in http://el-tramo.be/guides/fancy-dmg +# that's the raison d'ĂȘtre for the -i option +# basically: open two finder windows, one on the .backgrounf dir (use cmd-shift G) +# and one on the image itself; then using Finder->view->show view options +# drag the background image as appropriate +# the important point being that the filename for the background must +# exist - and so be the same - on the target system. +# that's why the image 'volname' is constant across versions # the place to search for the skeleton SKEL_REPO=http://mirror.onelab.eu/third-party @@ -133,6 +150,9 @@ Also make sure to trash the current one before retrying" if [ "$skelapp" != "$app" ] ; then mv "$img_mnt/$skelapp" "$img_mnt/$app" fi + # unmount the skeleton + hdiutil unmount "$skel_mnt" + # resource_path=$app/Contents/Resources bin_path=$app/Contents/MacOS @@ -140,7 +160,15 @@ Also make sure to trash the current one before retrying" # retrieve sfa/sfa and sface/sface in the image rm -rf "$img_mnt"/$resource_path/{sfa,sface} git_retrieve $sfa_GITPATH sfa "$img_mnt"/$resource_path/ + # retrieve version number from specfile + sfa_tag=$(rpm -q --specfile "$img_mnt"/$resource_path/sfa/sfa.spec --qf '%{version}-%{taglevel}') + make -C "$img_mnt"/$resource_path/sfa VERSIONTAG="${sfa_tag}" SCMURL="${sfa_GITPATH}" version + git_retrieve $sface_GITPATH sface "$img_mnt"/$resource_path/ + # retrieve version number from specfile + sface_tag=$(rpm -q --specfile "$img_mnt"/$resource_path/sface/sface.spec --qf '%{version}-%{taglevel}') + make -C "$img_mnt"/$resource_path/sface VERSIONTAG="${sface_tag}" SCMURL="${sface_GITPATH}" version + # copy binaries from sface to the bin dir for bin in sface.bin sface-run; do # don't use the --file mode as this loses the executable bit @@ -169,17 +197,12 @@ Also make sure to trash the current one before retrying" read _ fi - # this apparently requires xcode -# /Developer/Tools/SetFile -a V "$img_mnt"/$background_path - hdiutil detach "$img_mnt" rm -f $img_dmg echo "Compressing..." hdiutil convert -quiet -format UDZO -imagekey zlib-level=9 -o $img_dmg $img_raw_dmg # clean up the raw image rm -f $img_raw_dmg - # unmount the skeleton - hdiutil unmount "$skel_mnt" echo "==================================================" echo "Install image ready in $img_dmg"