Auto-detect windows signing stuff
authorKeith Packard <keithp@keithp.com>
Sat, 29 Oct 2022 04:57:02 +0000 (21:57 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 29 Oct 2022 04:57:48 +0000 (21:57 -0700)
Still build installers even without signing key

Signed-off-by: Keith Packard <keithp@keithp.com>
altosui/Makefile.am
configure.ac
micropeak/Makefile.am
telegps/Makefile.am

index c2df5de720b06d050c64af194df8ccae27953b03..41f0d6ad4085de9ecc283b5cdd1cd19f27a9a3e4 100644 (file)
@@ -1,5 +1,4 @@
 # location of code signing key, et al
-CODEKEYDIR=~/altusmetrumllc/ssl.com
 
 JAVAROOT=classes
 AM_JAVACFLAGS=$(JAVAC_VERSION_FLAGS) -encoding UTF-8 -Xlint:deprecation -Xlint:unchecked
@@ -413,7 +412,8 @@ $(MACOSX_DIST): $(MACOSX_FILES) $(MACOSX_EXTRA) Makefile
 $(WINDOWS_DIST): $(WINDOWS_FILES) altos-windows.nsi Instdrv/NSIS/Includes/java.nsh
        -rm -f $@
        makensis -Oaltos-windows.log "-XOutFile $@" "-DVERSION=$(VERSION)" altos-windows.nsi || (cat altos-windows.log && exit 1)
-       jsign --keystore $(CODEKEYDIR)/altus_metrum,_llc.p12 --alias 1 \
-               --storetype PKCS12 --storepass `cat $(CODEKEYDIR)/password` \
-               --tsaurl http://ts.ssl.com --tsmode RFC3161 $@
-
+       if [ "$(HAVE_WINDOWS_KEY)" = "yes" ]; then \
+       jsign --keystore "$(WINDOWSKEYFILE)" --alias 1 \
+               --storetype PKCS12 --storepass `cat "$(WINDOWSKEYPASSFILE)"` \
+               --tsaurl http://ts.ssl.com --tsmode RFC3161 $@ ; \
+       fi
index d4164741f882d5a759bb4700d0edf707ea214855..b0de2d5559614512bc16b49a968bbe99a4a7748a 100644 (file)
@@ -200,6 +200,22 @@ else
        HAVE_GOOGLE_KEY="no"
 fi
 
+AC_ARG_WITH(windows-key, AS_HELP_STRING([--with-windows-key=PATH],
+            [Set the file containing the Windows installer signing key (defaults to ~/altusmetrumllc/ssl.com/altus_metrum,_llc.p12)]),
+           [WINDOWSKEYFILE="$withval"], [WINDOWSKEYFILE=$HOME/altusmetrumllc/ssl.com/altus_metrum,_llc.p12])
+
+AC_ARG_WITH(windows-key-pass, AS_HELP_STRING([--with-windows-key-pass=PATH],
+            [Set the file containing the Windows installer signing key password (defaults to ~/altusmetrumllc/ssl.com/password)]),
+           [WINDOWSKEYPASSFILE="$withval"], [WINDOWSKEYPASSFILE=$HOME/altusmetrumllc/ssl.com/password])
+
+AC_CHECK_PROG(jsign, jsign, "yes", "no")
+
+if test -s "$WINDOWSKEYFILE" -a -s "$WINDOWSKEYPASSFILE" -a "$jsign" = yes; then
+       HAVE_WINDOWS_KEY="yes"
+else
+       HAVE_WINDOWS_KEY="no"
+fi
+
 WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs"
 AC_SUBST(WARN_CFLAGS)
 
@@ -210,6 +226,9 @@ AC_ARG_ENABLE(faketime, AS_HELP_STRING([--enable-faketime],
 AM_CONDITIONAL(FAKETIME, [test x$FAKETIME = xyes])
 
 AC_SUBST(GOOGLEKEY)
+AC_SUBST(WINDOWSKEYFILE)
+AC_SUBST(WINDOWSKEYPASSFILE)
+AC_SUBST(HAVE_WINDOWS_KEY)
 
 AC_PROG_CC
 AC_PROG_INSTALL
@@ -585,6 +604,7 @@ echo "    jfreechart..................: ${JFREECHART}"
 echo "    jcommon.....................: ${JCOMMON}"
 echo "    JVM include.................: ${JVM_INCLUDE}"
 echo "    AltosDroid maps API key.....: ${HAVE_GOOGLE_KEY}"
+echo "    Windows installer key.......: ${HAVE_WINDOWS_KEY}"
 if test x${ANDROID_SDK} != "xno"; then
 echo ""
 echo "  Android path"
index 017f5348d5ddb015ea9781b5c5b22c613d72bdaf..bd938e2513ed5ede19b7dae7a1b8f56ed4745fe7 100644 (file)
@@ -1,5 +1,4 @@
 # location of code signing key, et al
-CODEKEYDIR=~/altusmetrumllc/ssl.com
  
 JAVAROOT=classes
 AM_JAVACFLAGS=$(JAVAC_VERSION_FLAGS) -encoding UTF-8 -Xlint:deprecation -Xlint:unchecked
@@ -348,9 +347,11 @@ $(MACOSX_DIST): $(MACOSX_FILES)
 $(WINDOWS_DIST): $(WINDOWS_FILES) micropeak-windows.nsi
        -rm -f $@
        makensis -Omicropeak-windows.log "-XOutFile $@" "-DVERSION=$(VERSION)" micropeak-windows.nsi || (cat micropeak-windows.log && exit 1)
-       jsign --keystore $(CODEKEYDIR)/altus_metrum,_llc.p12 --alias 1 \
-               --storetype PKCS12 --storepass `cat $(CODEKEYDIR)/password` \
-               --tsaurl http://ts.ssl.com --tsmode RFC3161 $@
+       if [ "$(HAVE_WINDOWS_KEY)" = "yes" ]; then \
+       jsign --keystore "$(WINDOWSKEYFILE)" --alias 1 \
+               --storetype PKCS12 --storepass `cat "$(WINDOWSKEYPASSFILE)"` \
+               --tsaurl http://ts.ssl.com --tsmode RFC3161 $@ ; \
+       fi
 
 Manifest.txt: Makefile
        echo 'Main-Class: org.altusmetrum.micropeak.MicroPeak' > $@
index 067df0c740b33d912e885b6f84f4fdeee8788d59..9388f3ba0b84f8752d44331543d89a32144e1862 100644 (file)
@@ -1,5 +1,4 @@
 # location of code signing key, et al
-CODEKEYDIR=~/altusmetrumllc/ssl.com
  
 JAVAROOT=classes
 AM_JAVACFLAGS=$(JAVAC_VERSION_FLAGS) -encoding UTF-8 -Xlint:deprecation -Xlint:unchecked
@@ -340,9 +339,11 @@ $(MACOSX_DIST): $(MACOSX_FILES) $(MACOSX_EXTRA) Makefile
 $(WINDOWS_DIST): $(WINDOWS_FILES) telegps-windows.nsi
        -rm -f $@
        makensis -Otelegps-windows.log "-XOutFile $@" "-DVERSION=$(VERSION)" telegps-windows.nsi || (cat telegps-windows.log && exit 1)
-       jsign --keystore $(CODEKEYDIR)/altus_metrum,_llc.p12 --alias 1 \
-               --storetype PKCS12 --storepass `cat $(CODEKEYDIR)/password` \
-               --tsaurl http://ts.ssl.com --tsmode RFC3161 $@
+       if [ "$(HAVE_WINDOWS_KEY)" = "yes" ]; then \
+       jsign --keystore "$(WINDOWSKEYFILE)" --alias 1 \
+               --storetype PKCS12 --storepass `cat "$(WINDOWSKEYPASSFILE)"` \
+               --tsaurl http://ts.ssl.com --tsmode RFC3161 $@ ; \
+       fi
 
 Manifest.txt: Makefile
        echo 'Main-Class: org.altusmetrum.telegps.TeleGPS' > $@