summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-12-06 13:06:14 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-12-06 13:06:14 -0500
commit145114f713a58ed5ce896e2192e50eeb382a3c74 (patch)
tree381a6f98d29ba699ef3c9aac4c54014804a5aa29
parent79ff01ef76f2a4ca44d02bceb7173541328bef3b (diff)
downloadpki-145114f713a58ed5ce896e2192e50eeb382a3c74.zip
pki-145114f713a58ed5ce896e2192e50eeb382a3c74.tar.gz
pki-145114f713a58ed5ce896e2192e50eeb382a3c74.tar.xz
Added RESTEASY_LIB.ticket-422
-rw-r--r--base/ca/src/CMakeLists.txt3
-rw-r--r--base/common/shared/conf/pki.policy30
-rw-r--r--base/common/shared/conf/tomcat.conf3
-rw-r--r--base/common/src/CMakeLists.txt9
-rw-r--r--base/deploy/CMakeLists.txt7
-rw-r--r--base/deploy/etc/default.cfg3
-rw-r--r--base/deploy/scripts/operations8
-rw-r--r--base/deploy/src/scriptlets/configuration.jy2
-rw-r--r--base/deploy/src/scriptlets/pkiconfig.py4
-rw-r--r--base/deploy/src/scriptlets/pkijython.py24
-rw-r--r--base/deploy/src/scriptlets/pkiparser.py10
-rw-r--r--base/java-tools/src/CMakeLists.txt9
-rw-r--r--base/kra/src/CMakeLists.txt3
-rw-r--r--base/ocsp/src/CMakeLists.txt3
-rw-r--r--base/tks/src/CMakeLists.txt3
-rw-r--r--specs/pki-core.spec6
16 files changed, 54 insertions, 73 deletions
diff --git a/base/ca/src/CMakeLists.txt b/base/ca/src/CMakeLists.txt
index aa19cc4..e5ef9e5 100644
--- a/base/ca/src/CMakeLists.txt
+++ b/base/ca/src/CMakeLists.txt
@@ -28,8 +28,7 @@ find_file(JAXRS_API_JAR
NAMES
jaxrs-api.jar
PATHS
- /usr/share/java/resteasy
- /usr/share/java/resteasy-base
+ ${RESTEASY_LIB}
)
# build pki-ca
diff --git a/base/common/shared/conf/pki.policy b/base/common/shared/conf/pki.policy
index b9d79fe..121b773 100644
--- a/base/common/shared/conf/pki.policy
+++ b/base/common/shared/conf/pki.policy
@@ -106,43 +106,23 @@ grant codeBase "file:/usr/share/java/log4j.jar" {
permission java.security.AllPermission;
};
-grant codeBase "file:/usr/share/java/resteasy/jaxrs-api.jar" {
+grant codeBase "file:${resteasy.lib}/jaxrs-api.jar" {
permission java.security.AllPermission;
};
-grant codeBase "file:/usr/share/java/resteasy/resteasy-atom-provider.jar" {
+grant codeBase "file:${resteasy.lib}/resteasy-atom-provider.jar" {
permission java.security.AllPermission;
};
-grant codeBase "file:/usr/share/java/resteasy/resteasy-jaxb-provider.jar" {
+grant codeBase "file:${resteasy.lib}/resteasy-jaxb-provider.jar" {
permission java.security.AllPermission;
};
-grant codeBase "file:/usr/share/java/resteasy/resteasy-jaxrs.jar" {
+grant codeBase "file:${resteasy.lib}/resteasy-jaxrs.jar" {
permission java.security.AllPermission;
};
-grant codeBase "file:/usr/share/java/resteasy/resteasy-jettison-provider.jar" {
- permission java.security.AllPermission;
-};
-
-grant codeBase "file:/usr/share/java/resteasy-base/jaxrs-api.jar" {
- permission java.security.AllPermission;
-};
-
-grant codeBase "file:/usr/share/java/resteasy-base/resteasy-atom-provider.jar" {
- permission java.security.AllPermission;
-};
-
-grant codeBase "file:/usr/share/java/resteasy-base/resteasy-jaxb-provider.jar" {
- permission java.security.AllPermission;
-};
-
-grant codeBase "file:/usr/share/java/resteasy-base/resteasy-jaxrs.jar" {
- permission java.security.AllPermission;
-};
-
-grant codeBase "file:/usr/share/java/resteasy-base/resteasy-jettison-provider.jar" {
+grant codeBase "file:${resteasy.lib}/resteasy-jettison-provider.jar" {
permission java.security.AllPermission;
};
diff --git a/base/common/shared/conf/tomcat.conf b/base/common/shared/conf/tomcat.conf
index 54d67e4..fe3072b 100644
--- a/base/common/shared/conf/tomcat.conf
+++ b/base/common/shared/conf/tomcat.conf
@@ -32,6 +32,9 @@ CATALINA_TMPDIR=[PKI_TMPDIR]
# Enable the following JAVA_OPTS to run a java debugger (e. g. - 'eclipse')
#JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -Djava.awt.headless=true -Xmx128M"
+# RESTEasy
+JAVA_OPTS="$JAVA_OPTS -Dresteasy.lib=/usr/share/java/resteasy"
+
# What user should run tomcat
TOMCAT_USER="[PKI_USER]"
diff --git a/base/common/src/CMakeLists.txt b/base/common/src/CMakeLists.txt
index e21f13c..c010bed 100644
--- a/base/common/src/CMakeLists.txt
+++ b/base/common/src/CMakeLists.txt
@@ -87,24 +87,21 @@ find_file(JAXRS_API_JAR
NAMES
jaxrs-api.jar
PATHS
- /usr/share/java/resteasy
- /usr/share/java/resteasy-base
+ ${RESTEASY_LIB}
)
find_file(RESTEASY_JAXRS_JAR
NAMES
resteasy-jaxrs.jar
PATHS
- /usr/share/java/resteasy
- /usr/share/java/resteasy-base
+ ${RESTEASY_LIB}
)
find_file(RESTEASY_ATOM_PROVIDER_JAR
NAMES
resteasy-atom-provider.jar
PATHS
- /usr/share/java/resteasy
- /usr/share/java/resteasy-base
+ ${RESTEASY_LIB}
)
find_file(HTTPCLIENT_JAR
diff --git a/base/deploy/CMakeLists.txt b/base/deploy/CMakeLists.txt
index d63176f..2ea7ca1 100644
--- a/base/deploy/CMakeLists.txt
+++ b/base/deploy/CMakeLists.txt
@@ -62,9 +62,14 @@ install(
${DATA_INSTALL_DIR}/deployment
)
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/etc/default.cfg
+ ${CMAKE_CURRENT_BINARY_DIR}/etc/default.cfg
+)
+
install(
DIRECTORY
- etc/
+ ${CMAKE_CURRENT_BINARY_DIR}/etc/
DESTINATION
${SYSCONF_INSTALL_DIR}/pki
)
diff --git a/base/deploy/etc/default.cfg b/base/deploy/etc/default.cfg
index abd0fb4..c81fc72 100644
--- a/base/deploy/etc/default.cfg
+++ b/base/deploy/etc/default.cfg
@@ -52,6 +52,9 @@ destroy_scriplets=
infrastructure_layout
finalization
+# RESTEasy library
+RESTEASY_LIB=${RESTEASY_LIB}
+
# By default, the following parameters will be set for Tomcat and Apache instances.
# There is no reason to uncomment these. They are provided for reference in
# case someone wants to override them in their config file.
diff --git a/base/deploy/scripts/operations b/base/deploy/scripts/operations
index 020efbc..17f5963 100644
--- a/base/deploy/scripts/operations
+++ b/base/deploy/scripts/operations
@@ -945,12 +945,8 @@ verify_symlinks()
pki_systemd_service="pki-${PKI_WEB_SERVER_TYPE}d@.service"
systemd_dir="/lib/systemd/system"
- grep "Red Hat Enterprise Linux" /etc/redhat-release
- if [ $? == 0 ]; then
- resteasy_java_dir="/usr/share/java/resteasy-base"
- else
- resteasy_java_dir="/usr/share/java/resteasy"
- fi
+ RESTEASY_LIB=`grep RESTEASY_LIB= /etc/pki/default.cfg | awk -F= '{ print $2; }'`
+ echo "RESTEASY_LIB=$RESTEASY_LIB"
# Dogtag 10 Symbolic Link Variables
pki_common_jar_dir="${PKI_INSTANCE_PATH}/common/lib"
diff --git a/base/deploy/src/scriptlets/configuration.jy b/base/deploy/src/scriptlets/configuration.jy
index 80543b8..16baa72 100644
--- a/base/deploy/src/scriptlets/configuration.jy
+++ b/base/deploy/src/scriptlets/configuration.jy
@@ -64,6 +64,8 @@ def main(argv):
print "%s '%s' = '%s'" %\
(log.PKI_JYTHON_INDENTATION_2, key, value)
+ jyutil.load_resteasy(master['RESTEASY_LIB'])
+
# Initialize token
jyutil.security_databases.initialize_token(
master['pki_client_database_dir'],
diff --git a/base/deploy/src/scriptlets/pkiconfig.py b/base/deploy/src/scriptlets/pkiconfig.py
index 4bbf92e..c4caf19 100644
--- a/base/deploy/src/scriptlets/pkiconfig.py
+++ b/base/deploy/src/scriptlets/pkiconfig.py
@@ -71,10 +71,6 @@ PKI_DEPLOYMENT_JAR_SOURCE_ROOT = "/usr/share/java"
PKI_DEPLOYMENT_HTTPCOMPONENTS_JAR_SOURCE_ROOT = "/usr/share/java/httpcomponents"
PKI_DEPLOYMENT_PKI_JAR_SOURCE_ROOT = "/usr/share/java/pki"
-PKI_DEPLOYMENT_RESTEASY_JAR_SOURCE_ROOT = "/usr/share/java/resteasy"
-if is_rhel():
- PKI_DEPLOYMENT_RESTEASY_JAR_SOURCE_ROOT = "/usr/share/java/resteasy-base"
-
PKI_DEPLOYMENT_SOURCE_ROOT = "/usr/share/pki"
PKI_DEPLOYMENT_SYSTEMD_ROOT = "/lib/systemd/system"
PKI_DEPLOYMENT_SYSTEMD_CONFIGURATION_ROOT = "/etc/systemd/system"
diff --git a/base/deploy/src/scriptlets/pkijython.py b/base/deploy/src/scriptlets/pkijython.py
index c1bec93..3546f21 100644
--- a/base/deploy/src/scriptlets/pkijython.py
+++ b/base/deploy/src/scriptlets/pkijython.py
@@ -83,6 +83,7 @@ import pkimessages as log
# Dynamically Load Additional Java Jars ('append' to existing classpath)
jarLoad = classPathHacker()
+
# Webserver Jars
jarLoad.addFile("/usr/share/java/httpcomponents/httpclient.jar")
jarLoad.addFile("/usr/share/java/httpcomponents/httpcore.jar")
@@ -91,23 +92,15 @@ jarLoad.addFile("/usr/share/java/apache-commons-codec.jar")
jarLoad.addFile("/usr/share/java/apache-commons-logging.jar")
jarLoad.addFile("/usr/share/java/istack-commons-runtime.jar")
-# Resteasy Jars
-RESTEASY_ROOT = "resteasy"
-if config.is_rhel():
- RESTEASY_ROOT = "resteasy-base"
-
jarLoad.addFile("/usr/share/java/glassfish-jaxb/jaxb-impl.jar")
-jarLoad.addFile("/usr/share/java/" + RESTEASY_ROOT + "/jaxrs-api.jar")
-jarLoad.addFile("/usr/share/java/" + RESTEASY_ROOT + "/resteasy-atom-provider.jar")
-jarLoad.addFile("/usr/share/java/" + RESTEASY_ROOT + "/resteasy-jaxb-provider.jar")
-jarLoad.addFile("/usr/share/java/" + RESTEASY_ROOT + "/resteasy-jaxrs.jar")
-jarLoad.addFile("/usr/share/java/" + RESTEASY_ROOT + "/resteasy-jettison-provider.jar")
jarLoad.addFile("/usr/share/java/scannotation.jar")
+
# PKI Jars
jarLoad.addFile("/usr/share/java/pki/pki-certsrv.jar")
jarLoad.addFile("/usr/share/java/pki/pki-client.jar")
jarLoad.addFile("/usr/share/java/pki/pki-cmsutil.jar")
jarLoad.addFile("/usr/share/java/pki/pki-nsutil.jar")
+
# JSS JNI Jars
#
# NOTE: Always load 64-bit JNI 'jss4.jar'
@@ -116,7 +109,6 @@ jarLoad.addFile("/usr/share/java/pki/pki-nsutil.jar")
jarLoad.addFile("/usr/lib64/java/jss4.jar")
jarLoad.addFile("/usr/lib/java/jss4.jar")
-
# Apache Commons Java Imports
from org.apache.commons.cli import CommandLine
from org.apache.commons.cli import CommandLineParser
@@ -156,6 +148,16 @@ from com.netscape.certsrv.system import ConfigurationResponse
from com.netscape.cmsutil.util import Utils
from netscape.security.x509 import X500Name
+# Dynamically Load RESTEasy Jars ('append' to existing classpath)
+def load_resteasy(path):
+
+ jarLoad.addFile(path + "/jaxrs-api.jar")
+ jarLoad.addFile(path + "/resteasy-atom-provider.jar")
+ jarLoad.addFile(path + "/resteasy-jaxb-provider.jar")
+ jarLoad.addFile(path + "/resteasy-jaxrs.jar")
+ jarLoad.addFile(path + "/resteasy-jettison-provider.jar")
+
+
# PKI Deployment Jython Helper Functions
def generateCRMFRequest(token, keysize, subjectdn, dualkey):
kg = token.getKeyPairGenerator(KeyPairAlgorithm.RSA)
diff --git a/base/deploy/src/scriptlets/pkiparser.py b/base/deploy/src/scriptlets/pkiparser.py
index 1d6bed5..8fdbad8 100644
--- a/base/deploy/src/scriptlets/pkiparser.py
+++ b/base/deploy/src/scriptlets/pkiparser.py
@@ -624,7 +624,7 @@ class PKIConfigParser:
os.path.join(config.PKI_DEPLOYMENT_JAR_SOURCE_ROOT,
"javassist.jar")
config.pki_master_dict['pki_resteasy_jaxrs_api_jar'] =\
- os.path.join(config.PKI_DEPLOYMENT_RESTEASY_JAR_SOURCE_ROOT,
+ os.path.join(config.pki_master_dict['RESTEASY_LIB'],
"jaxrs-api.jar")
config.pki_master_dict['pki_jettison_jar'] =\
os.path.join(config.PKI_DEPLOYMENT_JAR_SOURCE_ROOT,
@@ -654,16 +654,16 @@ class PKIConfigParser:
os.path.join(config.PKI_DEPLOYMENT_PKI_JAR_SOURCE_ROOT,
"pki-tomcat.jar")
config.pki_master_dict['pki_resteasy_atom_provider_jar'] =\
- os.path.join(config.PKI_DEPLOYMENT_RESTEASY_JAR_SOURCE_ROOT,
+ os.path.join(config.pki_master_dict['RESTEASY_LIB'],
"resteasy-atom-provider.jar")
config.pki_master_dict['pki_resteasy_jaxb_provider_jar'] =\
- os.path.join(config.PKI_DEPLOYMENT_RESTEASY_JAR_SOURCE_ROOT,
+ os.path.join(config.pki_master_dict['RESTEASY_LIB'],
"resteasy-jaxb-provider.jar")
config.pki_master_dict['pki_resteasy_jaxrs_jar'] =\
- os.path.join(config.PKI_DEPLOYMENT_RESTEASY_JAR_SOURCE_ROOT,
+ os.path.join(config.pki_master_dict['RESTEASY_LIB'],
"resteasy-jaxrs.jar")
config.pki_master_dict['pki_resteasy_jettison_provider_jar'] =\
- os.path.join(config.PKI_DEPLOYMENT_RESTEASY_JAR_SOURCE_ROOT,
+ os.path.join(config.pki_master_dict['RESTEASY_LIB'],
"resteasy-jettison-provider.jar")
config.pki_master_dict['pki_scannotation_jar'] =\
os.path.join(config.PKI_DEPLOYMENT_JAR_SOURCE_ROOT,
diff --git a/base/java-tools/src/CMakeLists.txt b/base/java-tools/src/CMakeLists.txt
index 96aae5c..6ea69ca 100644
--- a/base/java-tools/src/CMakeLists.txt
+++ b/base/java-tools/src/CMakeLists.txt
@@ -49,24 +49,21 @@ find_file(JAXRS_API_JAR
NAMES
jaxrs-api.jar
PATHS
- /usr/share/java/resteasy
- /usr/share/java/resteasy-base
+ ${RESTEASY_LIB}
)
find_file(RESTEASY_JAXRS_JAR
NAMES
resteasy-jaxrs.jar
PATHS
- /usr/share/java/resteasy
- /usr/share/java/resteasy-base
+ ${RESTEASY_LIB}
)
find_file(RESTEASY_ATOM_PROVIDER_JAR
NAMES
resteasy-atom-provider.jar
PATHS
- /usr/share/java/resteasy
- /usr/share/java/resteasy-base
+ ${RESTEASY_LIB}
)
find_file(HTTPCLIENT_JAR
diff --git a/base/kra/src/CMakeLists.txt b/base/kra/src/CMakeLists.txt
index d9ab25c..99088ce 100644
--- a/base/kra/src/CMakeLists.txt
+++ b/base/kra/src/CMakeLists.txt
@@ -50,8 +50,7 @@ find_file(JAXRS_API_JAR
NAMES
jaxrs-api.jar
PATHS
- /usr/share/java/resteasy
- /usr/share/java/resteasy-base
+ ${RESTEASY_LIB}
)
# '${JAVA_LIB_INSTALL_DIR}' jars
diff --git a/base/ocsp/src/CMakeLists.txt b/base/ocsp/src/CMakeLists.txt
index 39468ca..d3bdf0e 100644
--- a/base/ocsp/src/CMakeLists.txt
+++ b/base/ocsp/src/CMakeLists.txt
@@ -50,8 +50,7 @@ find_file(JAXRS_API_JAR
NAMES
jaxrs-api.jar
PATHS
- /usr/share/java/resteasy
- /usr/share/java/resteasy-base
+ ${RESTEASY_LIB}
)
# '${JAVA_LIB_INSTALL_DIR}' jars
diff --git a/base/tks/src/CMakeLists.txt b/base/tks/src/CMakeLists.txt
index 0ff69ae..9d0d3a7 100644
--- a/base/tks/src/CMakeLists.txt
+++ b/base/tks/src/CMakeLists.txt
@@ -50,8 +50,7 @@ find_file(JAXRS_API_JAR
NAMES
jaxrs-api.jar
PATHS
- /usr/share/java/resteasy
- /usr/share/java/resteasy-base
+ ${RESTEASY_LIB}
)
diff --git a/specs/pki-core.spec b/specs/pki-core.spec
index 8c3c791..4051ad7 100644
--- a/specs/pki-core.spec
+++ b/specs/pki-core.spec
@@ -462,7 +462,6 @@ This package is a part of the PKI Core used by the Certificate System.
%clean
%{__rm} -rf %{buildroot}
-
%build
%{__mkdir_p} build
cd build
@@ -471,6 +470,11 @@ cd build
-DBUILD_PKI_CORE:BOOL=ON \
-DJAVA_LIB_INSTALL_DIR=%{_jnidir} \
-DSYSTEMD_LIB_INSTALL_DIR=%{_unitdir} \
+%if 0%{?rhel}
+ -DRESTEASY_LIB=/usr/share/java/resteasy-base \
+%else
+ -DRESTEASY_LIB=/usr/share/java/resteasy \
+%endif
%{?_without_javadoc:-DWITH_JAVADOC:BOOL=OFF} \
%if ! 0%{?rhel} && 0%{?fedora} <= 17
-DBUILD_PKI_SELINUX:BOOL=ON \