From 23a85bbc2d16f8ef50b7a53dc1e73597501e6f34 Mon Sep 17 00:00:00 2001
From: Endi Sukma Dewata <edewata@redhat.com>
Date: Tue, 27 Mar 2012 12:09:05 -0500
Subject: [PATCH] Replaced Candlepin with RESTEasy.

Previously the code depends on the old RESTEasy libraries provided by
Candlepin package. Now the Eclipse classpath, build/setup scripts, and
the spec file have been updated to use the libraries provided by the
new RESTEasy package.

Ticket #29
---
 .classpath                                         |    7 +++----
 base/common/src/CMakeLists.txt                     |    8 ++++----
 base/deploy/CMakeLists.txt                         |   11 -----------
 base/setup/CMakeLists.txt                          |   11 -----------
 .../jars/resteasy-jettison-provider-2.3-RC1.jar    |  Bin 32378 -> 0 bytes
 base/setup/pkicommon.pm                            |    6 +++---
 base/setup/pkicreate                               |   12 ++++++------
 specs/pki-core.spec                                |   11 ++++++-----
 8 files changed, 22 insertions(+), 44 deletions(-)
 delete mode 100644 base/setup/jars/resteasy-jettison-provider-2.3-RC1.jar

diff --git a/.classpath b/.classpath
index e216eb943612617d5839fe6ef0b1451e89514ab0..32f786e15c26236433bd450ac1d5e8cb72f31500 100644
--- a/.classpath
+++ b/.classpath
@@ -24,14 +24,13 @@
 	<classpathentry kind="lib" path="/usr/share/java/servlet.jar"/>
 	<classpathentry kind="lib" path="/usr/share/java/xerces-j2.jar"/>
 	<classpathentry kind="lib" path="/usr/share/java/junit4.jar"/>
-	<classpathentry kind="lib" path="/usr/share/candlepin/lib/jaxrs-api-2.2.1.GA.jar"/>
-	<classpathentry kind="lib" path="/usr/share/candlepin/lib/resteasy-jaxrs-2.2.1.GA.jar"/>
 	<classpathentry kind="lib" path="/usr/share/java/apache-commons-cli.jar"/>
 	<classpathentry kind="lib" path="/usr/share/java/jakarta-commons-httpclient.jar"/>
 	<classpathentry kind="lib" path="/usr/share/java/apache-commons-logging.jar"/>
 	<classpathentry kind="lib" path="/usr/share/java/commons-codec.jar"/>
-	<classpathentry kind="lib" path="/usr/share/candlepin/lib/jaxb-impl-2.1.12.jar"/>
-	<classpathentry kind="lib" path="/usr/share/candlepin/lib/resteasy-jaxb-provider-2.2.1.GA.jar"/>
 	<classpathentry kind="lib" path="/usr/share/tomcat6/lib/catalina.jar"/>
+	<classpathentry kind="lib" path="/usr/share/java/resteasy/resteasy-jaxb-provider.jar"/>
+	<classpathentry kind="lib" path="/usr/share/java/resteasy/resteasy-jaxrs.jar"/>
+	<classpathentry kind="lib" path="/usr/share/java/resteasy/jaxrs-api.jar"/>
 	<classpathentry kind="output" path="build/classes"/>
 </classpath>
