Fix: Add versioning to liblttng-ust-agent JAR
authorChristian Babeux <christian.babeux@efficios.com>
Mon, 3 Nov 2014 20:12:26 +0000 (15:12 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 3 Nov 2014 20:17:40 +0000 (15:17 -0500)
The liblttng-ust-agent JAR need versioning. The manifest file contains the
appropriate information about the JAR, such as the current version.

A symlink is also created and installed in order to point to the latest
version of the JAR.

e.g: liblttng-ust-agent.jar -> liblttng-ust-agent-1.0.0.jar

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
configure.ac
liblttng-ust-java-agent/java/Makefile.am
liblttng-ust-java-agent/java/org/lttng/ust/agent/Manifest.txt [new file with mode: 0644]

index 55cec234e19dffc3de64822608dc16d974f063e4..18f373989b9bebeb1462bcadd3042ae54059e6b8 100644 (file)
@@ -48,6 +48,7 @@ AC_DEFINE_UNQUOTED([VERSION_NAME], ["$version_name"], [UST version name])
 AC_DEFINE_UNQUOTED([VERSION_DESCRIPTION], ["$version_description"], [UST version description])
 
 AC_PROG_GREP
+AC_PROG_LN_S
 # libtool link_all_deplibs fixup. See http://bugs.lttng.org/issues/321.
 AC_ARG_ENABLE(libtool-linkdep-fixup,
        AS_HELP_STRING([--disable-libtool-linkdep-fixup],
index 01e81e5740b7578c15195a1b58b364278b845b41..5a406e4a25c9b97e0361dab69727c75f3ccf1b62 100644 (file)
@@ -1,12 +1,20 @@
 JAVAROOT = .
 
-jarfile = liblttng-ust-agent.jar
+pkgpath = org/lttng/ust/agent
+pkgpath_old = org/lttng/ust/jul
+
+jarfile_version = 1.0.0
+jarfile_manifest = $(pkgpath)/Manifest.txt
+jarfile_symlink = liblttng-ust-agent.jar
+jarfile = liblttng-ust-agent-$(jarfile_version).jar
+
 jarfile_old = liblttng-ust-jul.jar
+
 jardir = $(datadir)/java
+
 juljniout = ../jni/jul
 log4jjniout = ../jni/log4j
-pkgpath = org/lttng/ust/agent
-pkgpath_old = org/lttng/ust/jul
+
 dist_noinst_JAVA = $(pkgpath)/LTTngAgent.java \
                   $(pkgpath)/LTTngSessiondCmd2_6.java \
                   $(pkgpath)/LTTngTCPSessiondClient.java \
@@ -16,6 +24,8 @@ dist_noinst_JAVA = $(pkgpath)/LTTngAgent.java \
                   $(pkgpath)/jul/LTTngLogHandler.java \
                   $(pkgpath_old)/LTTngAgent.java
 
+dist_noinst_DATA = $(jarfile_manifest)
+
 jar_DATA = $(jarfile) $(jarfile_old)
 
 stamp =
@@ -36,7 +46,7 @@ classes += $(pkgpath)/log4j/*.class
 endif
 
 $(jarfile): classnoinst.stamp
-       $(JAR) cf $(JARFLAGS) $@ $(classes)
+       $(JAR) cfm $(JARFLAGS) $@ $(jarfile_manifest) $(classes) && $(LN_S) $@ $(jarfile_symlink)
 
 $(jarfile_old): classnoinst.stamp
        $(JAR) cf $(JARFLAGS) $@ $(pkgpath)/*.class \
@@ -52,6 +62,12 @@ log4j-jni-header.stamp: $(dist_noinst_JAVA)
 
 all-local: $(stamp)
 
+install-data-local:
+       cd $(DESTDIR)/$(jardir); rm -f $(jarfile_symlink); $(LN_S) $(jarfile) $(jarfile_symlink)
+
+uninstall-local:
+       cd $(DESTDIR)/$(jardir); rm -f $(jarfile_symlink)
+
 CLEANFILES = $(jarfile) $(jarfile_old) $(pkgpath)/*.class $(pkgpath_old)/*.class $(pkgpath)/jul/*.class \
        $(pkgpath)/log4j/*.class jul-jni-header.stamp log4j-jni-header.stamp \
        $(juljniout)/org_lttng_ust_agent_jul_LTTngLogHandler.h \
diff --git a/liblttng-ust-java-agent/java/org/lttng/ust/agent/Manifest.txt b/liblttng-ust-java-agent/java/org/lttng/ust/agent/Manifest.txt
new file mode 100644 (file)
index 0000000..d3c7e26
--- /dev/null
@@ -0,0 +1,7 @@
+Name: org/lttng/ust/agent/
+Specification-Title: LTTng UST Java Agent
+Specification-Version: 1.0.0
+Specification-Vendor: LTTng Project
+Implementation-Title: org.lttng.ust.agent
+Implementation-Version: 1.0.0
+Implementation-Vendor: LTTng Project
This page took 0.026564 seconds and 4 git commands to generate.