From 3516ff87e9bba8982b95151d2e6821e66a2ee0fd Mon Sep 17 00:00:00 2001
From: Endi Sukma Dewata <edewata@redhat.com>
Date: Fri, 27 Jul 2012 09:06:16 -0500
Subject: [PATCH] Merged pki-jndi-realm.jar into pki-cmscore.jar.

On Tomcat 7 it's no longer necessary to have a separate package
for the authenticator and realm classes. They are now packaged
in pki-cmscore.jar which is deployed in Tomcat's common/lib.

Ticket #126
---
 base/common/src/CMakeLists.txt | 53 ------------------------------------------
 specs/pki-core.spec            | 15 ++++--------
 2 files changed, 4 insertions(+), 64 deletions(-)

diff --git a/base/common/src/CMakeLists.txt b/base/common/src/CMakeLists.txt
index bf8ea6f847bb569cc6e2021a61ddfbe956b9517d..f93083d7995742b60506ec551cb672cec93a63fd 100644
--- a/base/common/src/CMakeLists.txt
+++ b/base/common/src/CMakeLists.txt
@@ -259,8 +259,6 @@ endif(WITH_JAVADOC)
 javac(pki-cmscore-classes
     SOURCES
         com/netscape/cmscore/*.java
-    EXCLUDE
-        com/netscape/cmscore/realm/*.java
     CLASSPATH
         ${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
         ${LDAPJDK_JAR} ${SERVLET_JAR} ${VELOCITY_JAR} ${XALAN_JAR} ${XERCES_JAR}
@@ -282,8 +280,6 @@ jar(pki-cmscore-jar
         ${CMAKE_BINARY_DIR}/classes
     FILES
         com/netscape/cmscore/*.class
-    EXCLUDE
-        com/netscape/cmscore/realm/*.class
     DEPENDS
         pki-cmscore-classes
 )
@@ -337,52 +333,3 @@ install(
 )
 
 set(PKI_CMSBUNDLE_JAR ${CMAKE_BINARY_DIR}/dist/pki-cmsbundle.jar INTERNAL "pki-cmsbundle jar file")
-
-
-# build pki jndi realm
-javac(pki-jndi-realm-classes
-    SOURCES
-        com/netscape/cmscore/realm/*.java
-    CLASSPATH
-        ${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
-        ${LDAPJDK_JAR} ${SERVLET_JAR} ${VELOCITY_JAR} ${XALAN_JAR} ${XERCES_JAR}
-        ${JSS_JAR} ${COMMONS_CODEC_JAR} ${COMMONS_HTTPCLIENT_JAR}
-        ${APACHE_COMMONS_CLI_JAR} ${APACHE_COMMONS_LANG_JAR}
-        ${TOMCAT_CATALINA_JAR} ${TOMCAT_UTIL_JAR} ${SYMKEY_JAR}
-        ${JAXRS_API_JAR} ${RESTEASY_JAXRS_JAR} ${RESTEASY_ATOM_PROVIDER_JAR}
-        ${HTTPCLIENT_JAR} ${HTTPCORE_JAR}
-    OUTPUT_DIR
-        ${CMAKE_BINARY_DIR}/classes
-    DEPENDS
-        pki-nsutil pki-cmsutil pki-certsrv pki-cms pki-cmscore pki-cmsbundle
-)
-
-jar(pki-jndi-realm-jar
-    CREATE
-        ${CMAKE_BINARY_DIR}/dist/pki-jndi-realm-${APPLICATION_VERSION}.jar
-    INPUT_DIR
-        ${CMAKE_BINARY_DIR}/classes
-    FILES
-        com/netscape/cmscore/realm/*.class
-    DEPENDS
-        pki-jndi-realm-classes
-)
-
-link(pki-jndi-realm
-    SOURCE
-        ${CMAKE_BINARY_DIR}/dist/pki-jndi-realm.jar
-    DEST
-        pki-jndi-realm-${APPLICATION_VERSION}.jar
-    DEPENDS
-        pki-jndi-realm-jar
-)
-
-install(
-    FILES
-        ${CMAKE_BINARY_DIR}/dist/pki-jndi-realm.jar
-        ${CMAKE_BINARY_DIR}/dist/pki-jndi-realm-${APPLICATION_VERSION}.jar
-    DESTINATION
-        ${JAVA_JAR_INSTALL_DIR}/pki
-)
-
-set(PKI_JNDI_REALM_JAR ${CMAKE_BINARY_DIR}/dist/pki-jndi-realm.jar CACHE INTERNAL "pki-jndi-realm jar file")
diff --git a/specs/pki-core.spec b/specs/pki-core.spec
index 58b8df01daf59d9e7d38901e02b9542d50e7480a..87c610c2dd1b9c9e9887717e620a60d9ec74ff61 100644
--- a/specs/pki-core.spec
+++ b/specs/pki-core.spec
@@ -14,7 +14,7 @@ distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
 
 Name:             pki-core
 Version:          10.0.0
-Release:          %{?relprefix}20%{?prerel}%{?dist}
+Release:          %{?relprefix}21%{?prerel}%{?dist}
 Summary:          Certificate System - PKI Core Components
 URL:              http://pki.fedoraproject.org/
 License:          GPLv2
@@ -805,9 +805,6 @@ echo "D /var/run/pki/tks 0755 root root -"  >> %{buildroot}%{_sysconfdir}/tmpfil
 %{__rm} %{buildroot}%{_initrddir}/pki-krad
 %{__rm} %{buildroot}%{_initrddir}/pki-ocspd
 %{__rm} %{buildroot}%{_initrddir}/pki-tksd
-# Create symlink to the pki-jndi-realm jar
-%{__mkdir_p} %{buildroot}%{_javadir}/tomcat
-%{__ln_s} -f %{_javadir}/pki/pki-jndi-realm.jar %{buildroot}%{_javadir}/tomcat/pki-jndi-realm.jar
 %else
 %{__rm} %{buildroot}%{_bindir}/pkicontrol
 %{__rm} %{buildroot}%{_bindir}/pkidaemon
@@ -1272,10 +1269,6 @@ fi
 %dir %{_localstatedir}/lock/pki/tomcat
 %dir %{_localstatedir}/run/pki/tomcat
 
-%if 0%{?fedora} >= 16
-# Create symlink to the pki-jndi-realm jar
-%{_javadir}/tomcat/pki-jndi-realm.jar
-%endif
 %if 0%{?fedora} >= 15
 # Details:
 #
@@ -1285,9 +1278,6 @@ fi
 %config(noreplace) %{_sysconfdir}/tmpfiles.d/pki-tomcat.conf
 %endif
 
-%{_javadir}/pki/pki-jndi-realm-%{version}.jar
-%{_javadir}/pki/pki-jndi-realm.jar
-
 %{_datadir}/pki/setup/
 %dir %{_datadir}/pki/shared
 %{_datadir}/pki/shared/conf/
@@ -1434,6 +1424,9 @@ fi
 
 
 %changelog
+* Fri Jul 27 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.21.a1
+- Merged pki-jndi-realm.jar into pki-cmscore.jar.
+
 * Tue Jul 24 2012 Matthew Harmsen <mharmsen@redhat.com> 10.0.0-0.20.a1
 - PKI TRAC Task #254 - Dogtag 10: Fix spec file to build successfully
   via mock on Fedora 17 . . .
-- 
1.7.11.2

