packaging: Use the JNA version from the distribution Libvirt-java 0.4.9 works just fine with JNA 3.2.4 which is in all distributions.
Future libvirt version require at least JNA 3.5.1 due to new methods and memory management, but that is not our concern now. By depending on the JNA in the distribution and adding it to the classpath we can work just fine. Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/e14e057f Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/e14e057f Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/e14e057f Branch: refs/heads/master Commit: e14e057f3d19779f31f0125b97c2a2d81e9dd531 Parents: e8b6f66 Author: Wido den Hollander <[email protected]> Authored: Tue Mar 5 10:24:02 2013 +0100 Committer: Wido den Hollander <[email protected]> Committed: Tue Mar 5 16:10:38 2013 +0100 ---------------------------------------------------------------------- debian/control | 2 +- packaging/centos63/cloud-agent.rc | 5 +++-- packaging/centos63/cloud.spec | 1 + packaging/debian/init/cloud-agent | 3 ++- plugins/hypervisors/kvm/pom.xml | 6 ------ pom.xml | 3 --- 6 files changed, 7 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e14e057f/debian/control ---------------------------------------------------------------------- diff --git a/debian/control b/debian/control index c8abc22..17e62b7 100644 --- a/debian/control +++ b/debian/control @@ -22,7 +22,7 @@ Description: CloudStack server library Package: cloudstack-agent Architecture: all -Depends: openjdk-6-jre | openjdk-7-jre, cloudstack-common (= ${source:Version}), lsb-base (>= 3.2), libcommons-daemon-java, openssh-client, libvirt0, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, ebtables, vlan, wget, jsvc +Depends: openjdk-6-jre | openjdk-7-jre, cloudstack-common (= ${source:Version}), lsb-base (>= 3.2), libcommons-daemon-java, libjna-java, openssh-client, libvirt0, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, ebtables, vlan, wget, jsvc Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts Description: CloudStack agent The CloudStack agent is in charge of managing shared computing resources in http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e14e057f/packaging/centos63/cloud-agent.rc ---------------------------------------------------------------------- diff --git a/packaging/centos63/cloud-agent.rc b/packaging/centos63/cloud-agent.rc index 2379ac1..fe19da4 100755 --- a/packaging/centos63/cloud-agent.rc +++ b/packaging/centos63/cloud-agent.rc @@ -58,11 +58,12 @@ export JAVA_HOME SCP="" DCP="" -ACP=`ls /usr/share/cloudstack-agent/cloud-plugin-hypervisor-kvm-*.jar`":"`ls /usr/share/cloudstack-agent/lib/* | tr '\n' ':' | sed s'/.$//'` -JCP="/usr/share/java/commons-daemon.jar" +ACP=`ls /usr/share/cloudstack-agent/cloud-plugin-hypervisor-kvm-*.jar`":"`ls /usr/share/cloudstack-agent/lib/*.jar | tr '\n' ':' | sed s'/.$//'` +JCP="/usr/share/java/commons-daemon.jar:/usr/share/java/jna.jar" # We need to append the JSVC daemon JAR to the classpath # AgentShell implements the JSVC daemon methods +# We also need JNA in the classpath (from the distribution) for the Libvirt Java bindings export CLASSPATH="$SCP:$DCP:$ACP:$JCP:/etc/cloudstack/agent:/usr/share/cloudstack-common/scripts" start() { http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e14e057f/packaging/centos63/cloud.spec ---------------------------------------------------------------------- diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec index 74055ac..2d89308 100644 --- a/packaging/centos63/cloud.spec +++ b/packaging/centos63/cloud.spec @@ -108,6 +108,7 @@ The Apache CloudStack files shared between agent and management server %package agent Summary: CloudStack Agent for KVM hypervisors Requires: java >= 1.6.0 +Requires: jna >= 3.2.4 Requires: %{name}-common = %{_ver} Requires: libvirt Requires: bridge-utils http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e14e057f/packaging/debian/init/cloud-agent ---------------------------------------------------------------------- diff --git a/packaging/debian/init/cloud-agent b/packaging/debian/init/cloud-agent index 2e436a9..a7b5244 100755 --- a/packaging/debian/init/cloud-agent +++ b/packaging/debian/init/cloud-agent @@ -59,7 +59,8 @@ ACP=`ls /usr/share/cloudstack-agent/lib/* | tr '\n' ':' | sed s'/.$//'` # We need to append the JSVC daemon JAR to the classpath # AgentShell implements the JSVC daemon methods -export CLASSPATH="/usr/share/java/commons-daemon.jar:$ACP:/etc/cloudstack/agent" +# We also need JNA in the classpath (from the distribution) for the Libvirt Java bindings +export CLASSPATH="/usr/share/java/commons-daemon.jar:/usr/share/java/jna.jar:$ACP:/etc/cloudstack/agent" wait_for_network() { i=1 http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e14e057f/plugins/hypervisors/kvm/pom.xml ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/kvm/pom.xml b/plugins/hypervisors/kvm/pom.xml index 819c4d7..013a58d 100644 --- a/plugins/hypervisors/kvm/pom.xml +++ b/plugins/hypervisors/kvm/pom.xml @@ -43,12 +43,6 @@ <artifactId>libvirt</artifactId> <version>${cs.libvirt-java.version}</version> </dependency> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna</artifactId> - <version>${cs.jna.version}</version> - <scope>runtime</scope> - </dependency> </dependencies> <build> <defaultGoal>install</defaultGoal> http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e14e057f/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 86cec1d..c10297a 100644 --- a/pom.xml +++ b/pom.xml @@ -91,9 +91,6 @@ <cs.reflections.version>0.9.8</cs.reflections.version> <cs.java-ipv6.version>0.10</cs.java-ipv6.version> <cs.replace.properties>build/replace.properties</cs.replace.properties> - <!-- jna is a dependecy of libvirt, check libvirt - version requirements before changing --> - <cs.jna.version>3.2.4</cs.jna.version> <cs.libvirt-java.version>0.4.9</cs.libvirt-java.version> </properties>
