>From c44c6c4f9e5e325d071659c555f302f0ae78f5cb Mon Sep 17 00:00:00 2001
From: "Endi S. Dewata" <edewata@redhat.com>
Date: Fri, 4 Nov 2016 21:32:01 +0100
Subject: [PATCH] Generalized list of files in CMakeLists.txt.

The list of source and class files in some CMake files have been
generalized to allow renaming Java packages without changing the
CMake files again.

https://fedorahosted.org/pki/ticket/6
---
 base/ca/src/CMakeLists.txt             | 6 +-----
 base/common/src/CMakeLists.txt         | 4 ----
 base/console/src/CMakeLists.txt        | 4 +---
 base/java-tools/src/CMakeLists.txt     | 4 +---
 base/kra/src/CMakeLists.txt            | 6 +-----
 base/ocsp/src/CMakeLists.txt           | 6 +-----
 base/server/cms/src/CMakeLists.txt     | 8 +-------
 base/server/cmscore/src/CMakeLists.txt | 4 +---
 base/server/test/CMakeLists.txt        | 2 +-
 base/server/tomcat/src/CMakeLists.txt  | 2 +-
 base/server/tomcat7/src/CMakeLists.txt | 4 +---
 base/server/tomcat8/src/CMakeLists.txt | 4 +---
 base/symkey/src/CMakeLists.txt         | 4 +---
 base/test/src/CMakeLists.txt           | 2 +-
 base/tks/src/CMakeLists.txt            | 6 +-----
 base/tps/src/CMakeLists.txt            | 4 +---
 16 files changed, 15 insertions(+), 55 deletions(-)

