diff --git a/support/version.awk b/support/version.awk new file mode 100644 index 00000000..ceb1482f --- /dev/null +++ b/support/version.awk @@ -0,0 +1,67 @@ +#!/usr/bin/awk +# +# Mac ZFS 'official' releases are tagged as follows: +# +# maczfs_(-)? +# +# where onnvsync is the number corresponding to the onnv release +# e.g. maczfs_72 corresponds with onnv_72 +# +# Should additional releases on the same tag happen, then they +# will be denoted as: +# maczfs_72-01 +# maczfs_72-02 +# and so on +# +# These are then pulled out with git describe to get the offset +# from the original release e.g. +# maczfs_72-8-g626d83e +# +# The -8- indicates 8 commits since maczfs_72 was released; the +# g626d83e is commit node at the current stage. From this, we +# can recreate any version of the build. +# +# These are merged into version numbers as follows: +# +# .. +# +# If rel is missing in the original tag, then it is treated as 0. +# +# So, a git describe of: +# +# maczfs_72-8-g626d83e +# +# will result in a version of 72.0.8, whilst a git describe of: +# +# maczfs_72-01-3-b58df311 +# +# will result in a version number of 72.1.3. +# +# This version number is used as the kernel module version, the +# ZFS project identifier, and the Info.plist entries, as stamped by the +# build script in the zfs.kext target. +# +BEGIN { + FS = "_|-"; +} + +function max(a,b) { + if (int(a) /tmp/env\n\t/usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString ${DESCRIPTION}\" \"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\"\n\tVERSION=`echo ${DESCRIPTION} | awk -f ${SOURCE_ROOT}/support/version.awk`\n\tif [ -n \"${VERSION}\" ]\n\tthen\n\t\t/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion ${VERSION}\" \"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\"\n\t\tsed -e \"s/0\\\\.0\\\\.0/${VERSION}/\" -i \"~\" ${DERIVED_FILE_DIR}/zfs_info.c\n\t\tsed -e \"s/zfs-/${DESCRIPTION}/\" -i \"~\" ${DERIVED_FILE_DIR}/zfs_vers.c\n\tfi\n\tls -lR ${DERIVED_FILES_DIR} > /tmp/dircontents.txt\nfi\n"; + showEnvVarsInLog = 0; + }; + FA2B7C1311E71A34000DE8DF /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = "# Get a list of all maczfs_* tags, sorted in reverse numerical order\n# Note that both Git and awk needs to be on the path, or this step won't work\n# TODO Consider packing this into a script\n\nDESCRIPTION=`git describe --tags --long --match 'maczfs*' 2> /dev/null`\n\nif [ -n \"${DESCRIPTION}\" ]\nthen\n\tenv > /tmp/env\n\t/usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString ${DESCRIPTION}\" \"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\"\n\tVERSION=`echo ${DESCRIPTION} | awk -f ${SOURCE_ROOT}/support/version.awk`\n\tif [ -n \"${VERSION}\" ]\n\tthen\n\t\t/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion ${VERSION}\" \"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\"\n\tfi\nfi\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 2611F7330ACDD13900E5D4E2 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -1908,10 +1940,10 @@ INSTALL_GROUP = wheel; INSTALL_OWNER = root; INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Extensions"; - MODULE_NAME = com.apple.filesystems.zfs; + MODULE_NAME = com.bandlem.mac.zfs.fs; MODULE_START = zfs_module_start; MODULE_STOP = zfs_module_stop; - MODULE_VERSION = 8.0; + MODULE_VERSION = 0.0.0; OTHER_LDFLAGS = ""; PRODUCT_NAME = zfs; VERSIONING_SYSTEM = "apple-generic"; @@ -1944,10 +1976,10 @@ GCC_WARN_UNUSED_VARIABLE = NO; INFOPLIST_FILE = zfs_kext/Info.plist; INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Extensions"; - MODULE_NAME = com.apple.filesystems.zfs; + MODULE_NAME = com.bandlem.mac.zfs.fs; MODULE_START = zfs_module_start; MODULE_STOP = zfs_module_stop; - MODULE_VERSION = 8.0; + MODULE_VERSION = 0.0.0; PRODUCT_NAME = zfs; VALID_ARCHS = "i386 ppc ppc7400 ppc970 x86_64"; VERSIONING_SYSTEM = "apple-generic"; diff --git a/zfs_bundle/Info.plist b/zfs_bundle/Info.plist index 934e3cd9..8aa82af7 100644 --- a/zfs_bundle/Info.plist +++ b/zfs_bundle/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleIdentifier - com.apple.filesystems.util.zfs + com.bandlem.mac.zfs.util CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -15,9 +15,9 @@ CFBundleSignature ???? CFBundleVersion - 8.0 + 0.0 CFBundleShortVersionString - 8.0 + 0.0 FSMediaTypes 6A898CC3-1DD2-11B2-99A6-080020736631