invoke make version
[sface.git] / macos / build-dmg.sh
index 87fb1c7..07cf801 100755 (executable)
@@ -1,7 +1,8 @@
 #!/bin/sh
 
 # PURPOSE
-# package a combination of sfa+sface into a snow leopard dmg install disk
+# package a combination of sfa+sface into a dmg install disk
+# supports leopard and snow leopard
 # 
 # REQUIREMENTS
 # sface-skel-snow-leopard<arch>.dmg is the skeleton that has Qt and all the other third-party software
@@ -11,6 +12,9 @@
 # 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
@@ -156,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