From 4724ac0a57ce6663f96338ce43e89386522d5541 Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Fri, 14 Dec 2012 12:26:09 +0400
Subject: [PATCH 1/4] CentOS changes

---
 .../history_etl/history_service/history_service.sh |   12 +++++++++++-
 packaging/ovirt-engine-dwh.spec.in                 |   18 +++++++++---------
 pom.xml                                            |   13 +++++++++++++
 3 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/data-warehouse/history_etl/history_service/history_service.sh b/data-warehouse/history_etl/history_service/history_service.sh
index e84d9e4..457fd5c 100755
--- a/data-warehouse/history_etl/history_service/history_service.sh
+++ b/data-warehouse/history_etl/history_service/history_service.sh
@@ -7,7 +7,17 @@ LOGFILE="/var/log/ovirt-engine/ovirt-engine-dwhd.log"
 ETL_HOME=/usr/share/ovirt-engine-dwh/etl
 JAVA_DIR=/usr/share/java
 RUN_PROPERTIES="-Xms256M -Xmx1024M"
-CP=$ETL_HOME:$JAVA_DIR/ovirt-engine-dwh/historyETLProcedure.jar:$JAVA_DIR/ovirt-engine-dwh/advancedPersistentLookupLib.jar:$JAVA_DIR/ovirt-engine-dwh/talendRoutines.jar:$JAVA_DIR/dom4j.jar:$JAVA_DIR/commons-collections.jar:$JAVA_DIR/log4j.jar:$JAVA_DIR/postgresql-jdbc.jar
+#CP=$ETL_HOME:$JAVA_DIR/ovirt-engine-dwh/historyETLProcedure.jar:$JAVA_DIR/ovirt-engine-dwh/advancedPersistentLookupLib.jar:$JAVA_DIR/ovirt-engine-dwh/talendRoutines.jar:$JAVA_DIR/dom4j.jar:$JAVA_DIR/commons-collections.jar:$JAVA_DIR/log4j.jar:$JAVA_DIR/postgresql-jdbc.jar
+
+CP=\
+$ETL_HOME:\
+$JAVA_DIR/ovirt-engine-dwh/historyETLProcedure.jar:\
+$JAVA_DIR/ovirt-engine-dwh/advancedPersistentLookupLib.jar:\
+$JAVA_DIR/ovirt-engine-dwh/talendRoutines.jar:\
+/usr/share/jboss-as/modules/org/dom4j/main/dom4j-1.6.1.jar:\
+/usr/share/jboss-as-7.1.1.Final/modules/org/apache/commons/collections/main/commons-collections-3.2.1.jar:\
+/usr/share/jboss-as-7.1.1.Final/modules/org/apache/log4j/main/log4j-1.2.16.jar:\
+$JAVA_DIR/postgresql-jdbc.jar
 
 exec ${JAVA_HOME}/bin/java $RUN_PROPERTIES -cp $CP ovirt_engine_dwh.historyetl_3_2.HistoryETL --context=Default $* >> $LOGFILE 2>&1 &
 echo $! >$ETL_PID
diff --git a/packaging/ovirt-engine-dwh.spec.in b/packaging/ovirt-engine-dwh.spec.in
index fc27f63..cc336eb 100644
--- a/packaging/ovirt-engine-dwh.spec.in
+++ b/packaging/ovirt-engine-dwh.spec.in
@@ -34,19 +34,19 @@ Source: %{name}-%{version}.tar.gz
 
 BuildRequires: jpackage-utils
 BuildRequires: make
-BuildRequires: maven
-BuildRequires: maven-dependency-plugin
-BuildRequires: maven-antrun-plugin
-BuildRequires: maven-compiler-plugin
-BuildRequires: apache-commons-collections
-BuildRequires: log4j
+#BuildRequires: maven
+#BuildRequires: maven-dependency-plugin
+#BuildRequires: maven-antrun-plugin
+#BuildRequires: maven-compiler-plugin
+#BuildRequires: apache-commons-collections
+#BuildRequires: log4j
 BuildRequires: postgresql-jdbc
 Requires: python
 Requires: java-1.7.0-openjdk
 Requires: jpackage-utils
-Requires: apache-commons-collections >= 3.2
-Requires: log4j
-Requires: dom4j >= 1.6.1
+#Requires: apache-commons-collections >= 3.2
+#Requires: log4j
+#Requires: dom4j >= 1.6.1
 Requires: postgresql-jdbc
 Requires: postgresql-server >= 8.4.7
 Requires: postgresql-contrib >= 8.4.7
