From 1907f9f9f9cccd891222da3e5083e2a2046a8f99 Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Tue, 14 Aug 2012 14:56:58 +0400
Subject: [PATCH 1/3] CentOS 6.3 Changes

---
 Makefile                                           |    8 +-
 backend/manager/conf/ca/encryptpasswd.sh           |    4 +-
 backend/manager/conf/ca/generate-ssh-keys          |   25 +-
 backend/manager/conf/ca/store-utils.sh             |   23 +-
 .../manager/conf/kerberos/engine-manage-domains    |   64 +++-
 backend/manager/conf/vds_installer.py              |    2 +-
 .../engine-config/src/main/resources/engine-config |   47 ++-
 packaging/fedora/setup/basedefs.py                 |    3 +-
 packaging/fedora/spec/ovirt-engine.spec.in         |  380 +++++++++++---------
 pom.xml                                            |    1 +
 10 files changed, 336 insertions(+), 221 deletions(-)

diff --git a/Makefile b/Makefile
index cc949fb..46e72ae 100644
--- a/Makefile
+++ b/Makefile
@@ -296,6 +296,11 @@ install_misc:
 	install -m 755 packaging/resources/ovirtlogrot.sh ${PREFIX}/usr/share/ovirt-engine/scripts/
 	install -m 755 packaging/resources/ovirt-cron ${PREFIX}/etc/cron.daily/
 	install -m 644 packaging/resources/ovirt-tmpfilesd ${PREFIX}/etc/tmpfiles.d/ovirt-engine.conf
+	#Copy additional jars
+	cp -f ../../../ext/commons-jxpath-1.3.jar ${PREFIX}/usr/share/ovirt-engine/engine.ear/lib/
+	cp -f ../../../ext/commons-logging-1.0.4.jar ${PREFIX}/usr/share/ovirt-engine/engine.ear/lib/
+	cp -f ../../../ext/jtype-0.1.2.jar ${PREFIX}/usr/share/ovirt-engine/engine.ear/lib/
+
 
 install_jboss_modules:
 	@echo "*** Deploying JBoss modules"
@@ -359,4 +364,5 @@ install_service:
 	install -m 644 packaging/fedora/engine-service.sysconfig $(PREFIX)/etc/sysconfig/ovirt-engine
 	install -m 644 packaging/fedora/engine-service.limits $(PREFIX)/etc/security/limits.d/10-ovirt-engine.conf
 	install -m 755 packaging/fedora/engine-service.py $(PREFIX)/usr/share/ovirt-engine/scripts
-	install -m 644 packaging/fedora/engine-service.systemd $(PREFIX)/usr/lib/systemd/system/ovirt-engine.service
+	install -m 755 packaging/fedora/engine-service.systemv $(PREFIX)/etc/rc.d/init.d/ovirt-engine
+#	install -m 644 packaging/fedora/engine-service.systemd $(PREFIX)/usr/lib/systemd/system/ovirt-engine.service
diff --git a/backend/manager/conf/ca/encryptpasswd.sh b/backend/manager/conf/ca/encryptpasswd.sh
index 803271f..1463991 100644
--- a/backend/manager/conf/ca/encryptpasswd.sh
+++ b/backend/manager/conf/ca/encryptpasswd.sh
@@ -26,6 +26,7 @@ if [[ "x${JAVA_HOME}" != "x" ]] ;then
     JAVA_BIN=$JAVA_HOME/bin/java
 fi
 
+EAR_LIB=/usr/share/ovirt-engine/engine.ear/lib
 
 pushd  $JBOSS_HOME
 #if [ -e "common/lib/jbosssx.jar" ]; then
@@ -37,7 +38,8 @@ pushd  $JBOSS_HOME
 #        exit 1
 #fi
 
-$JAVA_BIN -cp `build-classpath jboss-logging picketbox/picketbox` org.picketbox.datasource.security.SecureIdentityLoginModule $1
+#$JAVA_BIN -cp `build-classpath jboss-logging picketbox/picketbox` org.picketbox.datasource.security.SecureIdentityLoginModule $1
+$JAVA_BIN -cp $EAR_LIB/picketbox-4.0.7.Final.jar:$EAR_LIB/jboss-logging-3.1.0.GA.jar org.picketbox.datasource.security.SecureIdentityLoginModule $1
 
 popd
 
diff --git a/backend/manager/conf/ca/generate-ssh-keys b/backend/manager/conf/ca/generate-ssh-keys
index 3a3956b..e790234 100755
--- a/backend/manager/conf/ca/generate-ssh-keys
+++ b/backend/manager/conf/ca/generate-ssh-keys
@@ -8,13 +8,23 @@ STORE_PASS="NoSoup4U"
 SSH_PRIV_KEY="${CA_DIR}/keys/engine_id_rsa"
 PKEY_8="${CA_DIR}/keys/privatekey.pkcs8"
 
