1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-15 04:05:38 +02:00

Bug 572878: Rewrite signing of dlls to preserve full file name

This is a fixup of the previous commits which has some basic
shell errors

Change-Id: I9572148d0fa9c6fdad5c6e256d6ccabaed9c8a9c
This commit is contained in:
Jonah Graham 2021-05-18 11:20:18 -04:00
parent 2ec6d64b1b
commit 02286a6a34
2 changed files with 30 additions and 10 deletions

View file

@ -12,7 +12,7 @@
# QNX Software Systems - initial API and implementation
# Torbjörn Svensson - Bug 521515 - Adopted jenkins build
#*******************************************************************************/
SHELL=/bin/bash -o pipefail
ifeq ($(JAVA_HOME),)
$(error JAVA_HOME not set in environment)
endif
@ -73,12 +73,22 @@ MAC_TO_SIGN=$(OS_DIR_MACOS_X86_64)/libspawner.jnilib \
WIN_TO_SIGN=$(OS_DIR_WIN32_X86_64)/starter.exe \
$(OS_DIR_WIN32_X86_64)/spawner.dll \
$(OS_DIR_WIN32_X86_64)/pty.dll
### This block of code also exists in native/org.eclipse.cdt.native.serial/native_src/Makefile
TMPDIR := $(shell mktemp -d -t production-XXXXXXXXXX)
.PHONY: production
production: $(MAC_TO_SIGN) $(WIN_TO_SIGN)
$(foreach tosign,$(MAC_TO_SIGN) $(WIN_TO_SIGN),mv $(tosign) $(TMPDIR)$(tosign) &&) true
$(foreach tosign,$(MAC_TO_SIGN),curl -f --silent --show-error -o $(tosign) -F file=@$(TMPDIR)$(tosign) https://cbi.eclipse.org/macos/codesign/sign &&) true
$(foreach tosign,$(WIN_TO_SIGN),curl -f --silent --show-error -o $(tosign) -F file=@$(TMPDIR)$(tosign) https://cbi.eclipse.org/authenticode/sign &&) true
$(foreach tosign,$(MAC_TO_SIGN) $(WIN_TO_SIGN),rm $(TMPDIR)$(tosign) &&) true
set -x ; $(foreach tosign,$(MAC_TO_SIGN),\
temp=$(TMPDIR)/$(shell basename $(tosign)) && \
mv $(tosign) $$temp && \
curl -f --silent --show-error -o $(tosign) -F file=@$$temp https://cbi.eclipse.org/macos/codesign/sign && \
rm $$temp && \
) true
set -x ; $(foreach tosign,$(WIN_TO_SIGN),\
temp=$(TMPDIR)/$(shell basename $(tosign)) && \
mv $(tosign) $$temp && \
curl -f --silent --show-error -o $(tosign) -F file=@$$temp https://cbi.eclipse.org/authenticode/sign && \
rm $$temp && \
) true
rmdir $(TMPDIR)

View file

@ -12,7 +12,7 @@
# QNX Software Systems - initial API and implementation
# Alex Blewitt - MacOSX with a 64-bit vm
#*******************************************************************************/
SHELL=/bin/bash -o pipefail
ifeq ($(JAVA_HOME),)
$(error Please define JAVA_HOME)
endif
@ -49,12 +49,22 @@ clean :
MAC_TO_SIGN=$(OS_DIR)/macosx/x86_64/libserial.jnilib
WIN_TO_SIGN=$(OS_DIR)/win32/x86_64/serial.dll
### This block of code also exists in core/org.eclipse.cdt.core.native/native_src/Makefile
TMPDIR := $(shell mktemp -d -t production-XXXXXXXXXX)
.PHONY: production
production: $(MAC_TO_SIGN) $(WIN_TO_SIGN)
$(foreach tosign,$(MAC_TO_SIGN) $(WIN_TO_SIGN),mv $(tosign) $(TMPDIR)$(tosign) &&) true
$(foreach tosign,$(MAC_TO_SIGN),curl -f --silent --show-error -o $(tosign) -F file=@$(TMPDIR)$(tosign) https://cbi.eclipse.org/macos/codesign/sign &&) true
$(foreach tosign,$(WIN_TO_SIGN),curl -f --silent --show-error -o $(tosign) -F file=@$(TMPDIR)$(tosign) https://cbi.eclipse.org/authenticode/sign &&) true
$(foreach tosign,$(MAC_TO_SIGN) $(WIN_TO_SIGN),rm $(TMPDIR)$(tosign) &&) true
set -x ; $(foreach tosign,$(MAC_TO_SIGN),\
temp=$(TMPDIR)/$(shell basename $(tosign)) && \
mv $(tosign) $$temp && \
curl -f --silent --show-error -o $(tosign) -F file=@$$temp https://cbi.eclipse.org/macos/codesign/sign && \
rm $$temp && \
) true
set -x ; $(foreach tosign,$(WIN_TO_SIGN),\
temp=$(TMPDIR)/$(shell basename $(tosign)) && \
mv $(tosign) $$temp && \
curl -f --silent --show-error -o $(tosign) -F file=@$$temp https://cbi.eclipse.org/authenticode/sign && \
rm $$temp && \
) true
rmdir $(TMPDIR)