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 3842, Fri Jul 12 21:28:08 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  # FIXME: check for VERSION argument!!!  CMD="build-pkg.sh"
7    
8    # get the version number
9    #
10    if [ $# != 1 ] ; then
11      echo "usage: $CMD version"
12      exit 1
13    fi
14  VERSION=$1  VERSION=$1
15    
16  CONFIGURL=http://smlnj.cs.uchicago.edu/dist/working/$VERSION/config.tgz  CONFIGURL=http://smlnj.cs.uchicago.edu/dist/working/$VERSION/config.tgz
17  DISTROOT=smlnj.dst  DISTROOT=smlnj.dst
18    ID=org.smlnj.x86.pkg
19  ROOT=$(pwd)  ROOT=$(pwd)
20    RSRC=Resources
21    
22  if [ -d $ROOT ] ; then  # you need a developer ID to sign the final package;
23    echo "please remove $ROOT first"  #
24    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
33      echo "$CMD [Error]: please remove $DISTROOT first"
34    exit 1    exit 1
35  fi  fi
36  mkdir $ROOT  mkdir $DISTROOT
37  cd $ROOT  cd $DISTROOT
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 46  Line 84 
84  #  #
85  cd $ROOT  cd $ROOT
86    
87  # patch distribution file for version  # create the resources directory and fill it
88  #  #
89  sed -e "s/VERSION/$VERSION/g" components/distribution_xml.in > distribution.xml  if [ -d $RSRC ] ; then
90      rm -rf $RSRC
91    fi
92    mkdir $RSRC
93    sed -e "s/VERSION/$VERSION/g" components/distribution_xml.in > $RSRC/distribution.xml
94    cp -p components/smlnj-background.jpg $RSRC/background.jpg
95    #cp -p components/welcome.html $RSC/welcome.html
96    cp -p $DISTROOT/$VERSION-README.html $RSRC/readme.html
97    cp -p components/license.html $RSRC/license.html
98    cp -p components/conclusion.html $RSRC/conclusion.html
99    
100  # build package  # build package
101  #  #
102  pkgbuild --scripts components/scripts/ --install-location /usr/local/smlnj --root $DISTROOT smlnj.pkg  pkgbuild --identifier $ID --scripts components/scripts/ --install-location /usr/local/Xsmlnj --root $DISTROOT smlnj.pkg
103    
104  # build distribution package  # build distribution package
105  #  #
106  productbuild --sign "Mac Developer: Rich Manalang (3U78U4KMEF)" \  if [ $SIGN = none ] ; then
107    --distribution distribution.xml --package-path . ./smlnj-x86-$VERSION.pkg    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 \
113          --distribution $RSRC/distribution.xml ./smlnj-x86-$VERSION.pkg
114    fi
115    
116  # cleanup  # cleanup
117  #  #
118  #rm distribution.xml  rm -rf $RSRC $DISTROOT smlnj.pkg

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

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