diff --git a/Configurations/make-release-package.sh b/Configurations/make-release-package.sh index 98cdd7b6..ed5bb4d9 100755 --- a/Configurations/make-release-package.sh +++ b/Configurations/make-release-package.sh @@ -6,18 +6,33 @@ if [ "$ACTION" = "" ] ; then rm -f "Sparkle-$CURRENT_PROJECT_VERSION.tar.bz2" mkdir -p "$CONFIGURATION_BUILD_DIR/staging" - cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging" + cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/INSTALL" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging" cp -R "$SRCROOT/bin" "$CONFIGURATION_BUILD_DIR/staging" cp "$CONFIGURATION_BUILD_DIR/BinaryDelta" "$CONFIGURATION_BUILD_DIR/staging/bin" cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app" "$CONFIGURATION_BUILD_DIR/staging" cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework" "$CONFIGURATION_BUILD_DIR/staging" + mkdir -p "$CONFIGURATION_BUILD_DIR/staging/XPCServices" + + cp -R "$CONFIGURATION_BUILD_DIR/SparkleInstallerLauncher.xpc" "$CONFIGURATION_BUILD_DIR/staging/XPCServices" + cp -R "$CONFIGURATION_BUILD_DIR/SparkleUpdateDownloader.xpc" "$CONFIGURATION_BUILD_DIR/staging/XPCServices" + cp -R "$CONFIGURATION_BUILD_DIR/SparkleAppcastDownloader.xpc" "$CONFIGURATION_BUILD_DIR/staging/XPCServices" + cp -R "$CONFIGURATION_BUILD_DIR/SparkleRemoteMessagePort.xpc" "$CONFIGURATION_BUILD_DIR/staging/XPCServices" + + cp "$SRCROOT/AppcastDownloader/SparkleAppcastDownloader.entitlements" "$CONFIGURATION_BUILD_DIR/staging/XPCServices" + cp "$SRCROOT/UpdateDownloader/SparkleUpdateDownloader.entitlements" "$CONFIGURATION_BUILD_DIR/staging/XPCServices" + # Only copy dSYMs for Release builds, but don't check for the presence of the actual files # because missing dSYMs in a release build SHOULD trigger a build failure if [ "$CONFIGURATION" = "Release" ] ; then cp -R "$CONFIGURATION_BUILD_DIR/BinaryDelta.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin" cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging" cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework.dSYM" "$CONFIGURATION_BUILD_DIR/staging" + + cp -R "$CONFIGURATION_BUILD_DIR/SparkleInstallerLauncher.xpc.dSYM" "$CONFIGURATION_BUILD_DIR/staging/XPCServices" + cp -R "$CONFIGURATION_BUILD_DIR/SparkleUpdateDownloader.xpc.dSYM" "$CONFIGURATION_BUILD_DIR/staging/XPCServices" + cp -R "$CONFIGURATION_BUILD_DIR/SparkleAppcastDownloader.xpc.dSYM" "$CONFIGURATION_BUILD_DIR/staging/XPCServices" + cp -R "$CONFIGURATION_BUILD_DIR/SparkleRemoteMessagePort.xpc.dSYM" "$CONFIGURATION_BUILD_DIR/staging/XPCServices" fi cd "$CONFIGURATION_BUILD_DIR/staging" diff --git a/INSTALL b/INSTALL new file mode 100644 index 00000000..ac6df239 --- /dev/null +++ b/INSTALL @@ -0,0 +1,28 @@ +== Building == + +If release products have not already been built, they can be built by: + +> make release + +Or build the "Distribution" scheme from within the Xcode project. + +Debug builds of Sparkle can also be built from Xcode. Note that debug builds change Sparkle's default behavior to ease development. Never use a debug build of Sparkle for distribution. + +== Installing == + +To install Sparkle, you can copy Sparkle.framework into your project as you would any other framework. Make sure you have a build phase to copy the framework into your application's Frameworks directory. + +Sparkle has a few components that can optionally be handed off to XPC services. If you sandbox your application, you will need to use all or some of these. + +If you code sign your application, these XPC services will also need to be signed by you with the attached entitlements. Included is a script to automate this. + +Here is an example of invoking the script with my Developer ID: +> ./bin/codesign_xpc_services "Developer ID Application" XPCServices/ + +After signing the services, copy them into your project and set up a build phase to embed the XPC Services into your application. + +Then test if your application works :). + +== Known Issues == + +https://github.com/zorgiepoo/sparkle-ui-xpc-issues/issues diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index d1a9cd47..d632166b 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -444,6 +444,34 @@ remoteGlobalIDString = 72E41A3D1CB20BA7003D47E0; remoteInfo = SparkleRemoteMessagePort; }; + 72F94F6A1CC4A0C8002DEE68 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 726E07AC1CAF08D6001A286B; + remoteInfo = SparkleInstallerLauncher; + }; + 72F94F6C1CC4A0C8002DEE68 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 726E07EE1CAF37BD001A286B; + remoteInfo = SparkleUpdateDownloader; + }; + 72F94F6E1CC4A0C8002DEE68 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 728638F21CAF5A5F00783084; + remoteInfo = SparkleAppcastDownloader; + }; + 72F94F701CC4A0C8002DEE68 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 72E41A3D1CB20BA7003D47E0; + remoteInfo = SparkleRemoteMessagePort; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -1754,6 +1782,10 @@ buildWorkingDirectory = ""; dependencies = ( 14732BCB1960F73500593899 /* PBXTargetDependency */, + 72F94F6B1CC4A0C8002DEE68 /* PBXTargetDependency */, + 72F94F6D1CC4A0C8002DEE68 /* PBXTargetDependency */, + 72F94F6F1CC4A0C8002DEE68 /* PBXTargetDependency */, + 72F94F711CC4A0C8002DEE68 /* PBXTargetDependency */, 1454BA1619637EDB00344E57 /* PBXTargetDependency */, 14732BCF1960F73500593899 /* PBXTargetDependency */, 1454BA1819637EE900344E57 /* PBXTargetDependency */, @@ -2698,6 +2730,26 @@ target = 72E41A3D1CB20BA7003D47E0 /* SparkleRemoteMessagePort */; targetProxy = 72F94F671CC48669002DEE68 /* PBXContainerItemProxy */; }; + 72F94F6B1CC4A0C8002DEE68 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 726E07AC1CAF08D6001A286B /* SparkleInstallerLauncher */; + targetProxy = 72F94F6A1CC4A0C8002DEE68 /* PBXContainerItemProxy */; + }; + 72F94F6D1CC4A0C8002DEE68 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 726E07EE1CAF37BD001A286B /* SparkleUpdateDownloader */; + targetProxy = 72F94F6C1CC4A0C8002DEE68 /* PBXContainerItemProxy */; + }; + 72F94F6F1CC4A0C8002DEE68 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 728638F21CAF5A5F00783084 /* SparkleAppcastDownloader */; + targetProxy = 72F94F6E1CC4A0C8002DEE68 /* PBXContainerItemProxy */; + }; + 72F94F711CC4A0C8002DEE68 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 72E41A3D1CB20BA7003D47E0 /* SparkleRemoteMessagePort */; + targetProxy = 72F94F701CC4A0C8002DEE68 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ diff --git a/bin/codesign_xpc_services b/bin/codesign_xpc_services new file mode 100755 index 00000000..2b65f791 --- /dev/null +++ b/bin/codesign_xpc_services @@ -0,0 +1,42 @@ +#!/usr/bin/env python + +import os, sys, subprocess + +def log_message(message): + sys.stderr.write(message + "\n") + +def sanitize(argument): + return ('"' + argument + '"' if ' ' in argument else argument) + +def codesign_service(identity, path, entitlements_path=None): + command = ["codesign", "-fs", identity, path] + ([] if entitlements_path is None else ["--entitlements", entitlements_path]) + log_message(" ".join(map(sanitize, command))) + + process = subprocess.Popen(command, stdout=subprocess.PIPE) + process.communicate() + if process.returncode != 0: + log_message("Error: Failed to codesign %s" % (path)) + sys.exit(1) + +if __name__ == "__main__": + if len(sys.argv) < 3: + log_message("Usage:\n\t%s " % (sys.argv[0])) + log_message("Example:\n\t%s \"Developer ID Application\" ./XPCServices" % (sys.argv[0])) + sys.exit(1) + + signing_identity = sys.argv[1] + xpc_services = sys.argv[2] + + if os.path.islink(xpc_services) or not os.path.isdir(xpc_services): + log_message("Error: %s is not a directory" % (xpc_services)) + sys.exit(1) + + for filename in os.listdir(xpc_services): + if filename.startswith(".") or not os.path.splitext(filename)[1] == ".xpc": + continue + + service_path = os.path.join(xpc_services, filename) + service_name = os.path.splitext(filename)[0] + entitlements_path = os.path.join(xpc_services, service_name + ".entitlements") + + codesign_service(signing_identity, service_path, None if not os.path.exists(entitlements_path) else entitlements_path)