diff --git a/base/ca/src/CMakeLists.txt b/base/ca/src/CMakeLists.txt
index e612d726e92711b6a25859cc80fe5c460d88c634..faa56281462e56e3f403efddec0b3415eb9c8384 100644
--- a/base/ca/src/CMakeLists.txt
+++ b/base/ca/src/CMakeLists.txt
@@ -84,8 +84,7 @@ find_file(TOMCAT_CATALINA_JAR
 # build pki-ca
 javac(pki-ca-classes
     SOURCES
-        com/netscape/ca/*.java
-        org/dogtagpki/server/ca/*.java
+        *.java
     CLASSPATH
         ${COMMONS_CODEC_JAR} ${COMMONS_IO_JAR} ${COMMONS_LANG_JAR}
         ${JACKSON_CORE_JAR} ${JACKSON_MAPPER_JAR}
@@ -115,9 +114,6 @@ jar(pki-ca-jar
         ${CMAKE_CURRENT_BINARY_DIR}/pki-ca.mf
     INPUT_DIR
         ${CMAKE_CURRENT_BINARY_DIR}/classes
-    FILES
-        com/netscape/ca/*.class
-        org/dogtagpki/server/ca/*.class
     DEPENDS
         pki-ca-classes
 )
diff --git a/base/common/src/CMakeLists.txt b/base/common/src/CMakeLists.txt
index 7ce833c6c75dc7cd8c909c2c0a5a2106f1520d32..72815bbfed37cf9a42a10083ecb50e0f2192eff6 100644
--- a/base/common/src/CMakeLists.txt
+++ b/base/common/src/CMakeLists.txt
@@ -150,10 +150,6 @@ jar(pki-certsrv-jar
         ${CMAKE_CURRENT_BINARY_DIR}/pki-certsrv.mf
     INPUT_DIR
         ${CMAKE_CURRENT_BINARY_DIR}/classes
-    FILES
-        com/netscape/certsrv/*.class
-        org/dogtagpki/tps/*.class
-
     DEPENDS
         pki-certsrv-classes
 )
diff --git a/base/console/src/CMakeLists.txt b/base/console/src/CMakeLists.txt
index dc5a3e3f792f27a34c389c32e4a92310d7e0c48e..fbbcdf6b83fa29fabdbaa427819b890e2e122b0b 100644
--- a/base/console/src/CMakeLists.txt
+++ b/base/console/src/CMakeLists.txt
@@ -95,7 +95,7 @@ find_file(COMMONS_CODEC_JAR
 # build console classes
 javac(pki-console-classes
     SOURCES
-        com/netscape/admin/certsrv/*.java
+        *.java
     CLASSPATH
         ${BASE_JAR} ${LDAPJDK_JAR} ${MMC_JAR}
         ${MMC_EN_JAR} ${NMCLF_JAR} ${NMCLF_EN_JAR}
@@ -120,8 +120,6 @@ jar(pki-console-jar
         ${CMAKE_CURRENT_BINARY_DIR}/pki-console.mf
     INPUT_DIR
         ${CMAKE_CURRENT_BINARY_DIR}/classes
-    FILES
-        com/netscape/admin/certsrv/*.class
     INPUT_DIR
         ${CMAKE_CURRENT_SOURCE_DIR}
     FILES
diff --git a/base/java-tools/src/CMakeLists.txt b/base/java-tools/src/CMakeLists.txt
index 6753102f8064d5878bb11c34a45ef13890d8fb26..8fd44f3f9998ad008ebb062f6e23c8f8320d8b98 100644
--- a/base/java-tools/src/CMakeLists.txt
+++ b/base/java-tools/src/CMakeLists.txt
@@ -91,7 +91,7 @@ find_file(HTTPCORE_JAR
 # build pki-tools
 javac(pki-tools-classes
     SOURCES
-        com/netscape/cmstools/*.java
+        *.java
     CLASSPATH
         ${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR} ${PKI_CERTSRV_JAR}
         ${XALAN_JAR} ${XERCES_JAR}
@@ -119,8 +119,6 @@ jar(pki-tools-jar
         ${CMAKE_CURRENT_BINARY_DIR}/pki-tools.mf
     INPUT_DIR
         ${CMAKE_CURRENT_BINARY_DIR}/classes
-    FILES
-        com/netscape/cmstools/*.class
     DEPENDS
         pki-tools-classes
 )
diff --git a/base/kra/src/CMakeLists.txt b/base/kra/src/CMakeLists.txt
index c04d7fec9c25a104ad51640298a57f646777a7f3..ffe78a462d5aad3c8a244d40b2aea90a8f8b051e 100644
--- a/base/kra/src/CMakeLists.txt
+++ b/base/kra/src/CMakeLists.txt
@@ -107,8 +107,7 @@ find_file(TOMCAT_CATALINA_JAR
 # build pki-kra
 javac(pki-kra-classes
     SOURCES
-        com/netscape/kra/*.java
-        org/dogtagpki/server/kra/*.java
+        *.java
     CLASSPATH
         ${COMMONS_CODEC_JAR} ${COMMONS_LANG_JAR}
         ${JSS_JAR} ${SYMKEY_JAR}
@@ -137,9 +136,6 @@ jar(pki-kra-jar
         ${CMAKE_CURRENT_BINARY_DIR}/pki-kra.mf
     INPUT_DIR
         ${CMAKE_CURRENT_BINARY_DIR}/classes
-    FILES
-        com/netscape/kra/*.class
-        org/dogtagpki/server/kra/*.class
     DEPENDS
         pki-kra-classes
 )
diff --git a/base/ocsp/src/CMakeLists.txt b/base/ocsp/src/CMakeLists.txt
index 78df95f377c8a013e4c7a1773629a3794d33b943..8d6ca5035849a28a3aa24f4b8f3eb4b4543f71da 100644
--- a/base/ocsp/src/CMakeLists.txt
+++ b/base/ocsp/src/CMakeLists.txt
@@ -72,8 +72,7 @@ find_file(SYMKEY_JAR
 # build pki-ocsp
 javac(pki-ocsp-classes
     SOURCES
-        com/netscape/ocsp/*.java
-        org/dogtagpki/server/ocsp/*.java
+        *.java
     CLASSPATH
         ${PKI_CERTSRV_JAR} ${PKI_CMS_JAR} ${PKI_CMSCORE_JAR}
         ${PKI_CMSUTIL_JAR} ${PKI_NSUTIL_JAR}
@@ -99,9 +98,6 @@ jar(pki-ocsp-jar
         ${CMAKE_CURRENT_BINARY_DIR}/pki-ocsp.mf
     INPUT_DIR
         ${CMAKE_CURRENT_BINARY_DIR}/classes
-    FILES
-        com/netscape/ocsp/*.class
-        org/dogtagpki/server/ocsp/*.class
     DEPENDS
         pki-ocsp-classes
 )
diff --git a/base/server/cms/src/CMakeLists.txt b/base/server/cms/src/CMakeLists.txt
index 447dcb18b0fc25c1ff72c8bb996b88ff599d7837..5017ba87b6fe7fe6dcab0841e2ca9db738bf19cd 100644
--- a/base/server/cms/src/CMakeLists.txt
+++ b/base/server/cms/src/CMakeLists.txt
@@ -121,8 +121,7 @@ find_file(HTTPCORE_JAR
 # build pki-cms
 javac(pki-cms-classes
     SOURCES
-        com/netscape/cms/*.java
-        org/dogtagpki/server/*.java
+        *.java
     CLASSPATH
         ${COMMONS_CODEC_JAR} ${COMMONS_IO_JAR} ${COMMONS_LANG_JAR} ${COMMONS_HTTPCLIENT_JAR}
         ${HTTPCLIENT_JAR} ${HTTPCORE_JAR}
@@ -152,11 +151,6 @@ jar(pki-cms-jar
         ${CMAKE_CURRENT_BINARY_DIR}/pki-cms.mf
     INPUT_DIR
         ${CMAKE_CURRENT_BINARY_DIR}/classes
-    FILES
-        com/netscape/cms/*.class
-        org/dogtagpki/server/*.class
-    EXCLUDE
-        com/netscape/cms/tomcat/*.class
     DEPENDS
         pki-cms-classes
 )
diff --git a/base/server/cmscore/src/CMakeLists.txt b/base/server/cmscore/src/CMakeLists.txt
index fe8dba2077734468d983e850201150f88cb129f4..4ac1d46f30efd9153f2cfa6b966173ce4622d55a 100644
--- a/base/server/cmscore/src/CMakeLists.txt
+++ b/base/server/cmscore/src/CMakeLists.txt
@@ -122,7 +122,7 @@ find_file(NUXWDOG_JAR
 # build pki-cmscore
 javac(pki-cmscore-classes
     SOURCES
-        com/netscape/cmscore/*.java
+        *.java
     CLASSPATH
         ${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR} ${PKI_CERTSRV_JAR} ${PKI_CMS_JAR} ${PKI_TOMCAT_JAR}
         ${LDAPJDK_JAR} ${SERVLET_JAR} ${VELOCITY_JAR} ${XALAN_JAR} ${XERCES_JAR}
@@ -152,8 +152,6 @@ jar(pki-cmscore-jar
         ${CMAKE_CURRENT_BINARY_DIR}/pki-cmscore.mf
     INPUT_DIR
         ${CMAKE_CURRENT_BINARY_DIR}/classes
-    FILES
-        com/netscape/cmscore/*.class
     DEPENDS
         pki-cmscore-classes
 )
diff --git a/base/server/test/CMakeLists.txt b/base/server/test/CMakeLists.txt
index 5abd264095004960f8928d307109958bef587bf1..11c858250e80725e1be1d681b4f4fdccd397f6ee 100644
--- a/base/server/test/CMakeLists.txt
+++ b/base/server/test/CMakeLists.txt
@@ -32,7 +32,7 @@ find_file(PKI_CMSBUNDLE_JAR
 # TODO: build test only when the test is invoked
 javac(pki-server-test-classes
     SOURCES
-        com/netscape/cmscore/*.java
+        *.java
     CLASSPATH
         ${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
         ${PKI_CERTSRV_JAR} ${PKI_CMS_JAR} ${PKI_CMSCORE_JAR} ${PKI_CMSBUNDLE_JAR}
diff --git a/base/server/tomcat/src/CMakeLists.txt b/base/server/tomcat/src/CMakeLists.txt
index c5897580da6e9121200f7570b1819fe4d99a33f6..7595f47eeaaf68807a85b50bda5bac98f9a43ea8 100644
--- a/base/server/tomcat/src/CMakeLists.txt
+++ b/base/server/tomcat/src/CMakeLists.txt
@@ -129,7 +129,7 @@ find_file(NUXWDOG_JAR
 # build pki-tomcat
 javac(pki-tomcat-classes
     SOURCES
-        com/netscape/cms/tomcat/*.java
+        *.java
     CLASSPATH
         ${SERVLET_JAR} ${TOMCAT_CATALINA_JAR} ${TOMCAT_UTIL_SCAN_JAR}
 		${NUXWDOG_JAR} ${APACHE_COMMONS_LANG_JAR} ${TOMCATJSS_JAR}
diff --git a/base/server/tomcat7/src/CMakeLists.txt b/base/server/tomcat7/src/CMakeLists.txt
index 18f0b91dccbb57d2f22a3396a7a92150dd910dda..c8156138e735c77a8d83313b3b70fa9b8e330a60 100644
--- a/base/server/tomcat7/src/CMakeLists.txt
+++ b/base/server/tomcat7/src/CMakeLists.txt
@@ -114,7 +114,7 @@ find_file(HTTPCORE_JAR
 # build pki-tomcat
 javac(pki-tomcat7-classes
     SOURCES
-        com/netscape/cms/tomcat/*.java
+        *.java
     CLASSPATH
         ${SERVLET_JAR} ${TOMCAT_CATALINA_JAR} ${TOMCAT_UTIL_SCAN_JAR}
         ${JAXRS_API_JAR}
@@ -139,8 +139,6 @@ jar(pki-tomcat-jar
         ${CMAKE_CURRENT_BINARY_DIR}/pki-tomcat.mf
     INPUT_DIR
         ${CMAKE_BINARY_DIR}/../../tomcat
-    FILES
-        com/netscape/cms/tomcat/*.class
     DEPENDS
         pki-tomcat-classes
         pki-tomcat7-classes
diff --git a/base/server/tomcat8/src/CMakeLists.txt b/base/server/tomcat8/src/CMakeLists.txt
index db1b9dc31c2291c98774066bdbb570f74efc3d7a..a80a2125ccb92b8b6f29f6e59d8e3b12436ca09d 100644
--- a/base/server/tomcat8/src/CMakeLists.txt
+++ b/base/server/tomcat8/src/CMakeLists.txt
@@ -121,7 +121,7 @@ find_file(HTTPCORE_JAR
 # build pki-tomcat
 javac(pki-tomcat8-classes
     SOURCES
-        com/netscape/cms/tomcat/*.java
+        *.java
     CLASSPATH
         ${SERVLET_JAR} ${TOMCAT_CATALINA_JAR} ${TOMCAT_UTIL_SCAN_JAR} ${TOMCAT_API_JAR}
         ${JAXRS_API_JAR}
@@ -146,8 +146,6 @@ jar(pki-tomcat-jar
         ${CMAKE_CURRENT_BINARY_DIR}/pki-tomcat.mf
     INPUT_DIR
         ${CMAKE_BINARY_DIR}/../../tomcat
-    FILES
-        com/netscape/cms/tomcat/*.class
     DEPENDS
         pki-tomcat-classes
         pki-tomcat8-classes
diff --git a/base/symkey/src/CMakeLists.txt b/base/symkey/src/CMakeLists.txt
index 8455d592e3969dea720bf0a82d4d7a0cd743a0b3..118c29b92d43af0eca351f219894c3f3369677cc 100644
--- a/base/symkey/src/CMakeLists.txt
+++ b/base/symkey/src/CMakeLists.txt
@@ -11,7 +11,7 @@ find_file(JSS_JAR
 # build symkey
 javac(symkey-classes
     SOURCES
-        com/netscape/symkey/*.java
+        *.java
     CLASSPATH
         ${JSS_JAR}
     OUTPUT_DIR
@@ -23,8 +23,6 @@ jar(symkey-jar
         ${CMAKE_BINARY_DIR}/dist/symkey.jar
     INPUT_DIR
         ${CMAKE_CURRENT_BINARY_DIR}/classes
-    FILES
-        com/netscape/symkey/*.class
     DEPENDS
         symkey-classes
 )
diff --git a/base/test/src/CMakeLists.txt b/base/test/src/CMakeLists.txt
index 6133ff37c2aebee0f0341ff749f9c292a01c7321..2daf1d6e11c0f002cbd20848970fc5e7b813dd4b 100644
--- a/base/test/src/CMakeLists.txt
+++ b/base/test/src/CMakeLists.txt
@@ -4,7 +4,7 @@ project(pki-test_java NONE)
 # TODO: build test only when the test is invoked
 javac(pki-test-classes
     SOURCES
-        com/netscape/test/*.java
+        *.java
     CLASSPATH
         ${XALAN_JAR} ${XERCES_JAR} ${JUNIT_JAR}
     OUTPUT_DIR
diff --git a/base/tks/src/CMakeLists.txt b/base/tks/src/CMakeLists.txt
index 146e70ada49c9431156d447d2d08e4d505bda8fa..101430fd2ae77ad5db1454cdfc6bd7a9a05fba27 100644
--- a/base/tks/src/CMakeLists.txt
+++ b/base/tks/src/CMakeLists.txt
@@ -107,8 +107,7 @@ find_file(TOMCAT_CATALINA_JAR
 # build pki-tks
 javac(pki-tks-classes
     SOURCES
-        com/netscape/tks/*.java
-        org/dogtagpki/server/tks/*.java
+        *.java
     CLASSPATH
         ${COMMONS_CODEC_JAR} ${COMMONS_LANG_JAR}
         ${LDAPJDK_JAR}
@@ -137,9 +136,6 @@ jar(pki-tks-jar
         ${CMAKE_CURRENT_BINARY_DIR}/pki-tks.mf
     INPUT_DIR
         ${CMAKE_CURRENT_BINARY_DIR}/classes
-    FILES
-        com/netscape/tks/*.class
-        org/dogtagpki/server/tks/*.class
     DEPENDS
         pki-tks-classes
 )
diff --git a/base/tps/src/CMakeLists.txt b/base/tps/src/CMakeLists.txt
index f517a63c4cd480809d04e33ff3394b7c93dcf9ef..c5474946551fd78ae59f06635893c8013fae0e73 100644
--- a/base/tps/src/CMakeLists.txt
+++ b/base/tps/src/CMakeLists.txt
@@ -111,7 +111,7 @@ find_file(VELOCITY_JAR
 # build pki-tps
 javac(pki-tps-classes
     SOURCES
-        org/dogtagpki/server/tps/*.java
+        *.java
     CLASSPATH
         ${COMMONS_CODEC_JAR} ${COMMONS_LANG_JAR}
         ${LDAPJDK_JAR}
@@ -140,8 +140,6 @@ jar(pki-tps-jar
         ${CMAKE_CURRENT_BINARY_DIR}/pki-tps.mf
     INPUT_DIR
         ${CMAKE_CURRENT_BINARY_DIR}/classes
-    FILES
-        org/dogtagpki/server/tps/*.class
     DEPENDS
         pki-tps-classes
 )
-- 
2.5.5

