Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Commit

Permalink
Use Bandlem.com identifiers and versions
Browse files Browse the repository at this point in the history
The version number is now calculated automatically
and is updated whenever the project is built, based
on the git version. The version number is calculated
from git describe as:

maczfs_<onnv>-<rel>-<commit>-hash
  • Loading branch information
alblue committed Jul 9, 2010
1 parent 626d83e commit cc76e2f
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 7 deletions.
67 changes: 67 additions & 0 deletions support/version.awk
@@ -0,0 +1,67 @@
#!/usr/bin/awk
#
# Mac ZFS 'official' releases are tagged as follows:
#
# maczfs_<onnvsnyc>(-<rel>)?
#
# 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:
#
# <onnvsync>.<rel>.<commits>
#
# 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)<int(b))
return int(a)
else
return int(b)
}

/maczfs_/ {
ONNV = $2
if (NF<5) {
REL = 0
COMMIT = max($3,99)
} else {
REL = max($3,99)
COMMIT = max($4,99)
}
print ONNV "." REL "." COMMIT
}


40 changes: 36 additions & 4 deletions zfs.xcodeproj/project.pbxproj
Expand Up @@ -1414,6 +1414,7 @@
buildConfigurationList = 2611F7600ACDD4E200E5D4E2 /* Build configuration list for PBXNativeTarget "zfs.fs" */;
buildPhases = (
2611F75A0ACDD4E100E5D4E2 /* Resources */,
FA2B7C1311E71A34000DE8DF /* ShellScript */,
2611F8000ACDE6EF00E5D4E2 /* CopyFiles */,
265DACE90AE8948A00EBFDCE /* CopyFiles */,
D9B898020BF3AD2500F648C1 /* CopyFiles */,
Expand Down Expand Up @@ -1504,6 +1505,7 @@
buildConfigurationList = 1DEB91C308733DAC0010E9CD /* Build configuration list for PBXNativeTarget "zfs.kext" */;
buildPhases = (
32A4FEBB0562C75700D090E7 /* Resources */,
FA17B50211E1D47A00D5C55B /* ShellScript */,
32A4FEBD0562C75700D090E7 /* Sources */,
32A4FEBF0562C75700D090E7 /* Frameworks */,
);
Expand Down Expand Up @@ -1598,6 +1600,36 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
FA17B50211E1D47A00D5C55B /* 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\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;
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down
6 changes: 3 additions & 3 deletions zfs_bundle/Info.plist
Expand Up @@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.filesystems.util.zfs</string>
<string>com.bandlem.mac.zfs.util</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand All @@ -15,9 +15,9 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>8.0</string>
<string>0.0</string>
<key>CFBundleShortVersionString</key>
<string>8.0</string>
<string>0.0</string>
<key>FSMediaTypes</key>
<dict>
<key>6A898CC3-1DD2-11B2-99A6-080020736631</key>
Expand Down

0 comments on commit cc76e2f

Please sign in to comment.