From 11ca3b4c77a4cb2c2bb83427de3aa03bf319001c Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 5 Oct 2011 07:53:29 +0000 Subject: [PATCH] Sign the JAR file so clipboard transfer will work git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4699 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- cmake/SignJar.cmake | 20 ++++++++++++++++++++ java/src/CMakeLists.txt | 7 +++++++ 2 files changed, 27 insertions(+) create mode 100644 cmake/SignJar.cmake diff --git a/cmake/SignJar.cmake b/cmake/SignJar.cmake new file mode 100644 index 00000000..00c99395 --- /dev/null +++ b/cmake/SignJar.cmake @@ -0,0 +1,20 @@ +if(NOT Java_PATH) + message(FATAL_ERROR "Java_PATH must be defined") +endif() + +if(NOT JAR_FILE) + message(FATAL_ERROR "JAR_FILE must be defined") +endif() + +set(KEYTOOL "${Java_PATH}/keytool") +set(JARSIGNER "${Java_PATH}/jarsigner") + +file(REMOVE tigervnc.keystore) +execute_process(COMMAND + ${KEYTOOL} -genkey -alias TigerVNC -keystore tigervnc.keystore -keyalg RSA + -storepass tigervnc -keypass tigervnc -validity 7300 + -dname "CN=TigerVNC, OU=Software Development, O=The TigerVNC Project, L=Austin, S=Texas, C=US") +execute_process(COMMAND + ${JARSIGNER} -keystore tigervnc.keystore + -storepass tigervnc -keypass tigervnc ${JAR_FILE} TigerVNC) +file(REMOVE tigervnc.keystore) diff --git a/java/src/CMakeLists.txt b/java/src/CMakeLists.txt index f5d18227..7ab9fc67 100644 --- a/java/src/CMakeLists.txt +++ b/java/src/CMakeLists.txt @@ -92,6 +92,13 @@ add_custom_command(OUTPUT VncViewer.jar add_custom_target(java ALL DEPENDS VncViewer.jar) +string(REGEX REPLACE "jar" "" Java_PATH ${Java_JAR_EXECUTABLE}) + +add_custom_command(TARGET java POST_BUILD COMMAND + ${CMAKE_COMMAND} -DJava_PATH=${Java_PATH} + -DJAR_FILE=${CMAKE_CURRENT_BINARY_DIR}/VncViewer.jar + -P ${CMAKE_SOURCE_DIR}/cmake/SignJar.cmake) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/VncViewer.jar ${JAVA_SRCDIR}/README -- 2.39.5