create debugging kext package for MacOS
authorDerrick Brashear <shadow@dementia.org>
Sun, 17 Jan 2010 06:10:28 +0000 (01:10 -0500)
committerDerrick Brashear <shadow|account-1000005@unknown>
Sun, 17 Jan 2010 16:15:59 +0000 (08:15 -0800)
this creates and installs a debugging kext package for macos. it also
always installs the decode-panic script (which can be used even without
the debug kext)

Change-Id: Iff03de66cd3df2690f03333e6629d21660364cd1
Reviewed-on: http://gerrit.openafs.org/1120
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

configure.in
src/libafs/MakefileProto.DARWIN.in
src/packaging/MacOS/OpenAFS-debug.Description.plist.in [copied from src/packaging/MacOS/OpenAFS.Description.plist with 73% similarity]
src/packaging/MacOS/OpenAFS-debug.Info.plist.in [new file with mode: 0644]
src/packaging/MacOS/OpenAFS.Description.plist.in [moved from src/packaging/MacOS/OpenAFS.Description.plist with 94% similarity]
src/packaging/MacOS/OpenAFS.info.in
src/packaging/MacOS/buildpkg.sh.in

index b1ab052..94e2c3c 100644 (file)
@@ -107,6 +107,9 @@ src/log/test/Makefile \
 src/lwp/Makefile \
 src/lwp/test/Makefile \
 src/packaging/Debian/rules \
+src/packaging/MacOS/OpenAFS-debug.Description.plist \
+src/packaging/MacOS/OpenAFS-debug.Info.plist \
+src/packaging/MacOS/OpenAFS.Description.plist \
 src/packaging/MacOS/OpenAFS.Info.plist \
 src/packaging/MacOS/OpenAFS.info \
 src/packaging/MacOS/buildpkg.sh \
index 3cfaf6d..58e6599 100644 (file)
@@ -131,32 +131,56 @@ INST_LIBAFS = ${DESTDIR}${afskerneldir}/afs-nfs.kext
 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/afs.kext
 DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/afs-nfs.kext
 DEST_LIBAFSNONFS = ${DEST}/root.client/usr/vice/etc/afs.kext
+<all -ppc_darwin_90 -x86_darwin_90 -x86_darwin_100>
+LIBAFSDSYM =
+LIBAFSNONFSDSYM =
+INST_LIBAFSDSYM =
+INST_LIBAFSNONFSDSYM =
+DEST_LIBAFSDSYM =
+DEST_LIBAFSNONFSDSYM =
+<ppc_darwin_90 x86_darwin_90 x86_darwin_100>
+LIBAFSDSYM = libafs.o.dSYM
+LIBAFSNONFSDSYM = libafs.nonfs.o.dSYM
+INST_LIBAFSDSYM = ${DESTDIR}${afskerneldir}/afs-nfs.kext.dSYM
+INST_LIBAFSNONFSDSYM = ${DESTDIR}${afskerneldir}/afs.kext.dSYM
+DEST_LIBAFSDSYM =  ${DEST}/root.client/usr/vice/etc/afs-nfs.kext.dSYM
+DEST_LIBAFSNONFSDSYM = ${DEST}/root.client/usr/vice/etc/afs.kext.dSYM
+<all>
 
-
-libafs: $(LIBAFSNONFS) ;
-install_libafs: $(LIBAFSNONFS) ;
+libafs: $(LIBAFSNONFS) $(LIBAFSNONFSDSYM) ;
+install_libafs: $(LIBAFSNONFS) $(LIBAFSNONFSDSYM) ;
        -mkdir -p ${INST_LIBAFSNONFS}
        -mkdir -p ${INST_LIBAFSNONFS}/Contents
        $(INSTALL) -m 644 ../${DARWIN_INFOFILE} ${INST_LIBAFSNONFS}/Contents/Info.plist
        -mkdir -p ${INST_LIBAFSNONFS}/Contents/MacOS
        $(INSTALL) -m 644 ${LIBAFSNONFS} ${INST_LIBAFSNONFS}/Contents/MacOS/afs
+<ppc_darwin_90 x86_darwin_90 x86_darwin_100>
+       -mkdir -p ${INST_LIBAFSNONFSDSYM}/Contents/Resources/DWARF
+       $(INSTALL) ${LIBAFSNONFSDSYM}/Contents/Info.plist ${INST_LIBAFSNONFSDSYM}/Contents
+       $(INSTALL) ${LIBAFSNONFSDSYM}/Contents/Resources/DWARF/${LIBAFSNONFS} ${INST_LIBAFSNONFSDSYM}/Contents/Resources/DWARF
+<all>
 
