[libvirt] Debian packaging for the Java bindings

Currently the Java bindings for libvirt do not provide a Debian package. Users with Debian based systems like Ubuntu are now forced to compile from source since no binary distribution of the JAR file is available. This patch adds building Debian packages with ant $ ant deb This will build a .deb file in the target directory. It requires dpkg-dev to be installed. Wido

Signed-off-by: Wido den Hollander <wido@widodh.nl> --- build.xml | 19 +++++++++++++++++++ debian/control.in | 9 +++++++++ 2 files changed, 28 insertions(+) create mode 100644 debian/control.in diff --git a/build.xml b/build.xml index 606cdaa..eefd08c 100644 --- a/build.xml +++ b/build.xml @@ -7,6 +7,9 @@ <property name="src.file" value="target/${src}.tar.gz" /> <property name="spec" value="libvirt-java.spec" /> <property name="spec.file" value="target/${spec}" /> + <property name="debian.pkgdir" value="target/libvirt-java" /> + <property name="debian.controlfile" value="${debian.pkgdir}/DEBIAN/control" /> + <property name="debian.pkg" value="target/libvirt-java_${version}_all.deb" /> <path id="compile.classpath"> <fileset dir="${jar.dir}"> @@ -69,6 +72,22 @@ </copy> </target> + <target name="deb" depends="build" description="build a debian Debian package"> + <mkdir dir="${debian.pkgdir}/DEBIAN" /> + <copy file="debian/control.in" tofile="${debian.controlfile}" overwrite="true" filtering="true"> + <filterset filtersfile="build.properties" /> + </copy> + + <mkdir dir="${debian.pkgdir}/${jar.dir}" /> + <copy file="${jar.file}" todir="${debian.pkgdir}/${jar.dir}" /> + <symlink link="${debian.pkgdir}/${jar.dir}/libvirt.jar" resource="${jar.dir}/${jar}.jar" overwrite="true" /> + <exec executable="dpkg-deb"> + <arg value="-b" /> + <arg value="${debian.pkgdir}" /> + <arg value="${debian.pkg}" /> + </exec> + </target> + <target name="package" depends="src,build,docs,spec" description="builds the rpms"> <copy file="${src.file}" todir="${rpm.topdir}/SOURCES" /> <copy file="${spec.file}" todir="${rpm.topdir}/SPECS" /> diff --git a/debian/control.in b/debian/control.in new file mode 100644 index 0000000..06ab6d8 --- /dev/null +++ b/debian/control.in @@ -0,0 +1,9 @@ +Homepage: http://libvirt.org/java.html +Maintainer: Wido den Hollander <wido@widodh.nl> +Section: java +Priority: optional +Version: @version@ +Package: libvirt-java +Architecture: all +Depends: libjna-java (>= 3.2.4), libvirt0 (>= 0.9.8) +Description: These Java bindings expose the C API in a Java friendly way -- 1.7.9.5

On 07/19/2012 07:33 PM, Wido den Hollander wrote:
Signed-off-by: Wido den Hollander <wido@widodh.nl> --- build.xml | 19 +++++++++++++++++++ debian/control.in | 9 +++++++++ 2 files changed, 28 insertions(+) create mode 100644 debian/control.in
diff --git a/build.xml b/build.xml index 606cdaa..eefd08c 100644 --- a/build.xml +++ b/build.xml @@ -7,6 +7,9 @@ <property name="src.file" value="target/${src}.tar.gz" /> <property name="spec" value="libvirt-java.spec" /> <property name="spec.file" value="target/${spec}" /> + <property name="debian.pkgdir" value="target/libvirt-java" /> + <property name="debian.controlfile" value="${debian.pkgdir}/DEBIAN/control" /> + <property name="debian.pkg" value="target/libvirt-java_${version}_all.deb" />
<path id="compile.classpath"> <fileset dir="${jar.dir}"> @@ -69,6 +72,22 @@ </copy> </target>
+ <target name="deb" depends="build" description="build a debian Debian package"> + <mkdir dir="${debian.pkgdir}/DEBIAN" /> + <copy file="debian/control.in" tofile="${debian.controlfile}" overwrite="true" filtering="true"> + <filterset filtersfile="build.properties" /> + </copy> + + <mkdir dir="${debian.pkgdir}/${jar.dir}" /> + <copy file="${jar.file}" todir="${debian.pkgdir}/${jar.dir}" /> + <symlink link="${debian.pkgdir}/${jar.dir}/libvirt.jar" resource="${jar.dir}/${jar}.jar" overwrite="true" /> + <exec executable="dpkg-deb"> + <arg value="-b" /> + <arg value="${debian.pkgdir}" /> + <arg value="${debian.pkg}" /> + </exec> + </target> + <target name="package" depends="src,build,docs,spec" description="builds the rpms"> <copy file="${src.file}" todir="${rpm.topdir}/SOURCES" /> <copy file="${spec.file}" todir="${rpm.topdir}/SPECS" /> diff --git a/debian/control.in b/debian/control.in new file mode 100644 index 0000000..06ab6d8 --- /dev/null +++ b/debian/control.in @@ -0,0 +1,9 @@ +Homepage: http://libvirt.org/java.html +Maintainer: Wido den Hollander <wido@widodh.nl> +Section: java +Priority: optional +Version: @version@ +Package: libvirt-java +Architecture: all +Depends: libjna-java (>= 3.2.4), libvirt0 (>= 0.9.8) +Description: These Java bindings expose the C API in a Java friendly way
Did somebody get a chance yet to take a look at this patch? Thanks, Wido

