fix the message for uploading results to the new location with sface-macos
[sface.git] / macos / build-dmg.sh
index 4991570..3e813d9 100755 (executable)
@@ -12,7 +12,7 @@
 # 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
+# Should have the following tools installed
 #   git: to retrieve code
 #   rpm: to retrieve the version numbers in specfiles
 
@@ -156,15 +156,23 @@ Also make sure to trash the current one before retrying"
 
     # retrieve version number, and run make version
     sfa_spec=$temp/sfa/sfa.spec
-    sfa_tag=$(rpm -q --specfile $sfa_spec --qf '%{version}-%{taglevel}')
+    # use newlines and keep only the first line, for multiple packages
+    sfa_version=$(rpm -q --specfile $sfa_spec --qf '%{version}\n' | head -1)
+    # cannot extract taglevel, issues lots of 'error: incorrect format: unknown tag'
+    # turns out release is the same in our case as we haven't computed header.spec
+    sfa_release=$(rpm -q --specfile $sfa_spec --qf '%{release}\n' | head -1 | cut -d. -f1)
+    sfa_tag=${sfa_version}-${sfa_release}
     make -C $temp/sfa VERSIONTAG="${sfa_tag}" SCMURL="${sfa_GITPATH}" version
+
     sface_spec=$temp/sface/sface.spec
-    sface_tag=$(rpm -q --specfile $sface_spec --qf '%{version}-%{taglevel}')
+    sface_version=$(rpm -q --specfile $sface_spec --qf '%{version}\n' | head -1)
+    sface_release=$(rpm -q --specfile $sface_spec --qf '%{release}\n' | head -1 | cut -d. -f1)
+    sface_tag=${sface_version}-${sface_release}
     make -C $temp/sface VERSIONTAG="${sface_tag}" SCMURL="${sface_GITPATH}" version
 
     # copy sfa/ and sface/ subdirs in image
-    rm -rf "$img_mnt"/$resource_path/{sfa,sface}
-    tar -C $temp/sfa -cf - sfa | tar -C "$img_mnt"/$resource_path/ -xf -
+    rm -rf "$img_mnt"/$resource_path/{sfa,clientbin,sface}
+    tar -C $temp/sfa -cf - sfa clientbin | tar -C "$img_mnt"/$resource_path/ -xf -
     tar -C $temp/sface -cf - sface | tar -C "$img_mnt"/$resource_path/ -xf -
 
     # copy binaries from sface to the bin dir
@@ -175,16 +183,15 @@ Also make sure to trash the current one before retrying"
     ### install background and app icons
     # clean up any 'background' dir if exists
     rm -rf "$img_mnt"/{,.}background 
+    mkdir -p "$img_mnt"/.background "$img_mnt"/$resource_path/sface/images
     cp $temp/sface/macos/graphic-install-background.png "$img_mnt"/.background/background.png
     cp $temp/sface/macos/graphic-sfa.icns "$img_mnt"/$resource_path/appIcon.icns
+    cp $temp/sface/macos/graphic-sfa.png "$img_mnt"/$resource_path/sface/images
+    cp $temp/sface/macos/graphic-sfa64.png "$img_mnt"/$resource_path/sface/images
     # the volume icons won't work - who cares
 #    cp $temp/sface/macos/graphic-vol-sface.icns "$img_mnt"/.background/volumeIcon.icns
 #    cp $temp/sface/macos/graphic-vol-sface.png "$img_mnt"/.background/volumeIcon.png
 
-    # instantiate version
-    sed -e "s,@VERSIONTAG@,$sfa_release,g" -e "s,@SCMURL@,${sfa_GITPATH},g" \
-       "$img_mnt"/$resource_path/sfa/util/version.py.in > "$img_mnt"/$resource_path/sfa/util/version.py
-
     # clean up just in case
     find "$img_mnt" -name '*pyc' | xargs rm -f
     find "$img_mnt" -name '*~' | xargs rm -f
@@ -206,7 +213,7 @@ Also make sure to trash the current one before retrying"
     echo "=================================================="
     echo "Install image ready in $img_dmg"
     echo "You may publish it by running e.g."
-    echo "rsync -av $img_dmg root@build.onelab.eu:/build/sface"
+    echo "rsync -av $img_dmg root@build.onelab.eu:/build/sface-macos/"
     echo "=================================================="
 
 }