-dest_libafs: $(LIBAFSNONFS) ;
+dest_libafs: $(LIBAFSNONFS) $(LIBAFSNONFSDSYM) ;
        -mkdir -p ${DEST_LIBAFSNONFS}
        -mkdir -p ${DEST_LIBAFSNONFS}/Contents
        $(INSTALL) -m 644 ../${DARWIN_INFOFILE} ${DEST_LIBAFSNONFS}/Contents/Info.plist
        -mkdir -p ${DEST_LIBAFSNONFS}/Contents/MacOS
        $(INSTALL) -m 644 ${LIBAFSNONFS} ${DEST_LIBAFSNONFS}/Contents/MacOS/afs
-
+<ppc_darwin_90 x86_darwin_90 x86_darwin_100>
+       -mkdir -p ${DEST_LIBAFSNONFSDSYM}/Contents/Resources/DWARF
+       $(INSTALL) ${LIBAFSNONFSDSYM}/Contents/Info.plist ${DEST_LIBAFSNONFSDSYM}/Contents
+       $(INSTALL) ${LIBAFSNONFSDSYM}/Contents/Resources/DWARF/${LIBAFSNONFS} ${DEST_LIBAFSNONFSDSYM}/Contents/Resources/DWARF
+<all>
 
 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
        $(MODLD) -r -o ${LIBAFS} ${AFSAOBJS} ${AFSNFSOBJS} -lcc_kext
-<ppc_darwin_90 x86_darwin_90 x86_darwin_100>
-       dsymutil -o ${LIBAFS}.dSYM ${LIBAFS}
-<all>
 
 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
        $(MODLD) -r -o ${LIBAFSNONFS} ${AFSAOBJS} ${AFSNONFSOBJS} -lcc_kext
+
 <ppc_darwin_90 x86_darwin_90 x86_darwin_100>
+$(LIBAFSDSYM): ${LIBAFS}
+       dsymutil -o ${LIBAFS}.dSYM ${LIBAFS}
+${LIBAFSNONFSDSYM}: ${LIBAFSNONFS}
        dsymutil -o ${LIBAFSNONFS}.dSYM ${LIBAFSNONFS}
 <all>
@@ -5,10 +5,10 @@
        <key>IFPkgDescriptionDeleteWarning</key>
        <string></string>
        <key>IFPkgDescriptionDescription</key>
-       <string>Mac OS X version of OpenAFS client and server.</string>
+       <string>Mac OS X debug symbols for OpenAFS client.</string>
        <key>IFPkgDescriptionTitle</key>
-       <string>OpenAFS</string>
+       <string>OpenAFS debug extension</string>
        <key>IFPkgDescriptionVersion</key>
-       <string>1.2.10</string>
+       <string>@VERSION@</string>
 </dict>
 </plist>
diff --git a/src/packaging/MacOS/OpenAFS-debug.Info.plist.in b/src/packaging/MacOS/OpenAFS-debug.Info.plist.in
new file mode 100644 (file)
index 0000000..aa17c7e
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>CFBundleGetInfoString</key>
+       <string>OpenAFS-debug @MACOS_VERSION@</string>
+       <key>CFBundleIdentifier</key>
+       <string>org.openafs.OpenAFS-debug.pkg</string>
+       <key>CFBundleName</key>
+       <string>OpenAFS-debug</string>
+       <key>CFBundleShortVersionString</key>
+       <string>@MACOS_VERSION@</string>
+       <key>IFMajorVersion</key>
+       <integer>1</integer>
+       <key>IFMinorVersion</key>
+       <integer>5</integer>
+       <key>IFPkgFlagAllowBackRev</key>
+       <false/>
+       <key>IFPkgFlagAuthorizationAction</key>
+       <string>RootAuthorization</string>
+       <key>IFPkgFlagBackgroundAlignment</key>
+       <string>bottomright</string>
+       <key>IfPkgFlagBackgroundScaling</key>
+       <string>proportional</string>
+       <key>IFPkgFlagDefaultLocation</key>
+       <string>/</string>
+       <key>IFPkgFlagInstallFat</key>
+       <false/>
+       <key>IFPkgFlagIsRequired</key>
+       <false/>
+       <key>IFPkgFlagRelocatable</key>
+       <false/>
+       <key>IFPkgFlagRestartAction</key>
+       <string>NoRestart</string>
+       <key>IFPkgFlagRootVolumeOnly</key>
+       <true/>
+       <key>IFPkgFlagUpdateInstalledLanguages</key>
+       <false/>
+       <key>IFPkgFlagUseUserMask</key>
+       <false/>
+       <key>IFPkgFlagAllowBackRev</key>
+       <true/>
+       <key>IFPkgFormatVersion</key>
+       <real>0.10000000149011612</real>
+</dict>
+</plist>
@@ -9,6 +9,6 @@
        <key>IFPkgDescriptionTitle</key>
        <string>OpenAFS</string>
        <key>IFPkgDescriptionVersion</key>