diff --git a/base/common/src/CMakeLists.txt b/base/common/src/CMakeLists.txt
index 7a7c38a44c95e97c3aeadeb198d3041dd8756dce..01ff33e47760a40d8490bce131a79ef52fdee59e 100644
--- a/base/common/src/CMakeLists.txt
+++ b/base/common/src/CMakeLists.txt
@@ -64,16 +64,16 @@ find_file(XERCES_JAR
 
 find_file(JAXRS_API_JAR
     NAMES
-        jaxrs-api-2.2.1.GA.jar
+        jaxrs-api.jar
     PATHS
-        /usr/share/candlepin/lib
+        /usr/share/java/resteasy
 )
 
 find_file(RESTEASY_JAXRS_JAR
     NAMES
-        resteasy-jaxrs-2.2.1.GA.jar
+        resteasy-jaxrs.jar
     PATHS
-        /usr/share/candlepin/lib
+        /usr/share/java/resteasy
 )
 
 set(pki-certsrv_java_SRCS
diff --git a/base/deploy/CMakeLists.txt b/base/deploy/CMakeLists.txt
index 11d70c55ddbf90d3393b65db9166e318282f49a6..65c3eacc0dd2b9dd9cb66e7d7f46ce2743786bd0 100644
--- a/base/deploy/CMakeLists.txt
+++ b/base/deploy/CMakeLists.txt
@@ -63,17 +63,6 @@ install(
                 \"\$ENV{DESTDIR}${PYTHON_SITE_PACKAGES}/pki/deployment/__init__.py\")"
 )
 
-#install(
-#    FILES
-#        jars/resteasy-jettison-provider-2.3-RC1.jar
-#    DESTINATION
-#        ${JAVA_JAR_INSTALL_DIR}        
-#    PERMISSIONS
-#        OWNER_EXECUTE OWNER_WRITE OWNER_READ
-#        GROUP_EXECUTE GROUP_READ
-#        WORLD_EXECUTE WORLD_READ
-#)
-
 # install empty directories
 #install(CODE "file(MAKE_DIRECTORY \$ENV{DESTDIR}${VAR_INSTALL_DIR}/lock/pki)")
 #install(CODE "file(MAKE_DIRECTORY \$ENV{DESTDIR}${VAR_INSTALL_DIR}/run/pki)")
diff --git a/base/setup/CMakeLists.txt b/base/setup/CMakeLists.txt
index 2ed50ee6249c3d70c1075a1e572b4d7656ed2a0c..05f18332ddddd8170709d97d969b109b41b0d0d0 100644
--- a/base/setup/CMakeLists.txt
+++ b/base/setup/CMakeLists.txt
@@ -27,17 +27,6 @@ install(
         WORLD_EXECUTE WORLD_READ
 )
 
-install(
-    FILES
-        jars/resteasy-jettison-provider-2.3-RC1.jar
-    DESTINATION
-        ${JAVA_JAR_INSTALL_DIR}        
-    PERMISSIONS
-        OWNER_EXECUTE OWNER_WRITE OWNER_READ
-        GROUP_EXECUTE GROUP_READ
-        WORLD_EXECUTE WORLD_READ
-)
-
 # install empty directories
 install(CODE "file(MAKE_DIRECTORY \$ENV{DESTDIR}${VAR_INSTALL_DIR}/lock/pki)")
 install(CODE "file(MAKE_DIRECTORY \$ENV{DESTDIR}${VAR_INSTALL_DIR}/run/pki)")
diff --git a/base/setup/jars/resteasy-jettison-provider-2.3-RC1.jar b/base/setup/jars/resteasy-jettison-provider-2.3-RC1.jar
deleted file mode 100644
index da7106ddd97e2106c5397be45db78728f1adebdf..0000000000000000000000000000000000000000
GIT binary patch
diff --git a/base/setup/pkicommon.pm b/base/setup/pkicommon.pm
index 6ce255303ff802ec04fb5222925a42b1d8f1cc84..b96b9489c57998e2d76a92729d6a0c9b0bd5650a 100755
--- a/base/setup/pkicommon.pm
+++ b/base/setup/pkicommon.pm
@@ -184,7 +184,7 @@ our $default_ldapmodify_command    = undef;
 our $default_modutil_command       = undef;
 our $default_initscripts_path      = undef;
 our $default_registry_path         = undef;
-my  $candlepin_java_path           = "/usr/share/candlepin/lib";
+my  $resteasy_path                 = "/usr/share/java/resteasy";
 
 our $default_dir_permissions       = 00770;
 our $default_exe_permissions       = 00770;
@@ -220,7 +220,7 @@ if ($^O eq "linux") {
         $default_java_path             = "/usr/share/java";
         $default_pki_java_path         = "/usr/share/java/pki";
         $default_system_jni_java_path  = "/usr/lib/java";
-        @default_jar_path = ($default_pki_java_path, $default_java_path, $default_system_jni_java_path, $candlepin_java_path);
+        @default_jar_path = ($default_pki_java_path, $default_java_path, $default_system_jni_java_path, $resteasy_path);
     } elsif ($default_hardware_platform eq "x86_64") {
         # 64-bit Linux
         $default_system_binaries       = "/bin";
@@ -232,7 +232,7 @@ if ($^O eq "linux") {
         $default_x86_64_jni_java_path  = "/usr/lib64/java";
         $default_system_jni_java_path  = "/usr/lib/java";
         @default_jar_path = ($default_pki_java_path, $default_java_path, $default_x86_64_jni_java_path,
-                             $default_system_jni_java_path, $candlepin_java_path);
+                             $default_system_jni_java_path, $resteasy_path);
     } else {
         emit("Unsupported '$^O' hardware platform '$default_hardware_platform'!", "error");
         exit 255;
diff --git a/base/setup/pkicreate b/base/setup/pkicreate
index edde86ecca20c6b515a3facff92070ec709c27d7..19f268a00db43109a46e80cd97a3f78a24caa257 100755
--- a/base/setup/pkicreate
+++ b/base/setup/pkicreate
@@ -187,13 +187,13 @@ my $velocity_jar_base_name        = "velocity.jar";        # CA, KRA, OCSP, TKS
 my $xerces_jar_base_name          = "xerces-j2.jar";       # CA, KRA, OCSP, TKS
 
 # resteasy jars
-my $javassist_jar_base_name       = "javassist-3.9.0.GA.jar";                      # CA, KRA, OCSP, TKS
-my $jaxrs_api_jar_base_name       = "jaxrs-api-2.2.1.GA.jar";                      # CA, KRA, OCSP, TKS
-my $resteasy_jaxb_provider_jar_base_name = "resteasy-jaxb-provider-2.2.1.GA.jar";  # CA, KRA, OCSP, TKS
-my $resteasy_jaxrs_jar_base_name  = "resteasy-jaxrs-2.2.1.GA.jar";                 # CA, KRA, OCSP, TKS
-my $scannotation_jar_base_name    = "scannotation-1.0.2.jar";                      # CA, KRA, OCSP, TKS
+my $javassist_jar_base_name       = "javassist.jar";                               # CA, KRA, OCSP, TKS
+my $jaxrs_api_jar_base_name       = "jaxrs-api.jar";                               # CA, KRA, OCSP, TKS
+my $resteasy_jaxb_provider_jar_base_name = "resteasy-jaxb-provider.jar";           # CA, KRA, OCSP, TKS
+my $resteasy_jaxrs_jar_base_name  = "resteasy-jaxrs.jar";                          # CA, KRA, OCSP, TKS
+my $scannotation_jar_base_name    = "scannotation.jar";                            # CA, KRA, OCSP, TKS
 my $jettison_jar_base_name        = "jettison.jar";                                # CA, KRA, OCSP, TKS
-my $resteasy_jettison_provider_jar_base_name = "resteasy-jettison-provider-2.3-RC1.jar"; # CA, KRA, OCSP, TKS
+my $resteasy_jettison_provider_jar_base_name = "resteasy-jettison-provider.jar";   # CA, KRA, OCSP, TKS
 
 my $apache_commons_collections_jar_base_name  = "apache-commons-collections.jar";
 my $jakarta_commons_collections_jar_base_name = "jakarta-commons-collections.jar";
diff --git a/specs/pki-core.spec b/specs/pki-core.spec
index 329b84c4ad98a338c323944f02741778536beff4..7fe2b60fda1afed4c5909518baca7b1da2f45bf0 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}12%{?prerel}%{?dist}
+Release:          %{?relprefix}13%{?prerel}%{?dist}
 Summary:          Certificate System - PKI Core Components
 URL:              http://pki.fedoraproject.org/
 License:          GPLv2
@@ -41,7 +41,7 @@ BuildRequires:    selinux-policy-devel
 BuildRequires:    velocity
 BuildRequires:    xalan-j2
 BuildRequires:    xerces-j2
-BuildRequires:    candlepin-deps >= 0.0.21-1
+BuildRequires:    resteasy >= 2.3.2-1
 %if 0%{?fedora} >= 17
 BuildRequires:    junit
 %else
@@ -337,7 +337,7 @@ Group:            System Environment/Base
 BuildArch:        noarch
 
 Requires:         java >= 1:1.6.0
-Requires:         candlepin-deps >= 0.0.21-1
+Requires:         resteasy >= 2.3.2-1
 Requires:         javassist
 Requires:         jettison
 Requires:         pki-common-theme >= 9.0.0
@@ -1076,7 +1076,6 @@ fi
 #%if 0%{?fedora} >= 16
 #%{_bindir}/pkicontrol
 #%endif
-#%{_javadir}/resteasy-jettison-provider-2.3-RC1.jar
 
 
 %files -n pki-setup
@@ -1095,7 +1094,6 @@ fi
 %if 0%{?fedora} >= 16
 %{_bindir}/pkicontrol
 %endif
-%{_javadir}/resteasy-jettison-provider-2.3-RC1.jar
 
 
 %files -n pki-symkey
@@ -1324,6 +1322,9 @@ fi
 
 
 %changelog
+* Fri Mar 27 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.13.a1
+- Removed resteasy-jettison-provider-2.3-RC1.jar
+
 * Fri Mar 23 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.12.a1
 - Added option to build without Javadoc
 
-- 
1.7.9.3