diff --git a/pom.xml b/pom.xml
index d9198c8..72cac2f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -56,6 +56,19 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+          <includes>
+            <include>**/*.txt</include>
+            <include>**/*.java</include>
+            <include>**/*.properties</include>
+          </includes>
+          <encoding>UTF-8</encoding>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 
-- 
1.7.1


From 918ddc6651a1a887a0eb4068a2b74e97ac188d0d Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Fri, 14 Dec 2012 15:08:07 +0400
Subject: [PATCH 2/4] Minor chages

---
 .../MinimalVersionCheck.java                       |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/data-warehouse/history_etl/etl_sources/historyETLProcedure/src/main/java/ovirt_engine_dwh/minimalversioncheck_3_2/MinimalVersionCheck.java b/data-warehouse/history_etl/etl_sources/historyETLProcedure/src/main/java/ovirt_engine_dwh/minimalversioncheck_3_2/MinimalVersionCheck.java
index aa0e879..0bddc05 100644
--- a/data-warehouse/history_etl/etl_sources/historyETLProcedure/src/main/java/ovirt_engine_dwh/minimalversioncheck_3_2/MinimalVersionCheck.java
+++ b/data-warehouse/history_etl/etl_sources/historyETLProcedure/src/main/java/ovirt_engine_dwh/minimalversioncheck_3_2/MinimalVersionCheck.java
@@ -1138,7 +1138,7 @@ public class MinimalVersionCheck implements TalendJob {
 
 				if (!context.ovirtMinimalETL.substring(0, 3).equals(
 						context.etlVersion.substring(0, 3))
-						|| Integer.parseInt(context.ovirtMinimalETL
+						&& Integer.parseInt(context.ovirtMinimalETL
 								.substring(4)) > Integer
 								.parseInt(context.etlVersion.substring(4))) {
 
-- 
1.7.1


From 2a44f986252907137804b89bd450dd53038bbc1a Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Fri, 14 Dec 2012 16:49:20 +0400
Subject: [PATCH 3/4] Minir changes

---
 packaging/ovirt-engine-dwh-setup.py |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/packaging/ovirt-engine-dwh-setup.py b/packaging/ovirt-engine-dwh-setup.py
index 0274177..65fffb5 100755
--- a/packaging/ovirt-engine-dwh-setup.py
+++ b/packaging/ovirt-engine-dwh-setup.py
@@ -217,6 +217,31 @@ def setVersion():
     file_handler.editParam("etlVersion", "%s.%s" % (currentVersion, currentMinorVersion))
     file_handler.close()
 
+def addCastore():
+    """
+    add castore to java ssl
+    """
+    import time
+    import os.path
+    from subprocess import Popen, PIPE
+
+    LINE_BUFFERED = 1
+
+#keytool -list -keystore /root/teststore
+    storefile = "/etc/pki/ovirt-engine/dwh-castore"
+    createstore_cmd = "keytool -import -noprompt -trustcacerts -alias \"cacert\" -file /etc/pki/ovirt-engine/ca.pem -keystore "+storefile
+
+    pwd = "123456\n"
+
+    if(os.path.exists(storefile)):
+        return
+
+    p = Popen([createstore_cmd], bufsize=LINE_BUFFERED, stdin=PIPE, shell=True)
+    p.stdin.write(pwd)
+    p.stdin.write(pwd)
+    p.stdin.close()
+
+
 def main():
     '''
     main
@@ -251,6 +276,8 @@ def main():
             else:
                 createDB(db_dict)
 
+            addCastore()
+
             # Start Services
             utils.startEngine()
             # Sleep for 20 secs to allow health applet to start
-- 
1.7.1


From d1c0ab7bff1949579569000b86fc7b9a7a93483d Mon Sep 17 00:00:00 2001
From: Andrey Gordeev <dreyou@gmail.com>
Date: Fri, 14 Dec 2012 17:08:58 +0400
Subject: [PATCH 4/4] Minor chages

---
 .../history_etl/history_service/history_service.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/data-warehouse/history_etl/history_service/history_service.sh b/data-warehouse/history_etl/history_service/history_service.sh
index 457fd5c..31aa6e2 100755
--- a/data-warehouse/history_etl/history_service/history_service.sh
+++ b/data-warehouse/history_etl/history_service/history_service.sh
@@ -6,7 +6,7 @@
 LOGFILE="/var/log/ovirt-engine/ovirt-engine-dwhd.log"
 ETL_HOME=/usr/share/ovirt-engine-dwh/etl
 JAVA_DIR=/usr/share/java
-RUN_PROPERTIES="-Xms256M -Xmx1024M"
+RUN_PROPERTIES="-Xms256M -Xmx1024M -Djavax.net.ssl.trustStore=/etc/pki/ovirt-engine/dwh-castore"
 #CP=$ETL_HOME:$JAVA_DIR/ovirt-engine-dwh/historyETLProcedure.jar:$JAVA_DIR/ovirt-engine-dwh/advancedPersistentLookupLib.jar:$JAVA_DIR/ovirt-engine-dwh/talendRoutines.jar:$JAVA_DIR/dom4j.jar:$JAVA_DIR/commons-collections.jar:$JAVA_DIR/log4j.jar:$JAVA_DIR/postgresql-jdbc.jar
 
 CP=\
-- 
1.7.1