-CLASS_PATH=`\
-build-classpath \
-apache-commons-codec \
-jboss-logging \
-ovirt-engine/compat \
-ovirt-engine/engineencryptutils \
-`
+#CLASS_PATH=`\
+#build-classpath \
+#apache-commons-codec \
+#jboss-logging \
+#ovirt-engine/compat \
+#ovirt-engine/engineencryptutils \
+#`
+
+EAR_LIB=/usr/share/ovirt-engine/engine.ear/lib
+ENGINE_LIB=/usr/share/java/ovirt-engine
+
+CP=\
+$EAR_LIB/commons-codec-1.4.jar:\
+$EAR_LIB/jboss-logging-3.1.0.GA.jar:\
+$ENGINE_LIB/compat.jar:\
+$ENGINE_LIB/engineencryptutils.jar
+
 
 usage () {
     echo "generate-ssh-keys [-s keystore] [-p passwd] [-a alias]  [-k sshkey]"
@@ -68,6 +78,7 @@ fi
 
 #generating ssh private key
 java -cp ${CLASS_PATH} org.ovirt.engine.core.engineencryptutils.StoreUtils -pvk -store=${KEY_STORE} -pass=${STORE_PASS} -alias=${KEY_ALIAS} > ${PKEY_8}
+java -cp $CP org.ovirt.engine.core.engineencryptutils.StoreUtils -pvk -store=${KEY_STORE} -pass=${STORE_PASS} -alias=${KEY_ALIAS} > ${PKEY_8}
 _verifyRC $? "ERROR: failed extracting private key from keystore"
 echo "-----BEGIN PRIVATE KEY-----" > ${SSH_PRIV_KEY}
 openssl enc -in ${PKEY_8} -a >> ${SSH_PRIV_KEY}
diff --git a/backend/manager/conf/ca/store-utils.sh b/backend/manager/conf/ca/store-utils.sh
index 18d9abe..2f51715 100755
--- a/backend/manager/conf/ca/store-utils.sh
+++ b/backend/manager/conf/ca/store-utils.sh
@@ -27,13 +27,22 @@ if [ ! "$#" -ge 4 ]; then
 	exit 1
 fi
 
-CP=`\
-build-classpath \
-apache-commons-codec \
-apache-commons-logging \
-ovirt-engine/compat \
-ovirt-engine/engineencryptutils \
-`
+#CP=`\
+#build-classpath \
+#apache-commons-codec \
+#apache-commons-logging \
+#ovirt-engine/compat \
+#ovirt-engine/engineencryptutils \
+#`
+
+EAR_LIB=/usr/share/ovirt-engine/engine.ear/lib
+ENGINE_LIB=/usr/share/java/ovirt-engine
+
+CP=\
+$EAR_LIB/commons-codec-1.4.jar:\
+$EAR_LIB/commons-logging-1.0.4.jar:\
+$ENGINE_LIB/compat.jar:\
+$ENGINE_LIB/engineencryptutils.jar
 
 if [ "$1" == "-pfx" ]; then
 	PKEY_8=privatekey.pkcs8
diff --git a/backend/manager/conf/kerberos/engine-manage-domains b/backend/manager/conf/kerberos/engine-manage-domains
index 6b757a4..e1bf945 100755
--- a/backend/manager/conf/kerberos/engine-manage-domains
+++ b/backend/manager/conf/kerberos/engine-manage-domains
@@ -93,27 +93,51 @@ if [ "$1" == "--help" -o "$1" == "-h" ]; then
         exit 0
 fi
 
+#CP=\
+#$CONF_DIR:`\
+#build-classpath \
+#apache-commons-codec \
+#apache-commons-collections \
+#apache-commons-configuration \
+#apache-commons-jxpath \
+#apache-commons-lang \
+#apache-commons-logging \
+#log4j \
+#ovirt-engine/common \
+#ovirt-engine/compat \
+#ovirt-engine/engineencryptutils \
+#ovirt-engine/engine-tools-common \
+#ovirt-engine/utils \
+#postgresql-jdbc \
+#springframework/spring-beans \
+#springframework/spring-core \
+#springframework/spring-tx \
+#spring-ldap/spring-ldap-core \
+#`
+
+ENGINE_LIB=/usr/share/java/ovirt-engine
+EAR_LIB=/usr/share/ovirt-engine/engine.ear/lib
+
 CP=\
-$CONF_DIR:`\
-build-classpath \
-apache-commons-codec \
-apache-commons-collections \
-apache-commons-configuration \
-apache-commons-jxpath \
-apache-commons-lang \
-apache-commons-logging \
-log4j \
-ovirt-engine/common \
-ovirt-engine/compat \
-ovirt-engine/engineencryptutils \
-ovirt-engine/engine-tools-common \
-ovirt-engine/utils \
-postgresql-jdbc \
-springframework/spring-beans \
-springframework/spring-core \
-springframework/spring-tx \
-spring-ldap/spring-ldap-core \
-`
+$CONF_DIR:\
+$EAR_LIB/commons-codec-1.4.jar:\
+$EAR_LIB/commons-collections-3.1.jar:\
+$EAR_LIB/commons-configuration-1.6.jar:\
+$EAR_LIB/commons-jxpath-1.3.jar:\
+$EAR_LIB/commons-lang-2.4.jar:\
+$EAR_LIB/commons-logging-1.0.4.jar:\
+$EAR_LIB/log4j-1.2.16.jar:\
+$EAR_LIB/postgresql-jdbc.jar:\
+$EAR_LIB/spring-beans-2.5.6.SEC02.jar:\
+$EAR_LIB/spring-core-2.5.6.SEC02.jar:\
+$EAR_LIB/spring-tx-2.5.6.SEC02.jar:\
+$EAR_LIB/spring-ldap-core-1.3.0.RELEASE.jar:\
+$ENGINE_LIB/compat.jar:\
+$ENGINE_LIB/common.jar:\
+$ENGINE_LIB/engine-config.jar:\
+$ENGINE_LIB/engineencryptutils.jar:\
+$ENGINE_LIB/engine-tools-common.jar:\
+$ENGINE_LIB/utils.jar
 
 for f in $(echo $CP|sed 's/:/ /g')
 do
diff --git a/backend/manager/conf/vds_installer.py b/backend/manager/conf/vds_installer.py
index 7c808a4..0bbd1e1 100644
--- a/backend/manager/conf/vds_installer.py
+++ b/backend/manager/conf/vds_installer.py
@@ -13,7 +13,7 @@ import string
 import random
 import re
 
-SUPPORTED_PLATFORMS = [ "RedHatEnterpriseServer", "Fedora" ]
+SUPPORTED_PLATFORMS = [ "RedHatEnterpriseServer", "Fedora", "CentOS", "Scientific", "Oracle" ]
 HYPERVISOR_PLATFORMS = [ "RedHatEnterpriseVirtualizationHypervisor", "RedHatEnterpriseHypervisor", "oVirtNodeHypervisor" ]
 HYPERVISOR_RELEASE_FILE = '/etc/rhev-hypervisor-release'
 REDHAT_RELEASE_FILE = '/etc/redhat-release'
diff --git a/backend/manager/tools/engine-config/src/main/resources/engine-config b/backend/manager/tools/engine-config/src/main/resources/engine-config
index f84c349..5370474 100755
--- a/backend/manager/tools/engine-config/src/main/resources/engine-config
+++ b/backend/manager/tools/engine-config/src/main/resources/engine-config
@@ -89,21 +89,38 @@ if [ "$1" == "--help" -o "$1" == "-h" ]; then
         exit 0
 fi
 
-CP=`\
-build-classpath \
-apache-commons-codec \
-apache-commons-collections \
-apache-commons-configuration \
-apache-commons-jxpath \
-apache-commons-lang \
-apache-commons-logging \
-log4j \
-ovirt-engine/compat \
-ovirt-engine/engine-config \
-ovirt-engine/engineencryptutils \
-ovirt-engine/engine-tools-common \
-postgresql-jdbc \
-`
+#CP=`\
+#build-classpath \
+#apache-commons-codec \
+#apache-commons-collections \
+#apache-commons-configuration \
+#apache-commons-jxpath \
+#apache-commons-lang \
+#apache-commons-logging \
+#log4j \
+#ovirt-engine/compat \
+#ovirt-engine/engine-config \
+#ovirt-engine/engineencryptutils \
+#ovirt-engine/engine-tools-common \
+#postgresql-jdbc \
+#`
+
+ENGINE_LIB=/usr/share/java/ovirt-engine
+EAR_LIB=/usr/share/ovirt-engine/engine.ear/lib
+
+CP=\
+$EAR_LIB/commons-codec-1.4.jar:\
+$EAR_LIB/commons-collections-3.1.jar:\
+$EAR_LIB/commons-configuration-1.6.jar:\
+$EAR_LIB/commons-jxpath-1.3.jar:\
+$EAR_LIB/commons-lang-2.4.jar:\
+$EAR_LIB/commons-logging-1.0.4.jar:\
+$EAR_LIB/log4j-1.2.16.jar:\
+$EAR_LIB/postgresql-jdbc.jar:\
+$ENGINE_LIB/compat.jar:\
+$ENGINE_LIB/engine-config.jar:\
+$ENGINE_LIB/engineencryptutils.jar:\
+$ENGINE_LIB/engine-tools-common.jar
 
 # Verify all classpath elements available
 for f in $(echo $CP|sed 's/:/ /g')
diff --git a/packaging/fedora/setup/basedefs.py b/packaging/fedora/setup/basedefs.py
index 022dc4d..50fc662 100644
--- a/packaging/fedora/setup/basedefs.py
+++ b/packaging/fedora/setup/basedefs.py
@@ -18,7 +18,8 @@ JBOSS_USER_NAME="ovirt"
 JBOSS_GROUP_NAME="ovirt"
 HTTPD_SERVICE_NAME="httpd"
 HTTP_PORT_POLICY="http_port_t"
-NFS_SERVICE_NAME="nfs-server"
+#NFS_SERVICE_NAME="nfs-server"
+NFS_SERVICE_NAME="nfs"
 NOTIFIER_SERVICE_NAME = "engine-notifierd"
 
 JBOSS_HTTP_PORT="8080"
diff --git a/packaging/fedora/spec/ovirt-engine.spec.in b/packaging/fedora/spec/ovirt-engine.spec.in
index b02e9ad..8e79153 100644
--- a/packaging/fedora/spec/ovirt-engine.spec.in
+++ b/packaging/fedora/spec/ovirt-engine.spec.in
@@ -18,8 +18,8 @@
 
 # Macro to create the engine user:
 %global create_engine_user \
-/bin/getent group %{engine_group} >/dev/null || /sbin/groupadd -r %{engine_group}; \
-/bin/getent passwd %{engine_user} >/dev/null || /sbin/useradd -c "oVirt Manager" -u %{engine_uid} -g %{engine_group} -M -d %{engine_var} %{engine_user}
+/usr/bin/getent group %{engine_group} >/dev/null || /usr/sbin/groupadd -r %{engine_group}; \
+/usr/bin/getent passwd %{engine_user} >/dev/null || /usr/sbin/useradd -c "oVirt Manager" -u %{engine_uid} -g %{engine_group} -M -d %{engine_var} %{engine_user}
 
 
 Name: ovirt-engine
@@ -34,77 +34,77 @@ Source0: http://ovirt.org/releases/stable/src/%{name}-%{version}.tar.gz
 BuildArch: noarch
 
 # Build time requirements:
-BuildRequires: apache-commons-beanutils
-BuildRequires: apache-commons-codec
-BuildRequires: apache-commons-collections
-BuildRequires: apache-commons-configuration
-BuildRequires: apache-commons-jxpath
-BuildRequires: apache-commons-lang
-BuildRequires: apache-commons-logging
-BuildRequires: apache-mina
-BuildRequires: apache-sshd
+#BuildRequires: apache-commons-beanutils
+#BuildRequires: apache-commons-codec
+#BuildRequires: apache-commons-collections
+#BuildRequires: apache-commons-configuration
+#BuildRequires: apache-commons-jxpath
+#BuildRequires: apache-commons-lang
+#BuildRequires: apache-commons-logging
+#BuildRequires: apache-mina
+#BuildRequires: apache-sshd
 BuildRequires: bea-stax-api
 BuildRequires: dos2unix
-BuildRequires: jackson
-BuildRequires: hibernate-commons-annotations
-BuildRequires: hibernate-jpa-2.0-api
-BuildRequires: hibernate-validator
-BuildRequires: jakarta-commons-httpclient
-BuildRequires: java-devel
-BuildRequires: javamail
-BuildRequires: javassist
-BuildRequires: jboss-annotations-1.1-api
-BuildRequires: jboss-ejb-3.1-api
-BuildRequires: jboss-logging
-BuildRequires: jboss-interceptors-1.1-api
-BuildRequires: jboss-servlet-3.0-api
-BuildRequires: jpackage-utils
-BuildRequires: jsch
-BuildRequires: log4j
+#BuildRequires: jackson
+#BuildRequires: hibernate-commons-annotations
+#BuildRequires: hibernate-jpa-2.0-api
+#BuildRequires: hibernate-validator
+#BuildRequires: jakarta-commons-httpclient
+#BuildRequires: java-devel
+#BuildRequires: javamail
+#BuildRequires: javassist
+#BuildRequires: jboss-annotations-1.1-api
+#BuildRequires: jboss-ejb-3.1-api
+#BuildRequires: jboss-logging
+#BuildRequires: jboss-interceptors-1.1-api
+#BuildRequires: jboss-servlet-3.0-api
+#BuildRequires: jpackage-utils
+#BuildRequires: jsch
+#BuildRequires: log4j
 BuildRequires: make
-BuildRequires: maven
-BuildRequires: maven-antrun-plugin
-BuildRequires: maven-assembly-plugin
-BuildRequires: maven-checkstyle-plugin
-BuildRequires: maven-clean-plugin
-BuildRequires: maven-compiler-plugin
-BuildRequires: maven-dependency-plugin
-BuildRequires: maven-ear-plugin
-BuildRequires: maven-eclipse-plugin
-BuildRequires: maven-ejb-plugin
-BuildRequires: maven-jar-plugin
-BuildRequires: maven-jaxb2-plugin
-BuildRequires: maven-javadoc-plugin
-BuildRequires: maven-plugin-exec
-BuildRequires: maven-resources-plugin
-BuildRequires: maven-source-plugin
-BuildRequires: maven-surefire-plugin
-BuildRequires: maven-war-plugin
+#BuildRequires: maven
+#BuildRequires: maven-antrun-plugin
+#BuildRequires: maven-assembly-plugin
+#BuildRequires: maven-checkstyle-plugin
+#BuildRequires: maven-clean-plugin
+#BuildRequires: maven-compiler-plugin
+#BuildRequires: maven-dependency-plugin
+#BuildRequires: maven-ear-plugin
+#BuildRequires: maven-eclipse-plugin
+#BuildRequires: maven-ejb-plugin
+#BuildRequires: maven-jar-plugin
+#BuildRequires: maven-jaxb2-plugin
+#BuildRequires: maven-javadoc-plugin
+#BuildRequires: maven-plugin-exec
+#BuildRequires: maven-resources-plugin
+#BuildRequires: maven-source-plugin
+#BuildRequires: maven-surefire-plugin
+#BuildRequires: maven-war-plugin
 BuildRequires: postgresql-jdbc
-BuildRequires: quartz
-BuildRequires: resteasy
-BuildRequires: springframework-instrument
-BuildRequires: springframework-jdbc
-BuildRequires: spring-ldap
-BuildRequires: xmlrpc3-client
-BuildRequires: unzip
+#BuildRequires: quartz
+#BuildRequires: resteasy
+#BuildRequires: springframework-instrument
+#BuildRequires: springframework-jdbc
+#BuildRequires: spring-ldap
+#BuildRequires: xmlrpc3-client
+#BuildRequires: unzip
 
 # Run time requirements (most of these requirements should be
 # moved to the subpackages):
 Requires: bea-stax-api
 Requires: bind-utils
 Requires: cracklib-python
-Requires: geronimo-validation
-Requires: hibernate-commons-annotations
-Requires: hibernate-jpa-2.0-api
-Requires: hibernate-validator
+#Requires: geronimo-validation
+#Requires: hibernate-commons-annotations
+#Requires: hibernate-jpa-2.0-api
+#Requires: hibernate-validator
 Requires: httpd
 Requires: jakarta-commons-httpclient
 Requires: java
-Requires: jboss-interceptors-1.1-api
-Requires: jboss-logging
+#Requires: jboss-interceptors-1.1-api
+#Requires: jboss-logging
 Requires: jpackage-utils
-Requires: log4j
+#Requires: log4j
 Requires: mod_ssl
 Requires: ntp
 Requires: openssl
@@ -112,13 +112,17 @@ Requires: policycoreutils-python
 Requires: postgresql-jdbc
 Requires: vdsm-bootstrap
 Requires: yum-plugin-versionlock
+Requires: apr
 
 # For local database:
 Requires: postgresql-server >= 8.4.7
 Requires: postgresql-contrib >= 8.4.7
 
 # Require JBoss AS 7:
-Requires: jboss-as >= 7.1.1
+#Requires: jboss-as >= 7.1.1
+#Replacing with JbossAS 7.1.1 binary rpm
+Requires: ovirt-engine-jbossas711
+
 
 # We can't require exactly the same version and release of the
 # setup package because it needs to be updated independely as part
@@ -152,37 +156,37 @@ virtualization infrastructure for Servers and Desktops.
 Summary: Engine core of oVirt Engine
 Group: Virtualization/Management
 Requires: %{name} = %{version}-%{release}
-Requires: antlr-tool
-Requires: aopalliance
-Requires: apache-commons-beanutils
-Requires: apache-commons-codec
-Requires: apache-commons-collections
-Requires: apache-commons-lang
-Requires: apache-mina
-Requires: apache-sshd
+#Requires: antlr-tool
+#Requires: aopalliance
+#Requires: apache-commons-beanutils
+#Requires: apache-commons-codec
+#Requires: apache-commons-collections
+#Requires: apache-commons-lang
+#Requires: apache-mina
+#Requires: apache-sshd
 Requires: bea-stax-api
-Requires: dom4j
-Requires: geronimo-validation
-Requires: jackson
-Requires: jakarta-commons-httpclient
+#Requires: dom4j
+#Requires: geronimo-validation
+#Requires: jackson
+#Requires: jakarta-commons-httpclient
 Requires: java
 Requires: javassist
-Requires: jboss-interceptors-1.1-api
+#Requires: jboss-interceptors-1.1-api
 Requires: jsch
 Requires: objectweb-asm
 Requires: openssh
 Requires: openssl
-Requires: picketbox
-Requires: quartz
-Requires: slf4j
-Requires: springframework
-Requires: springframework-aop
-Requires: springframework-beans
-Requires: springframework-context
-Requires: springframework-instrument
-Requires: springframework-jdbc
-Requires: springframework-tx
-Requires: spring-ldap
+#Requires: picketbox
+#Requires: quartz
+#Requires: slf4j
+#Requires: springframework
+#Requires: springframework-aop
+#Requires: springframework-beans
+#Requires: springframework-context
+#Requires: springframework-instrument
+#Requires: springframework-jdbc
+#Requires: springframework-tx
+#Requires: spring-ldap
 Requires: ws-commons-util
 Requires: xmlrpc3-client
 Requires: xmlrpc3-common
@@ -252,13 +256,13 @@ The web administration interface to oVirt Engine
 Summary: Common libraries for  oVirt Engine Tools
 Group: Virtualization/Management
 Requires: %{name} = %{version}-%{release}
-Requires: apache-commons-collections
-Requires: apache-commons-logging
-Requires: apache-commons-lang
-Requires: apache-commons-codec
-Requires: apache-commons-configuration
-Requires: apache-commons-jxpath
-Requires: log4j
+#Requires: apache-commons-collections
+#Requires: apache-commons-logging
+#Requires: apache-commons-lang
+#Requires: apache-commons-codec
+#Requires: apache-commons-configuration
+#Requires: apache-commons-jxpath
+#Requires: log4j
 
 %description tools-common
 The common libraries used by oVirt Engine Tools
@@ -382,92 +386,92 @@ searchbackend lib/searchbackend
 .
 
 # Remove the jar files that are not needed:
-while read lib_path
-do
-  rm -rf %{buildroot}%{engine_ear}/lib/${lib_path}*.jar
-done <<'.'
-activation
-c3p0
-ejb3-persistence
-jaxb-api
-jboss-interceptors-api_1.1_spec
-stax-api
-xml-apis
-.
+#while read lib_path
+#do
+#  rm -rf %{buildroot}%{engine_ear}/lib/${lib_path}*.jar
+#done <<'.'
+#activation
+#c3p0
+#ejb3-persistence
+#jaxb-api
+#jboss-interceptors-api_1.1_spec
+#stax-api
+#xml-apis
+#.
 
 # Then for the system jar files (using build-classpath):
-while read jar_name lib_path
-do
-  rm -rf %{buildroot}%{engine_ear}/lib/${lib_path}*.jar
-  ln -s `build-classpath ${jar_name}` %{buildroot}%{engine_ear}/lib/${lib_path}.jar
-done <<'.'
-antlr antlr
-aopalliance aopalliance
-commons-beanutils commons-beanutils
-commons-codec commons-codec
-commons-collections commons-collections
-commons-httpclient commons-httpclient
-commons-lang commons-lang
-dom4j dom4j
-apache-mina/mina-core mina-core
-apache-sshd/sshd-core sshd-core
-quartz quartz
-slf4j/api slf4j-api
-ws-commons-util ws-commons-util
-xmlrpc3-client xmlrpc-client
-xmlrpc3-common xmlrpc-common
-geronimo-validation validation-api
-glassfish-jaxb/jaxb-impl jaxb-impl
-hibernate-validator hibernate-validator
-hibernate/hibernate-commons-annotations hibernate-commons-annotations
-jsch jsch
-.
+#while read jar_name lib_path
+#do
+#  rm -rf %{buildroot}%{engine_ear}/lib/${lib_path}*.jar
+#  ln -s `build-classpath ${jar_name}` %{buildroot}%{engine_ear}/lib/${lib_path}.jar
+#done <<'.'
+#antlr antlr
+#aopalliance aopalliance
+#commons-beanutils commons-beanutils
+#commons-codec commons-codec
+#commons-collections commons-collections
+#commons-httpclient commons-httpclient
+#commons-lang commons-lang
+#dom4j dom4j
+#apache-mina/mina-core mina-core
+#apache-sshd/sshd-core sshd-core
+#quartz quartz
+#slf4j/api slf4j-api
+#ws-commons-util ws-commons-util
+#xmlrpc3-client xmlrpc-client
+#xmlrpc3-common xmlrpc-common
+#geronimo-validation validation-api
+#glassfish-jaxb/jaxb-impl jaxb-impl
+#hibernate-validator hibernate-validator
+#hibernate/hibernate-commons-annotations hibernate-commons-annotations
+#jsch jsch
+#.
 
 # Replace jar files in the RESTAPI web application with links to ther
 # actual locations, first for jar files from this package, as for these
 # can't use build-classpath:
-while read jar_name lib_path
-do
-  rm -rf %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}*.jar
-  ln -s %{engine_jar}/${jar_name}.jar %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}.jar
-done <<'.'
-interface-common-jaxrs interface-common-jaxrs
-restapi-definition restapi-definition
-restapi-jaxrs restapi-jaxrs
-restapi-types restapi-types
-.
+#while read jar_name lib_path
+#do
+#  rm -rf %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}*.jar
+#  ln -s %{engine_jar}/${jar_name}.jar %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}.jar
+#done <<'.'
+#interface-common-jaxrs interface-common-jaxrs
+#restapi-definition restapi-definition
+#restapi-jaxrs restapi-jaxrs
+#restapi-types restapi-types
+#.
 
 # Remove the jar files that are not needed:
