Blame SOURCES/pki-core-eliminate-duplicate-classes-in-jars.patch

b9ff42
From 3c6aa16ac1e1350a9700d7a3f9e836a44c9a134e Mon Sep 17 00:00:00 2001
b9ff42
From: "Endi S. Dewata" <edewata@redhat.com>
b9ff42
Date: Wed, 5 Oct 2016 22:58:16 +0200
b9ff42
Subject: [PATCH] Removed duplicate classes.
b9ff42
b9ff42
The CMake scripts have been modified to store compiled Java classes
b9ff42
in separate folders for each JAR files to avoid duplicates.
b9ff42
b9ff42
https://fedorahosted.org/pki/ticket/2505
b9ff42
(cherry picked from commit 0f9212ee0fee093be5e47afc15629d281984ec09)
b9ff42
(cherry picked from commit 9bfe6101e82319d9f14edc0b0c1c16ca02a0f9a4)
b9ff42
---
b9ff42
 CMakeLists.txt                                     | 1 -
b9ff42
 base/ca/src/CMakeLists.txt                         | 4 ++--
b9ff42
 base/common/src/CMakeLists.txt                     | 4 ++--
b9ff42
 base/java-tools/src/CMakeLists.txt                 | 4 ++--
b9ff42
 base/kra/src/CMakeLists.txt                        | 4 ++--
b9ff42
 base/server/cms/src/CMakeLists.txt                 | 4 ++--
b9ff42
 base/server/cmscore/src/CMakeLists.txt             | 4 ++--
b9ff42
 base/symkey/src/CMakeLists.txt                     | 4 ++--
b9ff42
 base/symkey/src/com/netscape/symkey/CMakeLists.txt | 2 +-
b9ff42
 base/util/src/CMakeLists.txt                       | 8 ++++----
b9ff42
 10 files changed, 19 insertions(+), 20 deletions(-)
b9ff42
b9ff42
diff --git a/CMakeLists.txt b/CMakeLists.txt
b9ff42
index c746056..457e144 100644
b9ff42
--- a/CMakeLists.txt
b9ff42
+++ b/CMakeLists.txt
b9ff42
@@ -54,7 +54,6 @@ macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source buil
b9ff42
 include(MacroCopyFile)
b9ff42
 include(Java)
b9ff42
 
b9ff42
-file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/classes)
b9ff42
 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/dist)
b9ff42
 
b9ff42
 # required for all PKI components
b9ff42
diff --git a/base/ca/src/CMakeLists.txt b/base/ca/src/CMakeLists.txt
b9ff42
index 854ce28..e612d72 100644
b9ff42
--- a/base/ca/src/CMakeLists.txt
b9ff42
+++ b/base/ca/src/CMakeLists.txt
b9ff42
@@ -96,7 +96,7 @@ javac(pki-ca-classes
b9ff42
         ${PKI_CMSUTIL_JAR} ${PKI_NSUTIL_JAR}
b9ff42
         ${PKI_CERTSRV_JAR} ${PKI_CMS_JAR} ${PKI_CMSCORE_JAR}
b9ff42
     OUTPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
     DEPENDS
b9ff42
         symkey-jar pki-nsutil-jar pki-cmsutil-jar pki-certsrv-jar pki-cms-jar pki-cmscore-jar
b9ff42
 )
