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 4661, Fri Jun 1 10:52:34 2018 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  #  #
76  cp -p $ROOT/components/license.html .  cp -p $ROOT/components/license.html .
77  svn export https://smlnj-gforge.cs.uchicago.edu/svn/smlnj/sml/trunk/READMES/$VERSION-README.html  #
78    # as of 110.78, README is included in doc/html/readme/
79    #svn export https://smlnj-gforge.cs.uchicago.edu/svn/smlnj/sml/trunk/READMES/$VERSION-README.html
80    
81  # cleanup  # cleanup
82  #  #
# Line 46  Line 86 
86  #  #
87  cd $ROOT  cd $ROOT
88    
89  # patch distribution file for version  # create the resources directory and fill it
90  #  #
91  sed -e "s/VERSION/$VERSION/g" components/distribution_xml.in > distribution.xml  if [ -d $RSRC ] ; then
92      rm -rf $RSRC
93    fi
94    mkdir $RSRC
95    sed -e "s/VERSION/$VERSION/g" components/distribution_xml.in > $RSRC/distribution.xml
96    cp -p components/smlnj-background.jpg $RSRC/background.jpg
97    sed -e "s/VERSION/$VERSION/g" components/welcome_html.in > $RSRC/welcome.html
98    cp -p components/license.html $RSRC/license.html
99    cp -p components/conclusion.html $RSRC/conclusion.html
100    
101    # copy the readme, while adjusting the fontsize for the installer panel
102    # NOTE: this command relies on the fact that there is only one absolute
103    # font-size command in the README file (the others are relative)
104    #
105    sed -E 's/font-size: [0-9]+pt;/font-size: 9pt;/' \
106      $DISTROOT/doc/html/readme/$VERSION-README.html > $RSRC/readme.html
107    
108  # build package  # build package
109  #  #
110  pkgbuild --scripts components/scripts/ --install-location /usr/local/smlnj --root $DISTROOT smlnj.pkg  PKG_OPTS="--identifier $ID --version $VERSION --scripts components/scripts/ \
111      --install-location /usr/local/smlnj --root $DISTROOT"
112    pkgbuild $PKG_OPTS smlnj.pkg
113    
114  # build distribution package  # build distribution package
115  #  #
116  productbuild --sign "Mac Developer: Rich Manalang (3U78U4KMEF)" \  BUILD_OPTS="--package-path components --resources $RSRC \
117    --distribution distribution.xml --package-path . ./smlnj-x86-$VERSION.pkg    --distribution $RSRC/distribution.xml ./smlnj-x86-$VERSION.pkg"
118    if [ x"$SIGN" = xnone ] ; then
119      echo "$CMD: building unsigned package smlnj-x86-$VERSION.pkg"
120      productbuild $BUILD_OPTS
121    else
122      echo "$CMD: building signed package smlnj-x86-$VERSION.pkg"
123      productbuild --sign "$SIGN" $BUILD_OPTS
124    fi
125    
126  # cleanup  # cleanup
127  #  #
128  #rm distribution.xml  rm -rf $RSRC $DISTROOT smlnj.pkg

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

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