From 2309f3aaa6bd54bac70ea35c6da46981cfc52129 Mon Sep 17 00:00:00 2001 From: Evan Lucas Date: Tue, 11 Jul 2017 19:04:53 -0500 Subject: [PATCH 1/2] build,tools: do not force codesign prefix Allow passing the prefix in via the PKGDIR env var. This will allow us to use this same script to codesign the binary tarball. PR-URL: https://github.com/nodejs/node/pull/14179 Reviewed-By: Refael Ackermann Reviewed-By: Ben Noordhuis Reviewed-By: Myles Borins Reviewed-By: Gibson Fahnestock Reviewed-By: James M Snell --- Makefile | 3 ++- tools/osx-codesign.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 01716fc7317e82..69813e89621e38 100644 --- a/Makefile +++ b/Makefile @@ -702,7 +702,8 @@ $(PKG): release-only --release-urlbase=$(RELEASE_URLBASE) \ $(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS) $(MAKE) install V=$(V) DESTDIR=$(PKGDIR) - SIGN="$(CODESIGN_CERT)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh + SIGN="$(CODESIGN_CERT)" PKGDIR="$(PKGDIR)/usr/local" bash \ + tools/osx-codesign.sh cat tools/osx-pkg.pmdoc/index.xml.tmpl \ | sed -E "s/\\{nodeversion\\}/$(FULLVERSION)/g" \ | sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \ diff --git a/tools/osx-codesign.sh b/tools/osx-codesign.sh index 5c2d1aff34d8fd..6a954c737fa4c5 100644 --- a/tools/osx-codesign.sh +++ b/tools/osx-codesign.sh @@ -8,4 +8,4 @@ if [ "X$SIGN" == "X" ]; then exit 0 fi -codesign -s "$SIGN" "$PKGDIR"/usr/local/bin/node +codesign -s "$SIGN" "$PKGDIR"/bin/node From e36166bd18add8e6f5727a2173c5e5405bf382ef Mon Sep 17 00:00:00 2001 From: Evan Lucas Date: Tue, 11 Jul 2017 19:05:39 -0500 Subject: [PATCH 2/2] build: codesign tarball binary on macOS Previously, we were signing the binary that was released in the .pkg, but not the binary released in the tarball. PR-URL: https://github.com/nodejs/node/pull/14179 Fixes: https://github.com/nodejs/node/issues/11936 Reviewed-By: Refael Ackermann Reviewed-By: Ben Noordhuis Reviewed-By: Myles Borins Reviewed-By: Gibson Fahnestock Reviewed-By: James M Snell --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 69813e89621e38..6c7986779421b9 100644 --- a/Makefile +++ b/Makefile @@ -808,6 +808,9 @@ $(BINARYTAR): release-only cp README.md $(BINARYNAME) cp LICENSE $(BINARYNAME) cp CHANGELOG.md $(BINARYNAME) +ifeq ($(OSTYPE),darwin) + SIGN="$(CODESIGN_CERT)" PKGDIR="$(BINARYNAME)" bash tools/osx-codesign.sh +endif tar -cf $(BINARYNAME).tar $(BINARYNAME) $(RM) -r $(BINARYNAME) gzip -c -f -9 $(BINARYNAME).tar > $(BINARYNAME).tar.gz