>From 9a4ce4f4dbda741e0c3c533acfbee90c678fa39b Mon Sep 17 00:00:00 2001
From: Ade Lee <alee@redhat.com>
Date: Wed, 21 Nov 2012 10:16:04 -0500
Subject: [PATCH] Misc changes to get rhel 7 build to work

1. Modified cmake dependency
2. Corrected conditionals in spec file
3. Added paths for resteasy-base
4. Added paths to policy for resteasy-base
---
 base/ca/src/CMakeLists.txt         |  1 +
 base/common/shared/conf/pki.policy | 20 ++++++++++++++++++++
 base/common/src/CMakeLists.txt     |  3 +++
 base/java-tools/src/CMakeLists.txt |  3 +++
 base/kra/src/CMakeLists.txt        |  1 +
 base/ocsp/src/CMakeLists.txt       |  1 +
 base/tks/src/CMakeLists.txt        |  1 +
 specs/pki-console.spec             |  2 +-
 specs/pki-core.spec                | 14 +++++++-------
 specs/pki-ra.spec                  |  2 +-
 specs/pki-tps.spec                 |  2 +-
 11 files changed, 40 insertions(+), 10 deletions(-)

diff --git a/base/ca/src/CMakeLists.txt b/base/ca/src/CMakeLists.txt
index f4349efaaec3762eb3dbf96ee1f429f6534d12bb..aa19cc42baedfb36aee420445fbb358a7365bff0 100644
--- a/base/ca/src/CMakeLists.txt
+++ b/base/ca/src/CMakeLists.txt
@@ -29,6 +29,7 @@ find_file(JAXRS_API_JAR
         jaxrs-api.jar
     PATHS
         /usr/share/java/resteasy
+        /usr/share/java/resteasy-base
 )
 
 # build pki-ca
diff --git a/base/common/shared/conf/pki.policy b/base/common/shared/conf/pki.policy
index d26598671ac606cc24c5dcfe5d7d90183676c8cc..9b71feb760943faf1bcac122bc86269c2a56e92c 100644
--- a/base/common/shared/conf/pki.policy
+++ b/base/common/shared/conf/pki.policy
@@ -118,6 +118,26 @@ 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" {
+        permission java.security.AllPermission;
+};
+
 grant codeBase "file:/usr/share/java/scannotation.jar" {
         permission java.security.AllPermission;
 };