-while read lib_path
-do
-  rm -rf %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}*.jar
-done <<'.'
-activation
-jaxb-api
-jboss-logging
-jboss-vfs
-sjsxp
-stax-api
-.
+#while read lib_path
+#do
+#  rm -rf %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}*.jar
+#done <<'.'
+#activation
+#jaxb-api
+#jboss-logging
+#jboss-vfs
+#sjsxp
+#stax-api
+#.
 
 # Then for the system jar files (using build-classpath):
-while read jar_name lib_path
-do
-  rm -rf %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}*.jar
-  ln -s `build-classpath ${jar_name}` %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}.jar
-done <<'.'
-aopalliance aopalliance
-commons-codec commons-codec
-commons-httpclient commons-httpclient
-glassfish-jaxb/jaxb-impl jaxb-impl
-jettison jettison
-resteasy/jaxrs-api jaxrs-api
-resteasy/resteasy-jaxb-provider resteasy-jaxb-provider
-resteasy/resteasy-jettison-provider resteasy-jettison-provider
-resteasy/resteasy-yaml-provider resteasy-yaml-provider
-snakeyaml snakeyaml
-istack-commons-runtime istack-commons-runtime
-.
+#while read jar_name lib_path
+#do
+#  rm -rf %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}*.jar
+#  ln -s `build-classpath ${jar_name}` %{buildroot}%{restapi_war}/WEB-INF/lib/${lib_path}.jar
+#done <<'.'
+#aopalliance aopalliance
+#commons-codec commons-codec
+#commons-httpclient commons-httpclient
+#glassfish-jaxb/jaxb-impl jaxb-impl
+#jettison jettison
+#resteasy/jaxrs-api jaxrs-api
+#resteasy/resteasy-jaxb-provider resteasy-jaxb-provider
+#resteasy/resteasy-jettison-provider resteasy-jettison-provider
+#resteasy/resteasy-yaml-provider resteasy-yaml-provider
+#snakeyaml snakeyaml
+#istack-commons-runtime istack-commons-runtime
+#.
 
 %preun
 if [ "$1" -eq 0 ]
