Index: build/cackey_osx_build/Template_pmbuild/03libcackey.xml.in ================================================================== --- build/cackey_osx_build/Template_pmbuild/03libcackey.xml.in +++ build/cackey_osx_build/Template_pmbuild/03libcackey.xml.in @@ -1,6 +1,6 @@ - + mil.army.usace.cackeyForMacOsX@@OSXVERSION@@.cackey.pkg 1 ADDED build/cackey_osx_build/Template_pmbuild/04pkcs11tokend-contents.xml.in Index: build/cackey_osx_build/Template_pmbuild/04pkcs11tokend-contents.xml.in ================================================================== --- /dev/null +++ build/cackey_osx_build/Template_pmbuild/04pkcs11tokend-contents.xml.in @@ -0,0 +1,7 @@ + + + owner + mode + group + + ADDED build/cackey_osx_build/Template_pmbuild/04pkcs11tokend.xml.in Index: build/cackey_osx_build/Template_pmbuild/04pkcs11tokend.xml.in ================================================================== --- /dev/null +++ build/cackey_osx_build/Template_pmbuild/04pkcs11tokend.xml.in @@ -0,0 +1,37 @@ + + + mil.army.usace.cackeyForMacOsX@@OSXVERSION@@.PKCS11.pkg + 1 + + + + PKCS11.tokend + /System/Library/Security/tokend/PKCS11.tokend + + + parent + scripts.postinstall.path + scripts.scriptsDirectoryPath.isRelativeType + scripts.scriptsDirectoryPath.path + installTo.isAbsoluteType + installTo.isRelativeType + scripts.postflight.path + relocatable + version + installTo.path + installFrom.path + installTo + + + @@BUILDROOTDIR@@/build/cackey_osx_build/Template_pmbuild/scripts/04pkcs11tokend-post.sh + @@BUILDROOTDIR@@/build/cackey_osx_build/Template_pmbuild/scripts + + + 04pkcs11tokend-contents.xml + /CVS$ + /\.svn$ + /\.cvsignore$ + /\.cvspass$ + /\.DS_Store$ + + Index: build/cackey_osx_build/Template_pmbuild/index.xml.in ================================================================== --- build/cackey_osx_build/Template_pmbuild/index.xml.in +++ build/cackey_osx_build/Template_pmbuild/index.xml.in @@ -17,10 +17,13 @@ + + + \ US Department of Homeland Security\ contact: Roy Keene \ ------------------------------------------------\ +\ +The PKCS11.tokend connector module included in this package is licensed under\ +the APSL. See: http://devel.kvanals.org/PKCS11_Tokend\ \ The following files in the source directory are the intellectual property of the\ Free Software Foundation and are licensed under the terms of the GNU General\ Public License (GPL):\ config.guess, config.sub, install-sh\ @@ -62,10 +68,13 @@ \f0\fs26 \cf0 Thank you for choosing to install CACKey.\ \ To use CACKey, install /Library/CACKey/libcackey.dylib or\ /usr/lib/pkcs11/cackey.dylib as a security module into any application that can use a PKCS#11 provider.\ +\ +A PKCS11 Connector for Tokend (Keychain Access) will be installed in /System/Library/Security/tokend.\ +To use, be sure to import the certificate authorities into Keychain Access.\ \ A debug version, /Library/CACKey/libcackey_g.dylib is provided if debug output is necessary.}]]> @@ -79,11 +88,12 @@ 01libcackey.xml 02libcackey.xml 03libcackey.xml + 04pkcs11tokend.xml properties.customizeOption properties.title description properties.systemDomain properties.anywhereDomain ADDED build/cackey_osx_build/Template_pmbuild/scripts/04pkcs11tokend-post.sh Index: build/cackey_osx_build/Template_pmbuild/scripts/04pkcs11tokend-post.sh ================================================================== --- /dev/null +++ build/cackey_osx_build/Template_pmbuild/scripts/04pkcs11tokend-post.sh @@ -0,0 +1,3 @@ +#!/bin/bash +chmod -R go+rX /System/Library/Security/tokend/PKCS11.tokend +chown -R root:wheel /System/Library/Security/tokend/PKCS11.tokend Index: build/cackey_osx_build/build_osx.sh ================================================================== --- build/cackey_osx_build/build_osx.sh +++ build/cackey_osx_build/build_osx.sh @@ -11,25 +11,24 @@ # Usage function usage() { echo "Usage: build_osx.sh " echo Where target is one of: - echo " panther - (Builds 10.3 Library for PPCG3) (LEGACY)" - echo " tiger - (Builds Universal 10.4 Library for PPCG3/i386) (LEGACY)" echo " leopard - (Builds Universal 10.5 Library for PPCG4/i386)" echo " snowleopard - (Builds Universal 10.6 Library for i386/x86_64)" echo " lion - (Builds Universal 10.7 Library for i386/x86_64)" echo " all - (Builds for all supported targets)" - echo " legacy - (Builds for all supported targets older than 10.7)" echo " clean - (Cleans up)" echo "Run from CACKey Build Root." exit $? } # Clean up function clean() { rm -f build/cackey_osx_build/cackey.dylib + rm -rf build/cackey_osx_build/PKCS11.tokend + rm -rf PKCS11.tokend rm -rf macbuild rm -rf build/cackey_osx_build/*.pmdoc make distclean } @@ -40,12 +39,10 @@ else LIBTOOLDIR=/Developer/usr/share/libtool/config fi if [ ! -d macbuild ]; then mkdir macbuild - mkdir macbuild/Panther - mkdir macbuild/Tiger mkdir macbuild/Leopard mkdir macbuild/Snowleopard mkdir macbuild/Lion mkdir macbuild/pkg fi @@ -58,49 +55,10 @@ if [ ! -f install-sh ]; then cp ${LIBTOOLDIR}/install-sh . fi } -# Build function for Panther -panther() { - makedir - HEADERS=/Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/PCSC.framework/Versions/A/Headers/ - LIBRARY=/Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/PCSC.framework/PCSC - OSX=Panther - PKTARGETOS=1 - NEXTOSXVER=10.4 - CUROSXVER=10.3 - HOST=powerpc-apple-darwin7 - make distclean - ARCH="ppc -mcpu=G3" - CFLAGS="-arch ${ARCH}" ./configure --with-pcsc-headers=${HEADERS} --with-pcsc-libs=${LIBRARY} --host=${HOST} - make - cp libcackey.dylib macbuild/${OSX}/libcackey.dylib - cp libcackey_g.dylib macbuild/${OSX}/libcackey_g.dylib - pkgbuild -} - -# Build function for Tiger -tiger() { - makedir - HEADERS=/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/PCSC.framework/Versions/A/Headers/ - LIBRARY=/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/PCSC.framework/PCSC - LIB="" - ARCHLIST="" - DLIB="" - DARCHLIST="" - OSX=Tiger - PKTARGETOS=2 - NEXTOSXVER=10.5 - CUROSXVER=10.4 - for HOST in powerpc-apple-darwin8 i386-apple-darwin8; do - genbuild - done - libbuild - pkgbuild -} - # Build function for Leopard leopard() { makedir HEADERS=/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/PCSC.framework/Versions/A/Headers/ LIBRARY=/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/PCSC.framework/PCSC @@ -204,10 +162,23 @@ else LIBCACKEYG=libcackey_g.pkg fi rm -f build/cackey_osx_build/cackey.dylib ln macbuild/${OSX}/libcackey.dylib build/cackey_osx_build/cackey.dylib + rm -rf build/cackey_osx_build/PKCS11.tokend + if [ "${LIONBUILD}" = 1 ]; then + TAR=gnutar + else + TAR=tar + fi + if [ "${OSX}" = "Leopard" ]; then + curl http://devel.kvanals.org/PKCS11_Tokend/PKCS11_tokend-latest.tar.gz | ${TAR} --strip-components 3 --wildcards -x -z -f - "PKCS11_tokend-*/prebuilt/leopard/PKCS11.tokend" + mv PKCS11.tokend build/cackey_osx_build/PKCS11.tokend + else + curl http://devel.kvanals.org/PKCS11_Tokend/PKCS11_tokend-latest.tar.gz | ${TAR} --strip-components 3 --wildcards -x -z -f - "PKCS11_tokend-*/prebuilt/snowleopard/PKCS11.tokend" + mv PKCS11.tokend build/cackey_osx_build/PKCS11.tokend + fi for PMDOC in build/cackey_osx_build/Template_pmbuild/*.in; do PMDOC="`echo "${PMDOC}" | sed 's|l.in|l|g' | sed 's|build/cackey_osx_build/Template_pmbuild/||g'`" UUID="`python -c 'import uuid; print uuid.uuid1()' | dd conv=ucase 2>/dev/null`" mkdir -p build/cackey_osx_build/${OSX}_pmbuild.pmdoc sed "s|@@BUILDROOTDIR@@|$(pwd)|g" build/cackey_osx_build/Template_pmbuild/${PMDOC}.in > build/cackey_osx_build/${OSX}_pmbuild.pmdoc/${PMDOC} @@ -218,53 +189,28 @@ sed "s|@@CUROSXVER@@|${CUROSXVER}|g" build/cackey_osx_build/${OSX}_pmbuild.pmdoc/${PMDOC} > build/cackey_osx_build/${OSX}_pmbuild.pmdoc/${PMDOC}.1 sed "s|@@LIBCACKEYG@@|${LIBCACKEYG}|g" build/cackey_osx_build/${OSX}_pmbuild.pmdoc/${PMDOC}.1 > build/cackey_osx_build/${OSX}_pmbuild.pmdoc/${PMDOC} cp build/cackey_osx_build/${OSX}_pmbuild.pmdoc/${PMDOC} build/cackey_osx_build/${OSX}_pmbuild.pmdoc/${PMDOC}.1 mv build/cackey_osx_build/${OSX}_pmbuild.pmdoc/${PMDOC}.1 build/cackey_osx_build/${OSX}_pmbuild.pmdoc/${PMDOC} done - if [ ${OSX} == "Panther" ]; then - EXT=mpkg - cat build/cackey_osx_build/${OSX}_pmbuild.pmdoc/index.xml | grep -v -i require > build/cackey_osx_build/${OSX}_pmbuild.pmdoc/index.xml.new - mv build/cackey_osx_build/${OSX}_pmbuild.pmdoc/index.xml.new build/cackey_osx_build/${OSX}_pmbuild.pmdoc/index.xml - else - EXT=pkg - fi + EXT=pkg if [ ${OSX} == "Snowleopard" ]; then cat build/cackey_osx_build/${OSX}_pmbuild.pmdoc/index.xml | sed 's|for Mac OS X Snowleopard|for Mac OS X SnowLeopard|g' > build/cackey_osx_build/${OSX}_pmbuild.pmdoc/index.xml.new mv build/cackey_osx_build/${OSX}_pmbuild.pmdoc/index.xml.new build/cackey_osx_build/${OSX}_pmbuild.pmdoc/index.xml fi /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker -d build/cackey_osx_build/${OSX}_pmbuild.pmdoc -o macbuild/pkg/CACKey_${CACKEY_VERSION}_${OSX}.${EXT} tar --create --directory macbuild/pkg/ --file macbuild/pkg/CACKey_${CACKEY_VERSION}_${OSX}.${EXT}.tar CACKey_${CACKEY_VERSION}_${OSX}.${EXT} gzip -9 macbuild/pkg/CACKey_${CACKEY_VERSION}_${OSX}.${EXT}.tar rm -rf macbuild/pkg/CACKey_${CACKEY_VERSION}_${OSX}.${EXT} rm -f build/cackey_osx_build/cackey.dylib + rm -rf build/cackey_osx_build/PKCS11.tokend echo "${OSX} build complete" } # Take command line arguments and execute case "$1" in "") usage - exit $? - ;; - - "panther") - if [ "${LIONBUILD}" = "1" ]; then - echo "Building for platforms older than Mac OS X 10.5 (Leopard) is not supported on Lion..." - exit 1 - fi - ./autogen.sh - panther - exit $? - ;; - - "tiger") - if [ "${LIONBUILD}" = "1" ]; then - echo "Building for platforms older than Mac OS X 10.5 (Leopard) is not supported on Lion..." - exit 1 - fi - ./autogen.sh - tiger exit $? ;; "leopard") ./autogen.sh @@ -292,25 +238,10 @@ echo "" echo "All builds complete." exit $? ;; - "legacy") - if [ "${LIONBUILD}" = "1" ]; then - echo "Building for platforms older than Mac OS X 10.5 (Leopard) is not supported on Lion..." - exit 1 - fi - ./autogen.sh - panther - tiger - leopard - snowleopard - echo "" - echo "All LEGACY builds complete." - exit $? - ;; - "clean") clean exit $? ;;