-       <string>1.2.10</string>
+       <string>@VERSION@</string>
 </dict>
 </plist>
index b129699..a3d04a5 100644 (file)
@@ -1,6 +1,6 @@
 Title OpenAFS
 Version @VERSION@
-Description The OpenAFS distributed filesystem. This package installs an almost-ready-to-run client for OpenAFS. see http://www.openafs.org for more information.
+Description The OpenAFS distributed filesystem. This package installs a ready-to-run client for OpenAFS. See http://www.openafs.org for more information.
 DefaultLocation /
 Diskname (null)
 DeleteWarning 
index 50d6f41..7731c29 100644 (file)
@@ -40,6 +40,8 @@ fi
 
 PKGROOT=$CURDIR/pkgroot
 PKGRES=$CURDIR/pkgres
+DPKGROOT=$CURDIR/dpkgroot
+DPKGRES=$CURDIR/dpkgres
 if [ $majorvers -ge 7 ]; then
     SEP=:
     package=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
@@ -138,6 +140,19 @@ if [ $firstpass = yes ]; then
     fi
     cp afs.conf $PKGROOT/private/var/db/openafs/etc/config/afs.conf.sample
 
+    cp decode-panic $PKGROOT/Library/OpenAFS/Tools/tools
+    chmod a+x $PKGROOT/Library/OpenAFS/Tools/tools/decode-panic
+
+    if [ $majorvers -ge 9 ]; then
+       rm -rf $DPKGROOT
+       mkdir $DPKGROOT
+       mkdir -p $DPKGROOT/Library/OpenAFS/Debug
+       mv $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext.dSYM $DPKGROOT/Library/OpenAFS/Debug
+       cp -RP $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext $DPKGROOT/Library/OpenAFS/Debug
+       chown -R root${SEP}wheel $DPKGROOT/Library/OpenAFS/Debug
+       chmod -R og-w $DPKGROOT/Library/OpenAFS/Debug
+    fi
+
     strip -X -S $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs
 
     cp -RP $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext $PKGROOT/private/var/db/openafs/etc
@@ -189,6 +204,23 @@ fi
 if [ $secondpass = yes ]; then
     rm -rf $PKGRES
     mkdir $PKGRES
+    cd $RESSRC
+    if [ $majorvers -ge 9 ]; then
+       rm -rf $DPKGRES
+       mkdir $DPKGRES
+       cp License.rtf $DPKGRES
+       cp InstallationCheck.$majorvers $DPKGRES/InstallationCheck
+       mkdir -p $DPKGRES/English.lproj
+       cp InstallationCheck.$majorvers $DPKGRES/English.lproj/InstallationCheck
+       chmod a+x $DPKGRES/InstallationCheck
+       cp background.jpg $DPKGRES/background.jpg
+       chown -R root${SEP}wheel $DPKGRES
+       rm -rf $CURDIR/OpenAFS-debug-extension.pkg
+       echo $package -build -p $CURDIR/OpenAFS-debug-extension.pkg -f $DPKGROOT -r $DPKGRES \
+           -i OpenAFS-debug.Info.plist -d OpenAFS-debug.Description.plist
+       $package -build -p $CURDIR/OpenAFS-debug-extension.pkg -f $DPKGROOT -r $DPKGRES \
+           -i OpenAFS-debug.Info.plist -d OpenAFS-debug.Description.plist
+    fi
 
     cd $RESSRC
     if [ $majorvers -ge 7 ]; then
@@ -234,7 +266,7 @@ if [ $secondpass = yes ]; then
     fi
 
     rm -rf $PKGROOT $PKGRES
-
+    rm -rf $DPKGROOT $DPKGRES
     # here we want to build installer plugin and install
     # for Tiger and later only
     if [ $majorvers -ge 8 ]; then
@@ -253,6 +285,9 @@ if [ $secondpass = yes ]; then
 
     mkdir $CURDIR/dmg
     mv $CURDIR/OpenAFS.pkg $CURDIR/dmg
+    if [ $majorvers -ge 8 ]; then
+       mv $CURDIR/OpenAFS-debug-extension.pkg $CURDIR/dmg
+    fi
     rm -rf $CURDIR/OpenAFS-@VERSION@-$RELNAME.dmg
     cp $RESSRC/Uninstall $CURDIR/dmg/Uninstall.command
     cp $RESSRC/DS_Store $CURDIR/dmg/.DS_Store