@@ -506,6 +510,40 @@ fi
 %pre notification-service
 %create_engine_user
 
+%post
+
+#Add jars to ear from JbossAs
+ln -f -s  /usr/share/jboss-as/modules/org/apache/commons/configuration/main/commons-configuration-1.6.jar %{engine_ear}/lib/commons-configuration-1.6.jar
+ln -f -s  /usr/share/jboss-as/modules/org/apache/log4j/main/log4j-1.2.16.jar %{engine_ear}/lib/log4j-1.2.16.jar
+ln -f -s  /usr/share/jboss-as/modules/org/jboss/logging/main/jboss-logging-3.1.0.GA.jar %{engine_ear}/lib/jboss-logging-3.1.0.GA.jar
+ln -f -s  /usr/share/jboss-as/modules/org/picketbox/main/picketbox-4.0.7.Final.jar %{engine_ear}/lib/picketbox-4.0.7.Final.jar
+ln -f -s  /usr/share/java/postgresql-jdbc.jar %{engine_ear}/lib/postgresql-jdbc.jar
+
+#Replace links in ovirt-engine modules
+ln -f -s %{engine_ear}/lib/jaxb-impl-2.1.3.jar %{engine_usr}/modules/com/sun/xml/bind/main/jaxb-impl.jar
+ln -f -s /usr/share/jboss-as/modules/com/sun/xml/bind/main/jaxb-xjc-2.2.4.jar %{engine_usr}/modules/com/sun/xml/bind/main/jaxb-xjc.jar
+ln -f -s /usr/share/jboss-as/modules/javax/ws/rs/api/main/jboss-jaxrs-api_1.1_spec-1.0.0.Final.jar %{engine_usr}/modules/javax/ws/rs/api/main/jaxrs-api.jar
+ln -f -s /usr/share/jboss-as/modules/org/apache/commons/codec/main/commons-codec-1.4.jar %{engine_usr}/modules/org/apache/commons/codec/main/commons-codec.jar
+ln -f -s /usr/share/jboss-as/modules/org/apache/httpcomponents/main/httpclient-4.1.2.jar %{engine_usr}/modules/org/apache/httpcomponents/main/httpclient.jar
+ln -f -s /usr/share/jboss-as/modules/org/apache/httpcomponents/main/httpcore-4.1.4.jar %{engine_usr}/modules/org/apache/httpcomponents/main/httpcore.jar
+ln -f -s /usr/share/jboss-as/modules/org/apache/httpcomponents/main/httpmime-4.1.2.jar %{engine_usr}/modules/org/apache/httpcomponents/main/httpmime.jar
+ln -f -s /usr/share/jboss-as/modules/org/codehaus/jackson/jackson-core-asl/main/jackson-core-asl-1.9.2.jar %{engine_usr}/modules/org/codehaus/jackson/jackson-core-asl/main/jackson-core-asl.jar
+ln -f -s /usr/share/jboss-as/modules/org/codehaus/jackson/jackson-jaxrs/main/jackson-jaxrs-1.9.2.jar %{engine_usr}/modules/org/codehaus/jackson/jackson-jaxrs/main/jackson-jaxrs.jar
+ln -f -s /usr/share/jboss-as/modules/org/codehaus/jackson/jackson-mapper-asl/main/jackson-mapper-asl-1.9.2.jar %{engine_usr}/modules/org/codehaus/jackson/jackson-mapper-asl/main/jackson-mapper-asl.jar
+ln -f -s /usr/share/jboss-as/modules/org/codehaus/jackson/jackson-xc/main/jackson-xc-1.9.2.jar %{engine_usr}/modules/org/codehaus/jackson/jackson-xc/main/jackson-xc.jar
+ln -f -s /usr/share/jboss-as/modules/org/hibernate/validator/main/hibernate-validator-4.2.0.Final.jar %{engine_usr}/modules/org/hibernate/validator/main/hibernate-validator.jar
+ln -f -s %{engine_ear}/lib/jtype-0.1.2.jar %{engine_usr}/modules/org/hibernate/validator/main/jtype.jar
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-atom-provider/main/resteasy-atom-provider-2.3.2.Final.jar %{engine_usr}/modules/org/jboss/resteasy/resteasy-atom-provider/main/resteasy-atom-provider.jar
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-cdi/main/resteasy-cdi-2.3.2.Final.jar %{engine_usr}/modules/org/jboss/resteasy/resteasy-cdi/main/resteasy-cdi.jar
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-jackson-provider/main/resteasy-jackson-provider-2.3.2.Final.jar %{engine_usr}/modules/org/jboss/resteasy/resteasy-jackson-provider/main/resteasy-jackson-provider.jar
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-jaxb-provider/main/resteasy-jaxb-provider-2.3.2.Final.jar %{engine_usr}/modules/org/jboss/resteasy/resteasy-jaxb-provider/main/resteasy-jaxb-provider.jar
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-jaxrs/main/async-http-servlet-3.0-2.3.2.Final.jar %{engine_usr}/modules/org/jboss/resteasy/resteasy-jaxrs/main/async-http-servlet-3.0.jar
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-jaxrs/main/resteasy-jaxrs-2.3.2.Final.jar %{engine_usr}/modules/org/jboss/resteasy/resteasy-jaxrs/main/resteasy-jaxrs.jar
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-jettison-provider/main/resteasy-jettison-provider-2.3.2.Final.jar %{engine_usr}/modules/org/jboss/resteasy/resteasy-jettison-provider/main/resteasy-jettison-provider.jar
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-jsapi/main/resteasy-jsapi-2.3.2.Final.jar %{engine_usr}/modules/org/jboss/resteasy/resteasy-jsapi/main/resteasy-jsapi.jar
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-multipart-provider/main/resteasy-multipart-provider-2.3.2.Final.jar %{engine_usr}/modules/org/jboss/resteasy/resteasy-multipart-provider/main/resteasy-multipart-provider.jar
+ln -f -s /usr/share/jboss-as/modules/org/jboss/resteasy/resteasy-yaml-provider/main/resteasy-yaml-provider-2.3.2.Final.jar %{engine_usr}/modules/org/jboss/resteasy/resteasy-yaml-provider/main/resteasy-yaml-provider.jar
+ln -f -s /usr/share/jboss-as/modules/org/scannotation/scannotation/main/scannotation-1.0.2.jar %{engine_usr}/modules/org/scannotation/scannotation/main/scannotation.jar
 
 %files
 
