macos: packaging support for MacOS X 11.0
[openafs.git] / src / packaging / MacOS / pkgbuild.sh.in
1 #!/bin/bash
2 # Portions Copyright (c) 2003, 2006 Apple Computer, Inc.  All rights reserved.
3 echo '**BUILDPKG**' "$@"
4
5 usage() {
6     exec >&2
7
8     echo 'Usage: pkgbuild.sh [-x] [--app-key <appkey>] [--inst-key <instkey>]'
9     echo '                   [--apple-id <appleid> <password>]'
10     echo '                   [--pass N] [--csdb <CellServDB>] <binary-dir>'
11     echo
12     echo '--app-key and --inst-key are for signing. -x prints all comamnds as '
13     echo 'they are run. --apple-id is for notarizing.'
14     echo
15     echo 'Note: the password associated with <appleid> can be a reference to a'
16     echo 'keychain item. Including your password as cleartext is not'
17     echo 'recommended. e.g.'
18     echo
19     echo '--apple-id foo@bar.com "@keychain:PASSWORD"'
20     echo
21     echo 'In this case, keychain must hold a keychain item named PASSWORD with'
22     echo 'an account matching foo@bar.com.'
23     echo
24     echo 'By default, all passes are run. Available passes:'
25     echo '    --pass 1: prepare pkgroot'
26     echo '    --pass 2: create packages/installer from pkgroot'
27     echo 'If you want to alter the pkgroot, run pass 1, then alter what you'
28     echo 'want, and then run pass 2 to create the resulting packages.'
29     echo 'The --pass argument may be given multiple times.'
30     exit 1
31 }
32
33 if [ x"$#" = x0 ]; then
34     usage
35 fi
36
37 anypass=0
38 PASS1=
39 PASS2=
40
41 APP_KEY=
42 INST_KEY=
43 APPLE_ID=
44 APPLE_PW=
45 DEST_DIR=
46 CSDB=
47
48 CODESIGN_OPTS=
49
50 while [ x"$#" != x0 ] ; do
51     key="$1"
52     shift
53
54     case "$key" in
55     --app-key)
56         APP_KEY="$1"
57         shift
58         ;;
59     --inst-key)
60         INST_KEY="$1"
61         shift
62         ;;
63     --apple-id)
64         APPLE_ID="$1"
65         shift
66         APPLE_PW="$1"
67         shift
68         ;;
69     --csdb)
70         CSDB="$1"
71         shift
72         ;;
73     --pass)
74         anypass=1
75         pass_arg="$1"
76         shift
77         case "$pass_arg" in
78         1)
79             PASS1=1
80             ;;
81         2)
82             PASS2=1
83             ;;
84         *)
85             echo "Unknown pass $pass_arg" >&2
86             exit 1
87             ;;
88         esac
89         ;;
90     -x)
91         DO_X=1
92         ;;
93     *)
94         if [ x"$DEST_DIR" = x ] ; then
95             DEST_DIR="$key"
96         else
97             echo "Error: Unknown arg $key" >&2
98             usage
99         fi
100         ;;
101     esac
102 done
103
104 if [ x"$anypass" = x0 ] ; then
105     PASS1=1
106     PASS2=1
107 fi
108
109 if [ x"$DEST_DIR" = x ] ; then
110     echo "Error: binary 'dest' dir not given"
111     usage
112 fi
113
114 set -e
115
116 if [ x"$DO_X" = x1 ] ; then
117     set -x
118 fi
119
120 BINDEST=`cd "$DEST_DIR" && pwd`
121 CURDIR=`pwd`
122 RESSRC=`dirname "$0"`
123 RESSRC=`cd "$RESSRC" && pwd`
124 majorvers=`uname -r | cut -d. -f1`
125
126 if [ x"$majorvers" = x10 ]; then
127     RELNAME="Snowleopard"
128     THISREL=6
129
130 elif [ x"$majorvers" = x11 ]; then
131     RELNAME="Lion"
132     THISREL=7
133
134 elif [ x"$majorvers" = x12 ]; then
135     RELNAME="MountainLion"
136     THISREL=8
137
138 elif [ x"$majorvers" = x13 ]; then
139     RELNAME="Mavericks"
140     THISREL=9
141
142 elif [ x"$majorvers" = x14 ]; then
143     RELNAME="Yosemite"
144     THISREL=10
145
146 elif [ x"$majorvers" = x15 ]; then
147     RELNAME="ElCapitan"
148     THISREL=11
149
150 elif [ x"$majorvers" = x16 ]; then
151     RELNAME="Sierra"
152     THISREL=12
153
154 elif [ x"$majorvers" = x17 ]; then
155     RELNAME="HighSierra"
156     THISREL=13
157
158 elif [ x"$majorvers" = x18 ]; then
159     RELNAME="Mojave"
160     THISREL=14
161
162 elif [ x"$majorvers" = x19 ]; then
163     RELNAME="Catalina"
164     THISREL=15
165
166 elif [ x"$majorvers" = x20 ]; then
167     RELNAME="BigSur"
168     # Big Sur version number is 11.0 (not 10.16). Still, set THISREL to 16 so we
169     # know that this version came after the ones listed above.
170     THISREL=16
171     OSVER=11
172
173 elif [ x"$majorvers" = x ] ; then
174     echo "Error running uname" >&2
175     exit 1
176
177 else
178     echo "Unknown major version $majorvers" >&2
179     exit 1
180 fi
181
182 if [ $THISREL -ge 14 ]; then
183     # Enable the Hardened Runtime capability, required as of 10.14.5.
184     CODESIGN_OPTS="--options runtime"
185 fi
186
187 SEP=:
188
189 PKGROOT="$CURDIR"/pkgroot
190 PKGRES="$CURDIR"/pkgres
191 DPKGROOT="$CURDIR"/dpkgroot
192 PLUGINS="$CURDIR"/plugins
193 if test -e /usr/bin/pkgbuild; then
194     :
195 else
196     echo pkgbuild not found >&2
197     exit 1
198 fi
199 if test -e /usr/bin/productbuild; then
200     :
201 else
202     echo productbuild not found >&2
203     exit 1
204 fi
205
206 if [ x"$PASS1" = x1 ]; then
207     if [ -x /usr/bin/curl ] && [ x"$CSDB" = x ]; then
208         echo "No CellServDB provided; downloading one from central.org"
209         /usr/bin/curl -f -O https://www.central.org/dl/cellservdb/CellServDB
210         if [ -f "$CURDIR"/CellServDB ] ; then
211             CSDB="$CURDIR"/CellServDB
212         fi
213     fi
214
215     if [ x"$CSDB" = x ]; then
216         echo "A CellServDB file must be provided with --csdb" >&2
217         die=1
218     else
219         # Turn CSDB into an absolute path
220         case "$CSDB" in
221         /*)
222             ;;
223         *)
224             CSDB="$CURDIR/$CSDB"
225             ;;
226         esac
227
228         if grep -q 'GCO Public CellServDB' "$CSDB" ; then
229             touch "$CSDB"
230         else
231             echo "A proper CellServDB file must be provided" >&2
232             die=1
233         fi
234     fi
235
236     for f in ReadMe.rtf."$majorvers" \
237              License.rtf \
238              CellServDB.list \
239              OpenAFS.info \
240              OpenAFS.post_install \
241              OpenAFS.pre_upgrade \
242              csrvdbmerge.pl \
243              2.0.txt
244     do
245         if [ ! -f "$RESSRC/$f" ]; then
246             echo "file missing: $RESSRC/$f" >&2
247             die=1
248         fi
249     done
250     if [ x"$die" = x1 ]; then
251         echo "Correct above errors; then retry" >&2
252         exit 1
253     fi
254
255     for f in "$BINDEST"/bin/translate_et \
256              "$BINDEST/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs"
257     do
258         if [ ! -f "$f" ] ; then
259             echo "dest file missing: $f" >&2
260             die=1
261         fi
262     done
263     if [ x"$die" = x1 ]; then
264         echo $BINDEST " is not a valid binary dir. it should be the result of" >&2
265         echo "make dest" >&2
266         exit 1
267     fi
268
269     rm -rf "$PKGROOT" "$PLUGINS"
270     mkdir "$PKGROOT"
271     mkdir "$PLUGINS"
272
273     mkdir -p "$PKGROOT"/Library
274     mkdir -p "$PKGROOT"/Library/PreferencePanes
275     mkdir -p "$PKGROOT"/Library/Security/SecurityAgentPlugins
276
277     chown -R root${SEP}admin "$PKGROOT"
278     chmod -R 755 "$PKGROOT"
279
280     (cd "$BINDEST"/tools && pax -rw OpenAFS.prefPane "$PKGROOT"/Library/PreferencePanes/)
281     (cd "$BINDEST"/tools && pax -rw aklog.bundle \
282     "$PKGROOT"/Library/Security/SecurityAgentPlugins/)
283
284     mkdir -p "$PKGROOT"/Library/OpenAFS/Tools
285     (cd "$BINDEST" && pax -rw * "$PKGROOT"/Library/OpenAFS/Tools)
286
287     cd "$RESSRC"
288     mv "$PKGROOT"/Library/OpenAFS/Tools/installer/* "$PLUGINS"/
289
290     mkdir -p "$PKGROOT"/Library/LaunchDaemons
291     chmod -R o-w "$PKGROOT"/Library
292     chmod -R g-w "$PKGROOT"/Library
293
294     cp openafs.launchd.plist "$PKGROOT"/Library/LaunchDaemons/org.openafs.filesystems.afs.plist
295     chmod 644 "$PKGROOT"/Library/LaunchDaemons/org.openafs.filesystems.afs.plist
296
297     chown root${SEP}admin "$PKGROOT"/Library
298     chown -R root${SEP}wheel "$PKGROOT"/Library/LaunchDaemons
299     chown -R root${SEP}wheel "$PKGROOT"/Library/OpenAFS/Tools
300     chmod -R og-w "$PKGROOT"/Library/OpenAFS/Tools
301
302     mkdir -p "$PKGROOT"/private/var/db/openafs/cache
303     mkdir -p "$PKGROOT"/private/var/db/openafs/etc/config
304
305     cp openafs.launchdaemon "$PKGROOT"/private/var/db/openafs/etc/launchafs.sh
306     chmod 755 "$PKGROOT"/private/var/db/openafs/etc/launchafs.sh
307
308     cp "$CSDB" "$PKGROOT"/private/var/db/openafs/etc/CellServDB.master
309     echo grand.central.org > "$PKGROOT"/private/var/db/openafs/etc/ThisCell.sample
310     echo /afs:/var/db/openafs/cache:100000 > \
311          "$PKGROOT"/private/var/db/openafs/etc/cacheinfo.sample
312
313     cp -RP "$PKGROOT"/Library/OpenAFS/Tools/etc/afssettings \
314            "$PKGROOT"/private/var/db/openafs/etc/config
315     cp settings.plist "$PKGROOT"/private/var/db/openafs/etc/config/settings.plist.orig
316     cp afs.conf "$PKGROOT"/private/var/db/openafs/etc/config/afs.conf.sample
317     cp krb5-weak.conf "$PKGROOT"/private/var/db/openafs/etc/krb5-weak.conf
318
319     cp decode-panic "$PKGROOT"/Library/OpenAFS/Tools/tools
320     chmod a+x "$PKGROOT"/Library/OpenAFS/Tools/tools/decode-panic
321
322     rm -rf "$DPKGROOT"
323     mkdir "$DPKGROOT"
324     mkdir -p "$DPKGROOT"/Library/OpenAFS/Debug
325
326     mv "$PKGROOT"/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext.dSYM \
327        "$DPKGROOT"/Library/OpenAFS/Debug/
328     cp -RP "$PKGROOT"/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext \
329            "$DPKGROOT"/Library/OpenAFS/Debug/
330     chown -R root${SEP}wheel "$DPKGROOT"/Library/OpenAFS/Debug
331     chmod -R og-w "$DPKGROOT"/Library/OpenAFS/Debug
332
333     strip -X -S \
334         "$PKGROOT"/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs
335
336     mkdir -p "$PKGROOT"/private/var/db/openafs
337
338     cp -RP "$PKGROOT"/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext \
339            "$PKGROOT"/Library/OpenAFS/Tools/root.client/usr/vice/etc/C \
340            "$PKGROOT"/private/var/db/openafs/etc
341
342     chown -R root${SEP}wheel "$PKGROOT"/private
343     chmod -R og-w "$PKGROOT"/private
344
345     chown -R root${SEP}wheel "$PKGROOT"/private
346     chmod -R og-w "$PKGROOT"/private
347     chmod  og-rx "$PKGROOT"/private/var/db/openafs/cache
348
349     if [ x"$APP_KEY" != x ] ; then
350         # To be notarized by Apple, all files must be signed.
351         find "$PKGROOT" -type f -exec codesign --verbose --force \
352             --timestamp --sign "$APP_KEY" $CODESIGN_OPTS {} \;
353
354         # Sign each 'thing' that we have (commands, kexts, etc)
355         for obj in "$DPKGROOT"/Library/OpenAFS/Debug/afs.kext \
356                    "$PKGROOT"/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext \
357                    "$PKGROOT"/private/var/db/openafs/etc/afs.kext \
358                    "$PKGROOT"/Library/PreferencePanes/OpenAFS.prefPane/Contents/Resources/AFSBackgrounder.app \
359                    "$PKGROOT"/Library/PreferencePanes/OpenAFS.prefPane \
360                    "$PKGROOT"/Library/Security/SecurityAgentPlugins/aklog.bundle \
361                    "$PKGROOT"/Library/OpenAFS/Tools/tools/growlagent-openafs.app \
362                    "$PKGROOT"/Library/OpenAFS/Tools/tools/aklog.bundle \
363                    "$PKGROOT"/Library/OpenAFS/Tools/tools/OpenAFS.prefPane/Contents/Resources/AFSBackgrounder.app \
364                    "$PKGROOT"/Library/OpenAFS/Tools/tools/OpenAFS.prefPane \
365                    "$PLUGINS"/afscell.bundle
366         do
367             codesign --verbose --force --timestamp --sign "$APP_KEY" $CODESIGN_OPTS "$obj"
368         done
369
370
371         # Check if our signatures for our kexts are valid. 'kextutil' will exit
372         # with an error and print out a message if something is wrong with the
373         # signature. Note that a code signing cert must have the
374         # 1.2.840.113635.100.6.1.18 extension present to be used for kexts
375         # (most code signing certs cannot be used for kexts).
376         for kext in "$DPKGROOT"/Library/OpenAFS/Debug/afs.kext \
377                     "$PKGROOT"/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext \
378                     "$PKGROOT"/private/var/db/openafs/etc/afs.kext
379         do
380             # This check will fail on systems that require notarization, because we haven't
381             # notarized anything yet.  For now, just disable the check for those versions.
382             if [ $THISREL -ge 14 ]; then
383                 echo "Skipping kextutil checks for $kext"
384             else
385                 kextutil -no-load -print-diagnostics "$kext"
386             fi
387         done
388     fi
389
390     if [ $majorvers -ge 15 ]; then
391         # El Capitan and further prevent us from touching /usr/bin directly
392         PREFIX=/opt
393         USRBIN=/opt/openafs/bin
394         USRBIN2TOOLS=../../../Library/OpenAFS/Tools
395
396         USRSBIN=/opt/openafs/sbin
397         USRSBIN2TOOLS=../../../Library/OpenAFS/Tools
398
399         MANDIR=/opt/openafs/share/man
400         MANDIR2TOOLS=../../../../Library/OpenAFS/Tools
401
402         # Add our bin, sbin, and man directories to the default search path
403         mkdir -p "$PKGROOT"/etc/paths.d "$PKGROOT"/etc/manpaths.d
404         echo "$USRBIN" > "$PKGROOT"/etc/paths.d/40-openafs
405         echo "$USRSBIN" >> "$PKGROOT"/etc/paths.d/40-openafs
406         echo "$MANDIR" > "$PKGROOT"/etc/manpaths.d/40-openafs
407     else
408         PREFIX=/usr
409         USRBIN=/usr/bin
410         USRBIN2TOOLS=../../Library/OpenAFS/Tools
411
412         USRSBIN=/usr/sbin
413         USRSBIN2TOOLS="$USRBIN2TOOLS"
414
415         MANDIR=/usr/share/man
416         MANDIR2TOOLS=../../../Library/OpenAFS/Tools
417     fi
418
419     mkdir -p "$PKGROOT$USRBIN" \
420              "$PKGROOT$USRSBIN" \
421              "$PKGROOT$MANDIR"/man1 \
422              "$PKGROOT$MANDIR"/man5 \
423              "$PKGROOT$MANDIR"/man8
424
425     BINLIST="fs klog klog.krb pagsh pagsh.krb pts sys tokens tokens.krb unlog unlog.krb aklog"
426     ETCLIST="vos"
427
428     if [ x"$DO_X" = x1 ] ; then
429         # Don't print out every single 'ln -s'... that's kinda useless
430         : 'Symlinking commands and manpages into place...'
431         set +x
432     fi
433
434     for f in $BINLIST; do
435         ln -s "$USRBIN2TOOLS"/bin/"$f" "$PKGROOT$USRBIN/$f"
436     done
437     for f in $ETCLIST; do
438         ln -s "$USRSBIN2TOOLS"/etc/"$f" "$PKGROOT$USRSBIN/$f"
439     done
440
441     for section in man1 man5 man8 ; do
442         for f in $(ls $PKGROOT/Library/OpenAFS/Tools/man/$section); do
443
444             if [ -L "$PKGROOT/Library/OpenAFS/Tools/man/$section/$f" ] ; then
445                 # If this manpage is a symlink, just change where it's pointing,
446                 # and rename the link; don't actually 'gzip' it.
447                 link=$(readlink "$PKGROOT/Library/OpenAFS/Tools/man/$section/$f")
448                 rm -f "$PKGROOT/Library/OpenAFS/Tools/man/$section/$f"
449                 ln -s "$link".gz "$PKGROOT/Library/OpenAFS/Tools/man/$section/$f".gz
450
451             else
452                 gzip -9 "$PKGROOT/Library/OpenAFS/Tools/man/$section/$f"
453             fi
454             ln -s ../"$MANDIR2TOOLS"/man/"$section/$f".gz \
455                   "$PKGROOT$MANDIR/$section/$f".gz
456         done
457     done
458
459     if [ x"$DO_X" = x1 ] ; then
460         set -x
461     fi
462
463     ln -s "$USRBIN2TOOLS"/bin/kpasswd "$PKGROOT$USRBIN"/kpasswd.afs
464
465     ln -s "$USRSBIN2TOOLS"/root.client/usr/vice/etc/afsd "$PKGROOT$USRSBIN"/afsd
466
467     chown -R root${SEP}wheel "$PKGROOT$PREFIX"
468     chmod -R og-w "$PKGROOT$PREFIX"
469 fi
470
471 if [ x"$PASS2" = x1 ]; then
472     rm -rf "$PKGRES"
473     mkdir "$PKGRES"
474     cd "$RESSRC"
475
476     rm -rf "$CURDIR"/OpenAFS-debug-extension.pkg
477     /usr/bin/pkgbuild --root "$DPKGROOT" --id org.openafs.OpenAFS-debug.pkg \
478                       --version '@PACKAGE_VERSION@' \
479              "$CURDIR"/OpenAFS-debug-extension.pkg
480
481     cd "$RESSRC"
482     cp OpenAFS.post_install "$PKGRES"/postinstall
483     cp OpenAFS.pre_upgrade "$PKGRES"/preupgrade
484     cp OpenAFS.post_install "$PKGRES"/postupgrade
485     cp csrvdbmerge.pl "$PKGRES"
486
487     chmod a+x "$PKGRES"/csrvdbmerge.pl \
488               "$PKGRES"/postinstall \
489               "$PKGRES"/postupgrade \
490               "$PKGRES"/preupgrade
491
492     cp CellServDB.list "$PKGRES"
493     chown -R root${SEP}wheel "$PKGRES"
494
495     rm -rf "$CURDIR"/OpenAFS-dist.pkg
496     /usr/bin/pkgbuild --root "$PKGROOT" --id org.openafs.OpenAFS.pkg \
497                       --version '@PACKAGE_VERSION@' \
498                       --scripts "$PKGRES" "$CURDIR"/OpenAFS-dist.pkg
499
500     rm -rf "$PKGRES"
501     mkdir "$PKGRES"
502     cp background.jpg "$PKGRES"/background.jpg
503     cp License.rtf "$PKGRES"
504     cp ReadMe.rtf."$majorvers" "$PKGRES"/ReadMe.rtf
505     chown -R root${SEP}wheel "$PKGRES"
506
507     if [ $majorvers -ge 15 ] ; then
508         # For El Capitan and further, we have some extra information to tell
509         # the user at the end of the installation process.
510         cp conclusion.txt "$PKGRES"/conclusion.txt
511         PRES_EXTRA="<conclusion file=\"conclusion.txt\"/>"
512     fi
513
514     # generate Distribution.xml from Distribution.xml.in -- nonstandard substs
515     if [ $majorvers -ge 20 ] ; then
516         # Unlike older versions, point releases for macOS Big Sur increment the
517         # second component of the release number (prior releases increment the
518         # third component of this number).
519         sed -e "s/%%OSX_MAJOR_CUR%%/0/g" \
520             -e "s/%%OSX_MAJOR_NEXT%%/0/g" \
521             -e "s/%%OSVER_CUR%%/$OSVER/g" \
522             -e "s/%%OSVER_NEXT%%/$(( $OSVER + 1 ))/g" \
523             -e "s,%%PRES_EXTRA%%,$PRES_EXTRA,g" \
524             -e "s/%%OPENAFS_VERSION%%/@PACKAGE_VERSION@/g" \
525             < Distribution.xml.in > Distribution.xml
526     else
527         sed -e "s/%%OSX_MAJOR_CUR%%/$THISREL/g" \
528             -e "s/%%OSX_MAJOR_NEXT%%/$(( $THISREL + 1 ))/g" \
529             -e "s/%%OSVER_CUR%%/10/g" \
530             -e "s/%%OSVER_NEXT%%/10/g" \
531             -e "s,%%PRES_EXTRA%%,$PRES_EXTRA,g" \
532             -e "s/%%OPENAFS_VERSION%%/@PACKAGE_VERSION@/g" \
533             < Distribution.xml.in > Distribution.xml
534     fi
535
536     rm -rf "$CURDIR/prod"
537     mkdir "$CURDIR/prod"
538     mv "$CURDIR"/OpenAFS-dist.pkg "$CURDIR"/OpenAFS-debug-extension.pkg "$CURDIR"/prod
539     /usr/bin/productbuild --distribution Distribution.xml --resources "$PKGRES" \
540                           --plugins "$PLUGINS" --package-path "$CURDIR"/prod "$CURDIR"/OpenAFS.pkg
541
542     if [ x"$INST_KEY" != x ] ; then
543         mv "$CURDIR"/OpenAFS.pkg "$CURDIR"/OpenAFS-unsigned.pkg
544         productsign --timestamp --sign "$INST_KEY" "$CURDIR"/OpenAFS-unsigned.pkg \
545                     "$CURDIR"/OpenAFS.pkg
546         rm -f "$CURDIR"/OpenAFS-unsigned.pkg
547     fi
548
549     rm -rf "$CURDIR/dmg"
550     rm -f "$CURDIR/TMP.dmg"
551     rm -rf "$CURDIR/OpenAFS-@PACKAGE_VERSION@-$RELNAME.dmg"
552
553     mkdir "$CURDIR"/dmg
554     mv "$CURDIR"/OpenAFS.pkg "$CURDIR"/dmg
555     cp "$RESSRC"/Uninstall.14.15 "$CURDIR"/dmg/Uninstall.command
556     cp "$RESSRC"/DS_Store "$CURDIR"/dmg/.DS_Store
557     mkdir "$CURDIR"/dmg/.background
558     cp "$RESSRC"/afslogo.jpg "$CURDIR"/dmg/.background
559
560     if [ x"$APP_KEY" != x ] ; then
561         codesign --verbose --force --timestamp --sign "$APP_KEY" "$CURDIR"/dmg/Uninstall.command
562         codesign --verbose --force --timestamp --sign "$APP_KEY" "$CURDIR"/dmg/OpenAFS.pkg
563     fi
564
565     hdiutil create -srcfolder "$CURDIR"/dmg -volname OpenAFS \
566             -o "$CURDIR"/TMP.dmg
567     hdiutil convert -format UDZO "$CURDIR"/TMP.dmg \
568             -o "$CURDIR/OpenAFS-@PACKAGE_VERSION@-$RELNAME".dmg
569
570     echo
571     echo "Created $CURDIR/OpenAFS-@PACKAGE_VERSION@-$RELNAME".dmg
572
573     if [ x"$APPLE_ID" != x ] ; then
574         echo "Notarizing package..."
575         ./notarize.pl "$APPLE_ID" "$APPLE_PW" "$CURDIR/OpenAFS-@PACKAGE_VERSION@-$RELNAME.dmg"
576     fi
577 fi