b9ff42
@@ -114,7 +114,7 @@ jar(pki-ca-jar
b9ff42
     PARAMS
b9ff42
         ${CMAKE_CURRENT_BINARY_DIR}/pki-ca.mf
b9ff42
     INPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
     FILES
b9ff42
         com/netscape/ca/*.class
b9ff42
         org/dogtagpki/server/ca/*.class
b9ff42
diff --git a/base/common/src/CMakeLists.txt b/base/common/src/CMakeLists.txt
b9ff42
index ee41b2f..7ce833c 100644
b9ff42
--- a/base/common/src/CMakeLists.txt
b9ff42
+++ b/base/common/src/CMakeLists.txt
b9ff42
@@ -131,7 +131,7 @@ javac(pki-certsrv-classes
b9ff42
         ${JAXRS_API_JAR} ${RESTEASY_JAXRS_JAR} ${RESTEASY_ATOM_PROVIDER_JAR} ${RESTEASY_CLIENT_JAR}
b9ff42
         ${HTTPCLIENT_JAR} ${HTTPCORE_JAR}
b9ff42
     OUTPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
     DEPENDS
b9ff42
         pki-nsutil-jar pki-cmsutil-jar
b9ff42
 )
b9ff42
@@ -149,7 +149,7 @@ jar(pki-certsrv-jar
b9ff42
     PARAMS
b9ff42
         ${CMAKE_CURRENT_BINARY_DIR}/pki-certsrv.mf
b9ff42
     INPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
     FILES
b9ff42
         com/netscape/certsrv/*.class
b9ff42
         org/dogtagpki/tps/*.class
b9ff42
diff --git a/base/java-tools/src/CMakeLists.txt b/base/java-tools/src/CMakeLists.txt
b9ff42
index e7ca5db..6753102 100644
b9ff42
--- a/base/java-tools/src/CMakeLists.txt
b9ff42
+++ b/base/java-tools/src/CMakeLists.txt
b9ff42
@@ -100,7 +100,7 @@ javac(pki-tools-classes
b9ff42
         ${JAXRS_API_JAR} ${RESTEASY_JAXRS_JAR} ${RESTEASY_ATOM_PROVIDER_JAR}
b9ff42
         ${HTTPCLIENT_JAR} ${HTTPCORE_JAR}
b9ff42
     OUTPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
     DEPENDS
b9ff42
         pki-nsutil-jar pki-cmsutil-jar pki-certsrv-jar
b9ff42
 )
b9ff42
@@ -118,7 +118,7 @@ jar(pki-tools-jar
b9ff42
     PARAMS
b9ff42
         ${CMAKE_CURRENT_BINARY_DIR}/pki-tools.mf
b9ff42
     INPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
     FILES
b9ff42
         com/netscape/cmstools/*.class
b9ff42
     DEPENDS
b9ff42
diff --git a/base/kra/src/CMakeLists.txt b/base/kra/src/CMakeLists.txt
b9ff42
index 400ec01..c04d7fe 100644
b9ff42
--- a/base/kra/src/CMakeLists.txt
b9ff42
+++ b/base/kra/src/CMakeLists.txt
b9ff42
@@ -118,7 +118,7 @@ javac(pki-kra-classes
b9ff42
         ${PKI_CMSUTIL_JAR} ${PKI_NSUTIL_JAR}
b9ff42
         ${PKI_CERTSRV_JAR} ${PKI_CMS_JAR} ${PKI_CMSCORE_JAR} ${TOMCAT_CATALINA_JAR}
b9ff42
     OUTPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
     DEPENDS
b9ff42
         symkey-jar pki-nsutil-jar pki-cmsutil-jar pki-certsrv-jar pki-cms-jar pki-cmscore-jar
b9ff42
 )
b9ff42
@@ -136,7 +136,7 @@ jar(pki-kra-jar
b9ff42
     PARAMS
b9ff42
         ${CMAKE_CURRENT_BINARY_DIR}/pki-kra.mf
b9ff42
     INPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
     FILES
b9ff42
         com/netscape/kra/*.class
b9ff42
         org/dogtagpki/server/kra/*.class
b9ff42
diff --git a/base/server/cms/src/CMakeLists.txt b/base/server/cms/src/CMakeLists.txt
b9ff42
index 93f4a8a..447dcb1 100644
b9ff42
--- a/base/server/cms/src/CMakeLists.txt
b9ff42
+++ b/base/server/cms/src/CMakeLists.txt
b9ff42
@@ -133,7 +133,7 @@ javac(pki-cms-classes
b9ff42
         ${JAXRS_API_JAR} ${RESTEASY_JAXRS_JAR} ${RESTEASY_ATOM_PROVIDER_JAR}
b9ff42
         ${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR} ${PKI_CERTSRV_JAR} ${PKI_TOMCAT_JAR}
b9ff42
     OUTPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
     DEPENDS
b9ff42
         pki-nsutil-jar pki-cmsutil-jar pki-certsrv-jar pki-tomcat-jar
b9ff42
 )
b9ff42
@@ -151,7 +151,7 @@ jar(pki-cms-jar
b9ff42
     PARAMS
b9ff42
         ${CMAKE_CURRENT_BINARY_DIR}/pki-cms.mf
b9ff42
     INPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
     FILES
b9ff42
         com/netscape/cms/*.class
b9ff42
         org/dogtagpki/server/*.class
b9ff42
diff --git a/base/server/cmscore/src/CMakeLists.txt b/base/server/cmscore/src/CMakeLists.txt
b9ff42
index 32e4351..fe8dba2 100644
b9ff42
--- a/base/server/cmscore/src/CMakeLists.txt
b9ff42
+++ b/base/server/cmscore/src/CMakeLists.txt
b9ff42
@@ -133,7 +133,7 @@ javac(pki-cmscore-classes
b9ff42
         ${HTTPCLIENT_JAR} ${HTTPCORE_JAR}
b9ff42
         ${NUXWDOG_JAR}
b9ff42
     OUTPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
     DEPENDS
b9ff42
         pki-nsutil-jar pki-cmsutil-jar pki-certsrv-jar pki-cms-jar pki-tomcat-jar
b9ff42
 )
b9ff42
@@ -151,7 +151,7 @@ jar(pki-cmscore-jar
b9ff42
     PARAMS
b9ff42
         ${CMAKE_CURRENT_BINARY_DIR}/pki-cmscore.mf
b9ff42
     INPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
     FILES
b9ff42
         com/netscape/cmscore/*.class
b9ff42
     DEPENDS
b9ff42
diff --git a/base/symkey/src/CMakeLists.txt b/base/symkey/src/CMakeLists.txt
b9ff42
index 9a4e10f..8455d59 100644
b9ff42
--- a/base/symkey/src/CMakeLists.txt
b9ff42
+++ b/base/symkey/src/CMakeLists.txt
b9ff42
@@ -15,14 +15,14 @@ javac(symkey-classes
b9ff42
     CLASSPATH
b9ff42
         ${JSS_JAR}
b9ff42
     OUTPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
 )
b9ff42
 
b9ff42
 jar(symkey-jar
b9ff42
     CREATE
b9ff42
         ${CMAKE_BINARY_DIR}/dist/symkey.jar
b9ff42
     INPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
     FILES
b9ff42
         com/netscape/symkey/*.class
b9ff42
     DEPENDS
b9ff42
diff --git a/base/symkey/src/com/netscape/symkey/CMakeLists.txt b/base/symkey/src/com/netscape/symkey/CMakeLists.txt
b9ff42
index 590a7d8..6915ee9 100644
b9ff42
--- a/base/symkey/src/com/netscape/symkey/CMakeLists.txt
b9ff42
+++ b/base/symkey/src/com/netscape/symkey/CMakeLists.txt
b9ff42
@@ -42,7 +42,7 @@ add_custom_command(
b9ff42
         ${symkey_library_HDRS}
b9ff42
     COMMAND
b9ff42
         ${Java_JAVAH_EXECUTABLE}
b9ff42
-            -classpath ${CMAKE_BINARY_DIR}/classes:${JAVA_LIB_INSTALL_DIR}/jss4.jar
b9ff42
+            -classpath ${CMAKE_CURRENT_BINARY_DIR}/../../../classes:${JAVA_LIB_INSTALL_DIR}/jss4.jar
b9ff42
             -jni -d ${CMAKE_CURRENT_BINARY_DIR}
b9ff42
             com.netscape.symkey.SessionKey
b9ff42
 )
b9ff42
diff --git a/base/util/src/CMakeLists.txt b/base/util/src/CMakeLists.txt
b9ff42
index f374c01..bf531d4 100644
b9ff42
--- a/base/util/src/CMakeLists.txt
b9ff42
+++ b/base/util/src/CMakeLists.txt
b9ff42
@@ -76,7 +76,7 @@ javac(pki-nsutil-classes
b9ff42
         ${APACHE_COMMONS_LANG_JAR} ${LDAPJDK_JAR} ${XALAN_JAR} ${XERCES_JAR}
b9ff42
         ${JSS_JAR} ${COMMONS_CODEC_JAR}
b9ff42
     OUTPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
 )
b9ff42
 
b9ff42
 configure_file(
b9ff42
@@ -92,7 +92,7 @@ jar(pki-nsutil-jar
b9ff42
     PARAMS
b9ff42
         ${CMAKE_CURRENT_BINARY_DIR}/pki-nsutil.mf
b9ff42
     INPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
     FILES
b9ff42
         netscape/*.class
b9ff42
     DEPENDS
b9ff42
@@ -118,7 +118,7 @@ javac(pki-cmsutil-classes
b9ff42
         ${LDAPJDK_JAR} ${XALAN_JAR} ${XERCES_JAR}
b9ff42
         ${JSS_JAR} ${COMMONS_CODEC_JAR} ${NUXWDOG_JAR}
b9ff42
     OUTPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
     DEPENDS
b9ff42
         pki-nsutil-jar
b9ff42
 )
b9ff42
@@ -136,7 +136,7 @@ jar(pki-cmsutil-jar
b9ff42
     PARAMS
b9ff42
         ${CMAKE_CURRENT_BINARY_DIR}/pki-cmsutil.mf
b9ff42
     INPUT_DIR
b9ff42
-        ${CMAKE_BINARY_DIR}/classes
b9ff42
+        ${CMAKE_CURRENT_BINARY_DIR}/classes
b9ff42
     FILES
b9ff42
         com/netscape/cmsutil/*.class
b9ff42
     DEPENDS
b9ff42
-- 
b9ff42
1.8.3.1
b9ff42