@@ -542,7 +580,8 @@ fi
 %attr(-, %{engine_user}, %{engine_group}) %{engine_etc}/engine-service-logging.properties
 %attr(-, %{engine_user}, %{engine_group}) %{engine_etc}/engine-service-users.properties
 %{engine_usr}/scripts/engine-service.py*
-%{_unitdir}/%{engine_name}.service
+#%{_unitdir}/%{engine_name}.service
+%{_initrddir}/%{engine_name}
 
 # Jar files used by all the components:
 %dir %{engine_jar}
@@ -557,6 +596,11 @@ fi
 %{_mavenpomdir}/JPP.%{name}-compat.pom
 %{_mavenpomdir}/JPP.%{name}-utils.pom
 
+# Additional jars
+%{engine_ear}/lib/commons-jxpath-1.3.jar
+%{engine_ear}/lib/commons-logging-1.0.4.jar
+%{engine_ear}/lib/jtype-0.1.2.jar
+
 # Documentation:
 %doc LICENSE
 
diff --git a/pom.xml b/pom.xml
index 9488a67..2aae129 100644
--- a/pom.xml
+++ b/pom.xml
@@ -350,6 +350,7 @@
               <include>**/*.java</include>
               <include>**/*.properties</include>
             </includes>
+            <encoding>UTF-8</encoding>
           </configuration>
         </plugin>
         <plugin>
