Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /osx-dist/build-pkg.sh
ViewVC logotype

Diff of /osx-dist/build-pkg.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3848, Sun Jul 14 03:10:26 2013 UTC revision 3849, Sun Jul 14 14:06:48 2013 UTC
# Line 3  Line 3 
3  # Script to build the installer package for x86 on Mac OS X (10.7+)  # Script to build the installer package for x86 on Mac OS X (10.7+)
4  #  #
5    
6    CMD="build-pkg.sh"
7    
8  # get the version number  # get the version number
9  #  #
10  if [ $# != 1 ] ; then  if [ $# != 1 ] ; then
11    echo "usage: build-pkg.sh version"    echo "usage: $CMD version"
12    exit 1    exit 1
13  fi  fi
14  VERSION=$1  VERSION=$1
# Line 17  Line 19 
19  ROOT=$(pwd)  ROOT=$(pwd)
20  RSRC=Resources  RSRC=Resources
21    
22  # you need a developer ID to sign the final package  # you need a developer ID to sign the final package;
23  #  #
24  SIGN="Developer ID Installer: John Reppy"  case x"$USER" in
25      xjhr) SIGN="Developer ID Installer: John Reppy" ;;
26      *)
27        echo "$CMD [Warning]: unknown user, so package will not be signed!"
28        SIGN=none
29      ;;
30    esac
31    
32  if [ -d $DISTROOT ] ; then  if [ -d $DISTROOT ] ; then
33    echo "please remove $DISTROOT first"    echo "$CMD [Error]: please remove $DISTROOT first"
34    exit 1    exit 1
35  fi  fi
36  mkdir $DISTROOT  mkdir $DISTROOT
# Line 30  Line 38 
38    
39  # first we need to download and unbundle the config directory for the release  # first we need to download and unbundle the config directory for the release
40  #  #
41  curl -O $CONFIGURL  curl -s -S -O $CONFIGURL
42  tar -xzf config.tgz  tar -xzf config.tgz
43    if [ "$?" != 0 ] ; then
44      # note that if config.tgz does not exist, curl will still work (it will get a
45      # 404 page from the server)
46      echo "$CMD [Error]: unable to download/unpack config.tgz"
47      cd $ROOT
48      rm -rf $DISTROOT
49      exit 1
50    fi
51    
52  # check that the version numbers match  # check that the version numbers match
53  #  #
54    if [ ! -r config/version ] ; then
55      echo "$CMD [Error]: config/version is missing"
56      exit 1
57    fi
58  CONFIG_VERSION=$(cat config/version)  CONFIG_VERSION=$(cat config/version)
59  if [ x"$VERSION" != x"$CONFIG_VERSION" ] ; then  if [ x"$VERSION" != x"$CONFIG_VERSION" ] ; then
60    echo "version in config/version is $CONFIG_VERSION"    echo "$CMD [Error]: version in config/version is $CONFIG_VERSION"
61      cd $ROOT
62      rm -rf $DISTROOT
63    exit 1    exit 1
64  fi  fi
65    
66  # build the distribution (note that this assumes that config/targets is what we want!)  # build the distribution (note that this assumes that config/targets is what we want!)
67  #  #
68  config/install.sh  config/install.sh
69    if [ "$?" != 0 ] ; then
70      echo "$CMD [Error]: problem building SML/NJ"
71      exit 1
72    fi
73    
74  # get the other files to include in the distribution  # get the other files to include in the distribution
75  #  #
# Line 77  Line 103 
103    
104  # build distribution package  # build distribution package
105  #  #
106    if [ $SIGN = none ] ; then
107      echo "$CMD: building unsigned package smlnj-x86-$VERSION.pkg"
108      productbuild --package-path components --resources $RSRC \
109          --distribution $RSRC/distribution.xml ./smlnj-x86-$VERSION.pkg
110    else
111      echo "$CMD: building signed package smlnj-x86-$VERSION.pkg"
112  productbuild --sign "$SIGN" --package-path components --resources $RSRC \  productbuild --sign "$SIGN" --package-path components --resources $RSRC \
113      --distribution $RSRC/distribution.xml ./smlnj-x86-$VERSION.pkg      --distribution $RSRC/distribution.xml ./smlnj-x86-$VERSION.pkg
114    fi
115    
116  # cleanup  # cleanup
117  #  #
118  #rm -rf $RSRC $DISTROOT smlnj.pkg  rm -rf $RSRC $DISTROOT smlnj.pkg

Legend:
Removed from v.3848  
changed lines
  Added in v.3849

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0