On 08/01/2012 08:51 AM, Wido den Hollander wrote:
On 07/19/2012 07:33 PM, Wido den Hollander wrote:
Signed-off-by: Wido den Hollander <wido@widodh.nl> --- build.xml | 19 +++++++++++++++++++ debian/control.in | 9 +++++++++ 2 files changed, 28 insertions(+) create mode 100644 debian/control.in
+++ b/debian/control.in @@ -0,0 +1,9 @@ +Homepage: http://libvirt.org/java.html +Maintainer: Wido den Hollander <wido@widodh.nl> +Section: java +Priority: optional +Version: @version@ +Package: libvirt-java +Architecture: all +Depends: libjna-java (>= 3.2.4), libvirt0 (>= 0.9.8) +Description: These Java bindings expose the C API in a Java friendly way
Did somebody get a chance yet to take a look at this patch?
I personally have never built a debian package, so I have no basis from which to review it. But if no one else comments by Friday (2 more days for a review), then ping me: I don't mind applying it as-is, since it doesn't affect the actual bindings so much as the packaging, and I assume you have tested it. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 08/02/2012 01:00 AM, Eric Blake wrote:
On 08/01/2012 08:51 AM, Wido den Hollander wrote:
On 07/19/2012 07:33 PM, Wido den Hollander wrote:
Signed-off-by: Wido den Hollander <wido@widodh.nl> --- build.xml | 19 +++++++++++++++++++ debian/control.in | 9 +++++++++ 2 files changed, 28 insertions(+) create mode 100644 debian/control.in
+++ b/debian/control.in @@ -0,0 +1,9 @@ +Homepage: http://libvirt.org/java.html +Maintainer: Wido den Hollander <wido@widodh.nl> +Section: java +Priority: optional +Version: @version@ +Package: libvirt-java +Architecture: all +Depends: libjna-java (>= 3.2.4), libvirt0 (>= 0.9.8) +Description: These Java bindings expose the C API in a Java friendly way
Did somebody get a chance yet to take a look at this patch?
I personally have never built a debian package, so I have no basis from which to review it. But if no one else comments by Friday (2 more days for a review), then ping me: I don't mind applying it as-is, since it doesn't affect the actual bindings so much as the packaging, and I assume you have tested it.
Ping? This patch doesn't change anything to the bindings itself, it's just a packaging matter. This way Ubuntu and Debian users can install the bindings through their package manager, one less loose JA on your system. Wido

On 08/06/2012 05:29 AM, Wido den Hollander wrote:
I personally have never built a debian package, so I have no basis from which to review it. But if no one else comments by Friday (2 more days for a review), then ping me: I don't mind applying it as-is, since it doesn't affect the actual bindings so much as the packaging, and I assume you have tested it.
Ping?
This patch doesn't change anything to the bindings itself, it's just a packaging matter.
As promised, with no other review, I've gone ahead and pushed this. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Wido den Hollander