-- 
1.7.1


From e6708d45b0b2ffab38aaf70390813bc22bad795f Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Tue, 14 Aug 2012 15:59:19 +0400
Subject: [PATCH 2/3] Additional jars

---
 ext/commons-jxpath-1.3.jar    |  Bin 0 -> 299994 bytes
 ext/commons-logging-1.0.4.jar |  Bin 0 -> 38015 bytes
 ext/jtype-0.1.2.jar           |  Bin 0 -> 32530 bytes
 3 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 ext/commons-jxpath-1.3.jar
 create mode 100644 ext/commons-logging-1.0.4.jar
 create mode 100644 ext/jtype-0.1.2.jar

diff --git a/ext/commons-jxpath-1.3.jar b/ext/commons-jxpath-1.3.jar
new file mode 100644
index 0000000000000000000000000000000000000000..e344a1e66d83ce608928a1e5e01dacfbc6270ab0
GIT binary patch
diff --git a/ext/commons-logging-1.0.4.jar b/ext/commons-logging-1.0.4.jar
new file mode 100644
index 0000000000000000000000000000000000000000..b73a80fab641131e6fbe3ae833549efb3c540d17
GIT binary patch
diff --git a/ext/jtype-0.1.2.jar b/ext/jtype-0.1.2.jar
new file mode 100644
index 0000000000000000000000000000000000000000..b0d40ab8d002dd5adafac890dd96430ff1fca770
GIT binary patch
-- 
1.7.1