diff --git a/base/common/src/CMakeLists.txt b/base/common/src/CMakeLists.txt
index c589cb184b801f4e5e533629d6c39381e775247c..e21f13ce69e3ecbb2aff4a52db689784ccc0a429 100644
--- a/base/common/src/CMakeLists.txt
+++ b/base/common/src/CMakeLists.txt
@@ -88,6 +88,7 @@ find_file(JAXRS_API_JAR
         jaxrs-api.jar
     PATHS
         /usr/share/java/resteasy
+        /usr/share/java/resteasy-base
 )
 
 find_file(RESTEASY_JAXRS_JAR
@@ -95,6 +96,7 @@ find_file(RESTEASY_JAXRS_JAR
         resteasy-jaxrs.jar
     PATHS
         /usr/share/java/resteasy
+        /usr/share/java/resteasy-base
 )
 
 find_file(RESTEASY_ATOM_PROVIDER_JAR
@@ -102,6 +104,7 @@ find_file(RESTEASY_ATOM_PROVIDER_JAR
         resteasy-atom-provider.jar
     PATHS
         /usr/share/java/resteasy
+        /usr/share/java/resteasy-base
 )
 
 find_file(HTTPCLIENT_JAR
diff --git a/base/java-tools/src/CMakeLists.txt b/base/java-tools/src/CMakeLists.txt
index 131375bb11592fa9d1b0e192b7c9ea7c57f4fa7c..96aae5c30bbeefae94f8bec7bbdf0db19ce8cbfe 100644
--- a/base/java-tools/src/CMakeLists.txt
+++ b/base/java-tools/src/CMakeLists.txt
@@ -50,6 +50,7 @@ find_file(JAXRS_API_JAR
         jaxrs-api.jar
     PATHS
         /usr/share/java/resteasy
+        /usr/share/java/resteasy-base
 )
 
 find_file(RESTEASY_JAXRS_JAR
@@ -57,6 +58,7 @@ find_file(RESTEASY_JAXRS_JAR
         resteasy-jaxrs.jar
     PATHS
         /usr/share/java/resteasy
+        /usr/share/java/resteasy-base
 )
 
 find_file(RESTEASY_ATOM_PROVIDER_JAR
@@ -64,6 +66,7 @@ find_file(RESTEASY_ATOM_PROVIDER_JAR
         resteasy-atom-provider.jar
     PATHS
         /usr/share/java/resteasy
+        /usr/share/java/resteasy-base
 )
 
 find_file(HTTPCLIENT_JAR
diff --git a/base/kra/src/CMakeLists.txt b/base/kra/src/CMakeLists.txt
index 7f570ddc5a9936e068672c255dfa2697c79ca338..d9ab25cd2fc77d9111804927eda7bf0e6c00b7ca 100644
--- a/base/kra/src/CMakeLists.txt
+++ b/base/kra/src/CMakeLists.txt
@@ -51,6 +51,7 @@ find_file(JAXRS_API_JAR
         jaxrs-api.jar
     PATHS
         /usr/share/java/resteasy
+        /usr/share/java/resteasy-base
 )
 
 # '${JAVA_LIB_INSTALL_DIR}' jars
diff --git a/base/ocsp/src/CMakeLists.txt b/base/ocsp/src/CMakeLists.txt
index 36a1908d14a69d99fb5a243d2c704d9c5be414c1..39468cadd9dee87e6c96e823c2caf69cb2326490 100644
--- a/base/ocsp/src/CMakeLists.txt
+++ b/base/ocsp/src/CMakeLists.txt
@@ -51,6 +51,7 @@ find_file(JAXRS_API_JAR
         jaxrs-api.jar
     PATHS
         /usr/share/java/resteasy
+        /usr/share/java/resteasy-base
 )
 
 # '${JAVA_LIB_INSTALL_DIR}' jars
diff --git a/base/tks/src/CMakeLists.txt b/base/tks/src/CMakeLists.txt
index cf82ccc50f032c113ab28590936adea9586b1d52..0ff69ae3cb73cdaa5869815629addbbabf8a4eff 100644
--- a/base/tks/src/CMakeLists.txt
+++ b/base/tks/src/CMakeLists.txt
@@ -51,6 +51,7 @@ find_file(JAXRS_API_JAR
         jaxrs-api.jar
     PATHS
         /usr/share/java/resteasy
+        /usr/share/java/resteasy-base
 )
 
 
diff --git a/specs/pki-console.spec b/specs/pki-console.spec
index a8b010ea3411e592d697ba83056d8dd019af6df5..49c6ebe430988da3c1515417e781c65385209dca 100644
--- a/specs/pki-console.spec
+++ b/specs/pki-console.spec
@@ -17,7 +17,7 @@ BuildArch:        noarch
 
 BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-BuildRequires:    cmake >= 2.8.10.1-1
+BuildRequires:    cmake >= 2.8.9-1
 BuildRequires:    idm-console-framework
 BuildRequires:    java-devel >= 1:1.6.0
 BuildRequires:    ldapjdk
diff --git a/specs/pki-core.spec b/specs/pki-core.spec
index 22ae5699dacb8f74b49c565e2dfccb4096565dd4..e9234529a7dabf4bc6a5a3d75612f9bc786bc06b 100644
--- a/specs/pki-core.spec
+++ b/specs/pki-core.spec
@@ -22,7 +22,7 @@ Group:            System Environment/Daemons
 
 BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-BuildRequires:    cmake >= 2.8.10.1-1
+BuildRequires:    cmake >= 2.8.9-1
 BuildRequires:    zip
 BuildRequires:    java-devel >= 1:1.6.0
 BuildRequires:    redhat-rpm-config
@@ -49,7 +49,7 @@ BuildRequires:    jss >= 4.2.6-24
 BuildRequires:    systemd-units
 BuildRequires:    tomcatjss >= 7.0.0-3
 
-%if 0%{?fedora} <= 17
+%if ! 0%{?rhel} && 0%{?fedora} <= 17
 BuildRequires:    tomcatjss >= 6.0.2
 BuildRequires:    selinux-policy-devel >= 3.10.0-151
 %endif
@@ -251,7 +251,7 @@ Requires:         pki-server-theme >= 10.0.0
 Requires:         pki-base = %{version}-%{release}
 Requires:         pki-tools = %{version}-%{release}
 
-%if 0%{?fedora} <= 17
+%if ! 0%{?rhel} && 0%{?fedora} <= 17
 Requires:         pki-selinux = %{version}-%{release}
 %else
 Requires:         selinux-policy-base >= 3.11.1-43
@@ -279,7 +279,7 @@ The package contains scripts to create and remove PKI subsystems.
 
 %{overview}
 
-%if 0%{?fedora} <= 17
+%if ! 0%{?rhel} && 0%{?fedora} <= 17
 %package -n       pki-selinux
 Summary:          Certificate System - PKI Selinux Policies
 Group:            System Environment/Base
@@ -472,7 +472,7 @@ cd build
 	-DJAVA_LIB_INSTALL_DIR=%{_jnidir} \
 	-DSYSTEMD_LIB_INSTALL_DIR=%{_unitdir} \
 	%{?_without_javadoc:-DWITH_JAVADOC:BOOL=OFF} \
-%if 0%{?fedora} <= 17
+%if ! 0%{?rhel} && 0%{?fedora} <= 17
         -DBUILD_PKI_SELINUX:BOOL=ON \
 %endif
 	..
@@ -538,7 +538,7 @@ if [ -d /etc/sysconfig/pki/%i ]; then                                        \
 fi                                                                           \
 )
 
-%if 0%{?fedora} <= 17
+%if ! 0%{?rhel} && 0%{?fedora} <= 17
 %pre -n pki-selinux
 %saveFileContext targeted
 
@@ -870,7 +870,7 @@ fi
 %dir %{_datadir}/pki/server
 %{_datadir}/pki/server/
 
-%if 0%{?fedora} <= 17
+%if ! 0%{?rhel} && 0%{?fedora} <= 17
 %files -n pki-selinux
 %defattr(-,root,root,-)
 %doc base/selinux/LICENSE
diff --git a/specs/pki-ra.spec b/specs/pki-ra.spec
index aa5b4516d7ce009f6a4decf074e3163eac322121..fb620b2823e20f822919c2aa736e482a4816d8bf 100644
--- a/specs/pki-ra.spec
+++ b/specs/pki-ra.spec
@@ -17,7 +17,7 @@ BuildArch:        noarch
 
 BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-BuildRequires:    cmake  >= 2.8.10.1-1
+BuildRequires:    cmake  >= 2.8.9-1
 BuildRequires:    nspr-devel
 BuildRequires:    nss-devel
 
diff --git a/specs/pki-tps.spec b/specs/pki-tps.spec
index 8f014e692180a9cc8e6d2b65432229d7db2fdda4..53c18ec2cfec22dad9e95874dfa24147884732f3 100644
--- a/specs/pki-tps.spec
+++ b/specs/pki-tps.spec
@@ -15,7 +15,7 @@ Group:            System Environment/Daemons
 
 BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-BuildRequires:    cmake >= 2.8.10.1-1
+BuildRequires:    cmake >= 2.8.9-1
 BuildRequires:    apr-devel
 BuildRequires:    apr-util-devel
 BuildRequires:    cyrus-sasl-devel
-- 
1.7.11.7

