From 334080a76c6e834c7e8ef4cc2ce6998ee970565d Mon Sep 17 00:00:00 2001
From: Endi Sukma Dewata <edewata@redhat.com>
Date: Thu, 30 Aug 2012 16:28:45 -0500
Subject: [PATCH] Removed duplicate common classes in pki-console.jar.

The pki-console has been modified to depend on pki-base. This way
it's no longer necessary to include duplicate common classes in
pki-console.

Ticket #113
---
 base/console/src/CMakeLists.txt            | 32 ++++++++++--------------------
 base/console/templates/pki_console_wrapper |  1 +
 scripts/compose_pki_console_packages       |  2 +-
 specs/pki-console.spec                     |  8 ++++++--
 4 files changed, 19 insertions(+), 24 deletions(-)

diff --git a/base/console/src/CMakeLists.txt b/base/console/src/CMakeLists.txt
index ee7c25b58c3e5f51e49a025a6133e690339e2f1f..335411e39b36cec1ed002959b7da251cb5e683dd 100644
--- a/base/console/src/CMakeLists.txt
+++ b/base/console/src/CMakeLists.txt
@@ -9,6 +9,14 @@ find_file(PKI_NSUTIL_JAR
         /usr/share/java/pki
 )
 
+find_file(PKI_CERTSRV_JAR
+    NAMES
+        pki-certsrv.jar
+    PATHS
+        ${JAVA_LIB_INSTALL_DIR}
+        /usr/share/java/pki
+)
+
 
 # '/usr/share/java' jars
 find_file(BASE_JAR
@@ -76,21 +84,6 @@ find_file(COMMONS_CODEC_JAR
         /usr/share/java
 )
 
-# build common classes
-javac(pki-common-classes
-    SOURCE_DIR
-        ${CMAKE_SOURCE_DIR}/base/common/src
-    SOURCES
-        com/netscape/certsrv/common/*.java
-    CLASSPATH
-        ${BASE_JAR} ${LDAPJDK_JAR} ${MMC_JAR}
-        ${MMC_EN_JAR} ${NMCLF_JAR} ${NMCLF_EN_JAR}
-        ${PKI_NSUTIL_JAR}
-        ${JSS_JAR} ${COMMONS_CODEC_JAR}
-    OUTPUT_DIR
-        ${CMAKE_BINARY_DIR}/classes
-)
-
 # build console classes
 javac(pki-console-classes
     SOURCES
@@ -99,15 +92,13 @@ javac(pki-console-classes
         ${CMAKE_BINARY_DIR}/classes
         ${BASE_JAR} ${LDAPJDK_JAR} ${MMC_JAR}
         ${MMC_EN_JAR} ${NMCLF_JAR} ${NMCLF_EN_JAR}
-        ${PKI_NSUTIL_JAR}
+        ${PKI_NSUTIL_JAR} ${PKI_CERTSRV_JAR}
         ${JSS_JAR} ${COMMONS_CODEC_JAR}
     OUTPUT_DIR
         ${CMAKE_BINARY_DIR}/classes
-    DEPENDS
-        pki-common-classes
 )
 
-# package common and console classes and resources
+# package console classes and resources
 jar(pki-console-jar
     CREATE
         ${CMAKE_BINARY_DIR}/dist/pki-console-${APPLICATION_VERSION}.jar
@@ -115,13 +106,12 @@ jar(pki-console-jar
         ${CMAKE_BINARY_DIR}/classes
     FILES
         com/netscape/admin/certsrv/*.class
-        com/netscape/certsrv/common/*.class
     INPUT_DIR
         ${CMAKE_CURRENT_SOURCE_DIR}
     FILES
         com/netscape/admin/certsrv/images/*.gif
     DEPENDS
-        pki-console-classes pki-common-classes
+        pki-console-classes
 )
 
 link(pki-console
diff --git a/base/console/templates/pki_console_wrapper b/base/console/templates/pki_console_wrapper
index eec4725b6e328259e50e0b9c5f2fc641f7a845a2..b1b9593b22d408316095342852a184b85008b983 100755
--- a/base/console/templates/pki_console_wrapper
+++ b/base/console/templates/pki_console_wrapper
@@ -152,6 +152,7 @@ CP=/usr/share/java/idm-console-mcc.jar:${CP}
 CP=/usr/share/java/idm-console-mcc_en.jar:${CP}
 CP=/usr/share/java/idm-console-base.jar:${CP}
 CP=/usr/share/java/389-console_en.jar:${CP}
+CP=/usr/share/java/${PRODUCT}/pki-certsrv.jar:${CP}
 CP=/usr/share/java/${PRODUCT}/pki-console-theme.jar:${CP}
 CP=/usr/share/java/${PRODUCT}/pki-console.jar:${CP}
 export CP
diff --git a/scripts/compose_pki_console_packages b/scripts/compose_pki_console_packages
index 5b5ea071d29e8509a6765cebd2803ca80aec229d..a163525c306a39e52a7fa35b0f10ee57c03d3bca 100755
--- a/scripts/compose_pki_console_packages
+++ b/scripts/compose_pki_console_packages
@@ -39,7 +39,7 @@ PKI_CONSOLE_VERSION="10.0.0.a1"
 ##
 
 PKI_SPECS_FILE="${PKI_DIR}/specs/${PKI_CONSOLE}.spec"
-PKI_COMPONENT_LIST="test common console"
+PKI_COMPONENT_LIST="test console"
 
 
 ##
diff --git a/specs/pki-console.spec b/specs/pki-console.spec
index e858662c4584b392637117aff87b581997240273..5821db181485b609bd55ea6f1c8c84dd4a81a7f8 100644
--- a/specs/pki-console.spec
+++ b/specs/pki-console.spec
@@ -7,7 +7,7 @@
 
 Name:             pki-console
 Version:          10.0.0
-Release:          %{?relprefix}6%{?prerel}%{?dist}
+Release:          %{?relprefix}7%{?prerel}%{?dist}
 Summary:          Certificate System - PKI Console
 URL:              http://pki.fedoraproject.org/
 License:          GPLv2
@@ -31,7 +31,7 @@ BuildRequires:    junit4
 %if 0%{?fedora} >= 16
 BuildRequires:    jpackage-utils >= 1.7.5-10
 BuildRequires:    jss >= 4.2.6-24
-BuildRequires:    pki-base >= 9.0.15
+BuildRequires:    pki-base >= 10.0.0
 %else
 BuildRequires:    jpackage-utils
 BuildRequires:    jss >= 4.2.6-24
@@ -41,6 +41,7 @@ BuildRequires:    pki-base
 Requires:         idm-console-framework
 Requires:         java >= 1:1.6.0
 Requires:         ldapjdk
+Requires:         pki-base >= 10.0.0
 Requires:         pki-console-theme >= 9.0.0
 %if 0%{?fedora} >= 16
 Requires:         jpackage-utils >= 1.7.5-10
@@ -100,6 +101,9 @@ cd build
 
 
 %changelog
+* Thu Aug 30 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.7.a1
+- Added runtime dependency on pki-base
+
 * Wed Aug 22 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.6.a1
 - Replaced pki-util with pki-base
 
-- 
1.7.11.2