From 1327afb67cc7117ee004b7c1e81ec95a3050225d Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Wed, 15 Aug 2012 18:32:31 +0400
Subject: [PATCH 3/3] Replace pc-0.14 to pc

---
 .../dbscripts/upgrade/pre_upgrade/0000_config.sql  |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql b/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql
index 2683a8f..cc570ea 100644
--- a/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql
+++ b/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql
@@ -97,7 +97,7 @@ select fn_db_add_config_value('DocsURL','','general');
 select fn_db_add_config_value('DomainName','example.com','general');
 select fn_db_add_config_value('EmulatedMachine','rhel5.5.0','2.2');
 select fn_db_add_config_value('EmulatedMachine','rhel6.0.0','3.0');
-select fn_db_add_config_value('EmulatedMachine','pc-0.14','3.1');
+select fn_db_add_config_value('EmulatedMachine','pc','3.1');
 --Handling Enable Spice Root Certification Validation
 select fn_db_add_config_value('EnableSpiceRootCertificateValidation','true','general');
 select fn_db_add_config_value('EnableSwapCheck','true','general');
@@ -480,7 +480,7 @@ select fn_db_update_default_config_value('AdUserPassword','example.com:SamplePas
 -- Increase AsyncTaskZombieTaskLifeInMinutes to 50 hours if it's the default 5 hours.
 select fn_db_update_default_config_value('AsyncTaskZombieTaskLifeInMinutes','300','3000','general',false);
 select fn_db_update_default_config_value('DomainName','example.com','','general',false);
-select fn_db_update_default_config_value('EmulatedMachine','rhel6.0.0', 'pc-0.14','3.0',false);
+select fn_db_update_default_config_value('EmulatedMachine','rhel6.0.0', 'pc','3.0',false);
 select fn_db_update_default_config_value('LDAPSecurityAuthentication','GSSAPI','default:GSSAPI','general',false);
 select fn_db_update_default_config_value('LDAPSecurityAuthentication','SIMPLE','default:SIMPLE','general',false);
 select fn_db_update_default_config_value('oVirtISOsRepositoryPath','ovirt-isos', '/usr/share/rhev-hypervisor','general',false);
-- 
1.7.1

