macos: packaging support for MacOS X 11.0 30/14430/4
authorMarcio Barbosa <mbarbosa@sinenomine.net>
Thu, 28 Jan 2021 23:49:25 +0000 (15:49 -0800)
committerBenjamin Kaduk <kaduk@mit.edu>
Sat, 10 Apr 2021 00:16:36 +0000 (20:16 -0400)
This commit introduces the new set of changes / files required to
successfully create the dmg installer on OS X 11.0 "Big Sur".

Change-Id: I600aba528305d8d42393e90fd56e98e4557d9233
Reviewed-on: https://gerrit.openafs.org/14430
Reviewed-by: Yadavendra Yadav <yadayada@in.ibm.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/packaging/MacOS/Distribution.xml.in
src/packaging/MacOS/InstallationCheck.20 [new file with mode: 0644]
src/packaging/MacOS/InstallationCheck.strings.20 [new file with mode: 0644]
src/packaging/MacOS/ReadMe.rtf.20 [new file with mode: 0644]
src/packaging/MacOS/pkgbuild.sh.in

index 96a2d8f..b5112d6 100644 (file)
@@ -3,7 +3,7 @@
     <options rootVolumeOnly="true" />
     <volume-check>
        <allowed-os-versions>
-           <os-version min="10.%%OSX_MAJOR_CUR%%.0" before="10.%%OSX_MAJOR_NEXT%%.0"/>
+           <os-version min="%%OSVER_CUR%%.%%OSX_MAJOR_CUR%%.0" before="%%OSVER_NEXT%%.%%OSX_MAJOR_NEXT%%.0"/>
        </allowed-os-versions>
     </volume-check>
     <installation-check>
diff --git a/src/packaging/MacOS/InstallationCheck.20 b/src/packaging/MacOS/InstallationCheck.20
new file mode 100644 (file)
index 0000000..fd857ba
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+majorvers=`uname -r | sed 's/\..*//'`
+if [ $majorvers -ne 20 ]; then
+       exit 112
+fi
+
+# check for temporary versions of ThisCell and CellAlias
+# and move them aside
+tmpthiscell=/private/tmp/org.OpenAFS.Install.ThisCell.$USER
+tmpcellalias=/private/tmp/org.OpenAFS.Install.CellAlias.$USER
+date=`date +%Y%m%d%H%M`
+if [ -e $tmpthiscell ]; then
+    mv -f $tmpthiscell $tmpthiscell.$date
+fi
+if [ -e $tmpcellalias ]; then
+    mv -f $tmpcellalias $tmpcellalias.$date
+fi
+
+exit 0
diff --git a/src/packaging/MacOS/InstallationCheck.strings.20 b/src/packaging/MacOS/InstallationCheck.strings.20
new file mode 100644 (file)
index 0000000..cf31ce4
--- /dev/null
@@ -0,0 +1 @@
+"16" = "This OpenAFS release requires Big Sur (11.0)";
diff --git a/src/packaging/MacOS/ReadMe.rtf.20 b/src/packaging/MacOS/ReadMe.rtf.20
new file mode 100644 (file)
index 0000000..33c42b3
--- /dev/null
@@ -0,0 +1,7 @@
+{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf320
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\margl1440\margr1440\vieww9000\viewh9000\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\fs24 \cf0 This release of OpenAFS is targeted at MacOS 11.0 (Big Sur) and is not recommended for use with any other version.}
index 1814304..6b82363 100644 (file)
@@ -163,6 +163,13 @@ elif [ x"$majorvers" = x19 ]; then
     RELNAME="Catalina"
     THISREL=15
 
+elif [ x"$majorvers" = x20 ]; then
+    RELNAME="BigSur"
+    # Big Sur version number is 11.0 (not 10.16). Still, set THISREL to 16 so we
+    # know that this version came after the ones listed above.
+    THISREL=16
+    OSVER=11
+
 elif [ x"$majorvers" = x ] ; then
     echo "Error running uname" >&2
     exit 1
@@ -505,11 +512,26 @@ if [ x"$PASS2" = x1 ]; then
     fi
 
     # generate Distribution.xml from Distribution.xml.in -- nonstandard substs
-    sed -e "s/%%OSX_MAJOR_CUR%%/$THISREL/g" \
-       -e "s/%%OSX_MAJOR_NEXT%%/$(( $THISREL + 1 ))/g" \
-       -e "s,%%PRES_EXTRA%%,$PRES_EXTRA,g" \
-       -e "s/%%OPENAFS_VERSION%%/@PACKAGE_VERSION@/g" \
-       < Distribution.xml.in > Distribution.xml
+    if [ $majorvers -ge 20 ] ; then
+       # Unlike older versions, point releases for macOS Big Sur increment the
+       # second component of the release number (prior releases increment the
+       # third component of this number).
+       sed -e "s/%%OSX_MAJOR_CUR%%/0/g" \
+           -e "s/%%OSX_MAJOR_NEXT%%/0/g" \
+           -e "s/%%OSVER_CUR%%/$OSVER/g" \
+           -e "s/%%OSVER_NEXT%%/$(( $OSVER + 1 ))/g" \
+           -e "s,%%PRES_EXTRA%%,$PRES_EXTRA,g" \
+           -e "s/%%OPENAFS_VERSION%%/@PACKAGE_VERSION@/g" \
+           < Distribution.xml.in > Distribution.xml
+    else
+       sed -e "s/%%OSX_MAJOR_CUR%%/$THISREL/g" \
+           -e "s/%%OSX_MAJOR_NEXT%%/$(( $THISREL + 1 ))/g" \
+           -e "s/%%OSVER_CUR%%/10/g" \
+           -e "s/%%OSVER_NEXT%%/10/g" \
+           -e "s,%%PRES_EXTRA%%,$PRES_EXTRA,g" \
+           -e "s/%%OPENAFS_VERSION%%/@PACKAGE_VERSION@/g" \
+           < Distribution.xml.in > Distribution.xml
+    fi
 
     rm -rf "$CURDIR/prod"
     mkdir "$CURDIR/prod"