From: Eric Bollengier Date: Wed, 3 Feb 2021 17:03:23 +0000 (+0100) Subject: win32: Backport signing procedures to 11.0 X-Git-Tag: Release-11.0.1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afc806a7b7d2724d92fac5dcf2a42b47c87e62a2;p=thirdparty%2Fbacula.git win32: Backport signing procedures to 11.0 --- diff --git a/bacula/src/win32/Makefile b/bacula/src/win32/Makefile index 198254e4e..1bbbf2142 100644 --- a/bacula/src/win32/Makefile +++ b/bacula/src/win32/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2000-2020 Kern Sibbald +# Copyright (C) 2000-2021 Kern Sibbald # License: BSD 2-Clause; see file LICENSE-FOSS # # Makefile for Win32/Win64 Bacula File daemon @@ -58,6 +58,7 @@ release32/bat.exe: is_depkgs_set ( cd ../qt-console; ./make-win32 "32" ) test -f release32/bat.exe test -f release32/bacula-tray-monitor.exe + ./sign-binaries release32/bat.exe release32/bacula-tray-monitor.exe release32/Qt*dll release32/q*.dll bat32: release32/bat.exe release32/bacula-tray-monitor.exe @@ -65,6 +66,7 @@ release64/bat.exe: is_depkgs_set ( cd ../qt-console; ./make-win32 "64" ) test -f release64/bat.exe test -f release64/bacula-tray-monitor.exe + ./sign-binaries release64/bat.exe release64/bacula-tray-monitor.exe release64/Qt*dll release64/q*.dll bat64: release64/bat.exe release64/bacula-tray-monitor.exe diff --git a/bacula/src/win32/Makefile.full b/bacula/src/win32/Makefile.full index 6ab0cd180..649c3ce3a 100644 --- a/bacula/src/win32/Makefile.full +++ b/bacula/src/win32/Makefile.full @@ -1,4 +1,4 @@ -# Copyright (C) 2000-2020 Kern Sibbald +# Copyright (C) 2000-2021 Kern Sibbald # License: BSD 2-Clause; see file LICENSE-FOSS ECHO_CMD=@ diff --git a/bacula/src/win32/Makefile.rules b/bacula/src/win32/Makefile.rules index 915c0a272..f035205c7 100644 --- a/bacula/src/win32/Makefile.rules +++ b/bacula/src/win32/Makefile.rules @@ -4,7 +4,7 @@ # # # Author: Robert Nelson -# Copyright (C) 2000-2020 Kern Sibbald +# Copyright (C) 2000-2021 Kern Sibbald # License: BSD 2-Clause; see file LICENSE-FOSS # # Written by Robert Nelson, June 2006 @@ -36,12 +36,14 @@ define link_conapp @echo "Linking $@" $(call checkdir,$@) $(ECHO_CMD)$(CXX) $(CFLAGS) $(LDFLAGS) -mconsole $^ $(1) -o $@ + $(BUILDDIR)/sign-binaries $@ endef define link_winapp @echo "Linking $@" $(call checkdir,$@) $(ECHO_CMD)$(CXX) $(CFLAGS) $(LDFLAGS) -mwindows $^ $(1) -o $@ + $(BUILDDIR)/sign-binaries $@ endef define makedbg diff --git a/bacula/src/win32/build-depkgs-mingw-w64 b/bacula/src/win32/build-depkgs-mingw-w64 index 4f2a18439..febd80e16 100755 --- a/bacula/src/win32/build-depkgs-mingw-w64 +++ b/bacula/src/win32/build-depkgs-mingw-w64 @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2000-2020 Kern Sibbald +# Copyright (C) 2000-2021 Kern Sibbald # License: BSD 2-Clause; see file LICENSE-FOSS # # This file may help you build the dependency packages that diff --git a/bacula/src/win32/filed/plugins/Makefile b/bacula/src/win32/filed/plugins/Makefile index 800a3a6cf..f9536a33e 100644 --- a/bacula/src/win32/filed/plugins/Makefile +++ b/bacula/src/win32/filed/plugins/Makefile @@ -94,6 +94,7 @@ $(BINDIR)/cdp-fd.dll: $(CDP_OBJS) $(LIBS_BACULA) @echo "Linking $@" $(call checkdir,$@) $(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows -Wl,--out-implib,$(OBJDIR)/cdp-fd.a $^ $(LIBS_DLL) -o $@ + $(BUILDDIR)/sign-binaries $@ #$(LIBDIR)/libexchange-fd.a: DLL_DEFINE=USING_DLL @@ -109,6 +110,7 @@ $(BINDIR)/exchange-fd.dll: $(EXCHANGE_OBJS) exchange-fd.def @echo "Linking $@" $(call checkdir,$@) $(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows -Wl,--out-implib,$(OBJDIR)/exchange-fd.a $^ $(LIBS_DLL) -o $@ + $(BUILDDIR)/sign-binaries $@ $(BINDIR)/bpipe-fd.dll: DLL_DEFINE=BUILDING_DLL @@ -116,6 +118,7 @@ $(BINDIR)/bpipe-fd.dll: $(BPIPE_OBJS) bpipe-fd.def $(LIBS_BACULA) @echo "Linking $@" $(call checkdir,$@) $(ECHO_CMD)$(CXX) $(CFLAGS) $(LDFLAGS) -mdll -mwindows -Wl,--out-implib,$(OBJDIR)/bpipe-fd.a $^ $(LIBS_DLL) -o $@ + $(BUILDDIR)/sign-binaries $@ $(BINDIR)/alldrives-fd.dll: DLL_DEFINE=BUILDING_DLL @@ -123,6 +126,7 @@ $(BINDIR)/alldrives-fd.dll: $(OBJDIR)/alldrives-fd.o $(LIBS_BACULA) @echo "Linking $@" $(call checkdir,$@) $(ECHO_CMD)$(CXX) $(CFLAGS) $(LDFLAGS) -mdll -mwindows -Wl,--out-implib,$(OBJDIR)/alldrives-fd.a $^ $(LIBS_DLL) -o $@ + $(BUILDDIR)/sign-binaries $@ include $(BUILDDIR)/Makefile.rules diff --git a/bacula/src/win32/lib/Makefile b/bacula/src/win32/lib/Makefile index ffe1df5a1..212a9e9fd 100644 --- a/bacula/src/win32/lib/Makefile +++ b/bacula/src/win32/lib/Makefile @@ -174,6 +174,7 @@ $(BINDIR)/bacula.dll: $(DLL_OBJS) bacula$(WIN_VERSION).def @echo "Linking $@" $(call checkdir,$@) $(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows -Wl,--out-implib,$(OBJDIR)/bacula.a $^ $(LIBS_DLL) -o $@ + $(BUILDDIR)/sign-binaries $@ bacula$(WIN_VERSION).def: $(DLL_OBJS) ./make_def$(WIN_VERSION) $(DLL_OBJS) >bacula$(WIN_VERSION).def.new && \ diff --git a/bacula/src/win32/win32_installer/Makefile b/bacula/src/win32/win32_installer/Makefile index 528eea1f9..0af13e14f 100644 --- a/bacula/src/win32/win32_installer/Makefile +++ b/bacula/src/win32/win32_installer/Makefile @@ -11,6 +11,8 @@ include ../Makefile.inc +PWD := $(shell pwd) + VERSION := $(shell sed -ne 's/^.define[ \t]VERSION[ \t][ \t]*"\(.*\)"/\1/p' < ../../version.h) RELEASE ?= $(shell awk '/define RELEASE [0-9]+/ { print $$3 }' ../../version.h) @@ -121,11 +123,13 @@ release32/$$(notdir $(1)): $(1) $$(call checkdir,$$@) $(ECHO_CMD)cp -f $$^ $$@ ; \ $(STAB2CV) $$@ + $(BUILDDIR)/sign-binaries release32/$$(notdir $(1)) endef define Copy_Binary release32/$$(notdir $(1)): $(1) $$(call checkdir,$$@) + $(BUILDDIR)/sign-binaries $$^ $(ECHO_CMD)cp -f $$^ $$@ endef @@ -166,5 +170,6 @@ $(foreach file,$(addprefix $(MAINDIR)/, $(LICENSE_FILES)),$(eval $(call Copy_Lic $(INSTALL_EXE): winbacula.nsi $(addprefix release32/,$(BACULA_BINARIES) $(SCRIPT_FILES) $(CAT_FILES) $(DEPKGS_BINARIES) $(NONGCC_BINARIES) $(NONGCC_LIBRARIES) $(MINGW_BINARIES) $(SSL_FILES) $(DIRD_FILES) $(LICENSE_FILES) ) echo "makensis -V3 $(DEFINES) winbacula.nsi" makensis -V3 $(DEFINES) winbacula.nsi + ../sign-binaries ../release32/bacula-*$(VERSION).exe include $(BUILDDIR)/Makefile.rules diff --git a/bacula/src/win32/win64_installer/Makefile b/bacula/src/win32/win64_installer/Makefile index 7f7b89a94..22861cb27 100644 --- a/bacula/src/win32/win64_installer/Makefile +++ b/bacula/src/win32/win64_installer/Makefile @@ -8,6 +8,8 @@ include ../Makefile.inc +PWD := $(shell pwd) + VERSION := $(shell sed -ne 's/^.define[ \t]VERSION[ \t][ \t]*"\(.*\)"/\1/p' < ../../version.h) RELEASE ?= $(shell awk '/define RELEASE [0-9]+/ { print $$3 }' ../../version.h) @@ -150,12 +152,14 @@ help: define Convert_Binary release64/$$(notdir $(1)): $(1) $$(call checkdir,$$@) + $(BUILDDIR)/sign-binaries $$^ $(ECHO_CMD)cp -f $$^ $$@ endef define Copy_Binary release64/$$(notdir $(1)): $(1) $$(call checkdir,$$@) + $(BUILDDIR)/sign-binaries $$^ $(ECHO_CMD)cp -f $$^ $$@ endef @@ -195,6 +199,7 @@ $(foreach file,$(addprefix $(MAINDIR)/, $(LICENSE_FILES)),$(eval $(call Copy_Lic $(INSTALL_EXE): winbacula.nsi $(addprefix release64/,$(BACULA_BINARIES) $(DEPKGS_BINARIES) $(SSL_FILES) $(LICENSE_FILES)) makensis -V3 $(DEFINES) winbacula.nsi + ../sign-binaries ../release64/bacula-*$(VERSION).exe echo " " include $(BUILDDIR)/Makefile.rules