Juan Hernandez has uploaded a new change for review.

Change subject: packaging: Copy postgresql-jdbc.jar instead of link
......................................................................

packaging: Copy postgresql-jdbc.jar instead of link

Currently we create a symbolic link to the postgresql-jdbc.jar file
provided by the operating system where we are performing the build. This
does not work in systems that don't provide this jar file. This patch
changes the makefile so that it downloads the postgresql-jdbc.jar file
from the maven repository and copies it to the modules directory of the
installation. Then the .spec for Fedora replaces that file with a
symbolic link.

Change-Id: I3b8f8f0fea9ecf8e1e54099fcbad9de528a563aa
Signed-off-by: Juan Hernandez <[email protected]>
---
M Makefile
M packaging/fedora/spec/ovirt-engine.spec.in
2 files changed, 21 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/53/11053/1

diff --git a/Makefile b/Makefile
index 6dafad1..65b475d 100644
--- a/Makefile
+++ b/Makefile
@@ -69,6 +69,12 @@
 MAVEN_OUTPUT_DIR_DEFAULT=$(shell pwd -P)/tmp.repos
 MAVEN_OUTPUT_DIR=$(MAVEN_OUTPUT_DIR_DEFAULT)
 
+# We need to download some artifacts from maven respositories and
+# copy them to the installation directory, but they are not dependencies
+# of our source, so we need to have the specify the details outside of
+# the POM files:
+POSTGRESQL_JDBC_DRIVER_GAV=postgresql:postgresql:9.1-901.jdbc4
+
 ARTIFACTS = \
        backend \
        bll \
@@ -416,7 +422,11 @@
        # PostgreSQL driver:
        install -dm 755 $(DESTDIR)$(PKG_JBOSS_MODULES)/org/postgresql/main
        install -m 644 deployment/modules/org/postgresql/main/module.xml 
$(DESTDIR)$(PKG_JBOSS_MODULES)/org/postgresql/main/.
-       ln -s $(JAVA_DIR)/postgresql-jdbc.jar 
$(DESTDIR)$(PKG_JBOSS_MODULES)/org/postgresql/main/.
+       $(MVN) \
+               org.apache.maven.plugins:maven-dependency-plugin:2.4:get \
+               -Dartifact=$(POSTGRESQL_JDBC_DRIVER_GAV) \
+               
-Ddest=$(DESTDIR)$(PKG_JBOSS_MODULES)/org/postgresql/main/postgresql-jdbc.jar
+       chmod 644 
$(DESTDIR)$(PKG_JBOSS_MODULES)/org/postgresql/main/postgresql-jdbc.jar
 
 install_service:
        @echo "*** Deploying service"
diff --git a/packaging/fedora/spec/ovirt-engine.spec.in 
b/packaging/fedora/spec/ovirt-engine.spec.in
index 12bc435..08fe491 100644
--- a/packaging/fedora/spec/ovirt-engine.spec.in
+++ b/packaging/fedora/spec/ovirt-engine.spec.in
@@ -504,6 +504,16 @@
 find %{buildroot}%{engine_jboss_modules} -type d -exec chmod 755 {} \;
 find %{buildroot}%{engine_jboss_modules} -type f -exec chmod 644 {} \;
 
+# Replace jar files in the engine modules directory with links to their
+# actual locations:
+while read jar_name module_path
+do
+  rm -rf %{buildroot}%{engine_jboss_modules}/${module_path}*.jar
+  ln -s `build-classpath ${jar_name}` 
%{buildroot}%{engine_jboss_modules}/${module_path}.jar
+done <<'.'
+postgresql-jdbc org/postgresql/main/postgresql-jdbc
+.
+
 # Install the systemd files:
 install -dm 755 %{buildroot}%{_unitdir}
 install -m 644 packaging/fedora/engine-service.systemd 
%{buildroot}%{_unitdir}/%{engine_name}.service


--
To view, visit http://gerrit.ovirt.org/11053
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b8f8f0fea9ecf8e1e54099fcbad9de528a563aa
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to