[thermostat] Upgrade to upstream 0.4.0 release.

jerboaa jerboaa at fedoraproject.org
Thu Oct 18 17:10:45 UTC 2012


commit 13c898a1abcac7ba3c2d242d893adb2d893157a1
Author: Severin Gehwolf <sgehwolf at redhat.com>
Date:   Tue Oct 16 15:50:12 2012 +0200

    Upgrade to upstream 0.4.0 release.
    
    1. As per the Java JNI packaging requirements it uses System.load
       instead of System.loadLibrary.
    2. osgi-export.properties only exports JVM packages
    3. Thermostat dependency bundles are started by the OSGi framework.
    4. Has lucene 2.9.4 compatibility patch.
    5. It does not build or include experimental web or eclipse things.
    6. Removes a few now obsolete patches.

 .gitignore                     |    1 +
 fix-test-scopes.patch          |   15 ---
 fix_bundle_loading.patch       |  254 ++++++++++++++++++++++++++++++++++++++++
 fix_natives.patch              |   36 ++++++
 fix_pom.patch                  |   82 +++++++++++++
 follow-lib-symlinks.patch      |   28 -----
 ignore-missing-activator.patch |   12 --
 lucene_2.9.4_compat.patch      |   30 +++++
 per-user-home.patch            |   42 ++++---
 sources                        |    2 +-
 thermostat.spec                |  108 ++++++++++++++----
 11 files changed, 514 insertions(+), 96 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index eb66fb9..3b1ccf1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 /6f83cf36541d.tar.gz
 /2140a7c81a4b.tar.gz
 /thermostat-0.3.tar.gz
+/thermostat-0.4.0.tar.gz
diff --git a/fix_bundle_loading.patch b/fix_bundle_loading.patch
new file mode 100644
index 0000000..8a866e0
--- /dev/null
+++ b/fix_bundle_loading.patch
@@ -0,0 +1,254 @@
+diff -r 81b822320e48 distribution/config/commands/agent.properties
+--- a/distribution/config/commands/agent.properties	Wed Oct 10 19:22:19 2012 -0400
++++ b/distribution/config/commands/agent.properties	Thu Oct 18 18:09:32 2012 +0200
+@@ -7,7 +7,8 @@
+           thermostat-agent-heapdumper- at project.version@.jar, \
+           thermostat-agent-killvm- at project.version@.jar, \
+           thermostat-thread-collector- at project.version@.jar, \
+-          thermostat-thread-harvester- at project.version@.jar
++          thermostat-thread-harvester- at project.version@.jar, \
++          netty.jar
+ 
+ description = starts and stops the thermostat agent
+ 
+diff -r 81b822320e48 distribution/config/commands/dump-heap.properties
+--- a/distribution/config/commands/dump-heap.properties	Wed Oct 10 19:22:19 2012 -0400
++++ b/distribution/config/commands/dump-heap.properties	Thu Oct 18 18:09:32 2012 +0200
+@@ -4,7 +4,10 @@
+           thermostat-client-command- at project.version@.jar, \
+           thermostat-client-heapdumper- at project.version@.jar, \
+           thermostat-swing-components- at project.version@.jar, \
+-          thermostat-laf- at project.version@.jar
++          thermostat-laf- at project.version@.jar, \
++          netty.jar, \
++          jcommon.jar, \
++          jfreechart.jar
+ 
+ description = trigger a heap dump on the VM
+ 
+diff -r 81b822320e48 distribution/config/commands/find-objects.properties
+--- a/distribution/config/commands/find-objects.properties	Wed Oct 10 19:22:19 2012 -0400
++++ b/distribution/config/commands/find-objects.properties	Thu Oct 18 18:09:32 2012 +0200
+@@ -4,7 +4,10 @@
+           thermostat-client-command- at project.version@.jar, \
+           thermostat-client-heapdumper- at project.version@.jar, \
+           thermostat-swing-components- at project.version@.jar, \
+-          thermostat-laf- at project.version@.jar
++          thermostat-laf- at project.version@.jar, \
++          netty.jar, \
++          jcommon.jar, \
++          jfreechart.jar
+ 
+ description = Finds objects in a heapdump
+ 
+diff -r 81b822320e48 distribution/config/commands/find-root.properties
+--- a/distribution/config/commands/find-root.properties	Wed Oct 10 19:22:19 2012 -0400
++++ b/distribution/config/commands/find-root.properties	Thu Oct 18 18:09:32 2012 +0200
+@@ -4,7 +4,10 @@
+           thermostat-client-command- at project.version@.jar, \
+           thermostat-client-heapdumper- at project.version@.jar, \
+           thermostat-swing-components- at project.version@.jar, \
+-          thermostat-laf- at project.version@.jar
++          thermostat-laf- at project.version@.jar, \
++          netty.jar, \
++          jcommon.jar, \
++          jfreechart.jar
+ 
+ description = finds the shortest path from an object to a GC root
+ 
+diff -r 81b822320e48 distribution/config/commands/gui.properties
+--- a/distribution/config/commands/gui.properties	Wed Oct 10 19:22:19 2012 -0400
++++ b/distribution/config/commands/gui.properties	Thu Oct 18 18:09:32 2012 +0200
+@@ -14,11 +14,14 @@
+           thermostat-thread-client-controllers- at project.version@.jar, \
+           thermostat-thread-client-common- at project.version@.jar, \
+           thermostat-osgi-process-handler- at project.version@.jar, \
+-          thermostat-client-command- at project.version@.jar
++          thermostat-client-command- at project.version@.jar, \
++          netty.jar, \
++          jcommon.jar, \
++          jfreechart.jar
+ 
+ description = launches the GUI client
+ 
+ usage = thermostat gui
+ 
+ # This command does not have any options
+-#options =
+\ No newline at end of file
++#options =
+diff -r 81b822320e48 distribution/config/commands/list-heap-dumps.properties
+--- a/distribution/config/commands/list-heap-dumps.properties	Wed Oct 10 19:22:19 2012 -0400
++++ b/distribution/config/commands/list-heap-dumps.properties	Thu Oct 18 18:09:32 2012 +0200
+@@ -4,7 +4,10 @@
+           thermostat-client-command- at project.version@.jar, \
+           thermostat-client-heapdumper- at project.version@.jar, \
+           thermostat-swing-components- at project.version@.jar, \
+-          thermostat-laf- at project.version@.jar
++          thermostat-laf- at project.version@.jar, \
++          netty.jar, \
++          jcommon.jar, \
++          jfreechart.jar
+ 
+ description = list all heap dumps
+ 
+diff -r 81b822320e48 distribution/config/commands/object-info.properties
+--- a/distribution/config/commands/object-info.properties	Wed Oct 10 19:22:19 2012 -0400
++++ b/distribution/config/commands/object-info.properties	Thu Oct 18 18:09:32 2012 +0200
+@@ -4,7 +4,10 @@
+           thermostat-client-command- at project.version@.jar, \
+           thermostat-client-heapdumper- at project.version@.jar, \
+           thermostat-swing-components- at project.version@.jar, \
+-          thermostat-laf- at project.version@.jar
++          thermostat-laf- at project.version@.jar,\
++          netty.jar, \
++          jcommon.jar, \
++          jfreechart.jar
+ 
+ description = prints information about an object in a heap dump
+ 
+diff -r 81b822320e48 distribution/config/commands/ping.properties
+--- a/distribution/config/commands/ping.properties	Wed Oct 10 19:22:19 2012 -0400
++++ b/distribution/config/commands/ping.properties	Thu Oct 18 18:09:32 2012 +0200
+@@ -1,5 +1,6 @@
+ bundles = thermostat-common-command- at project.version@.jar, \
+-          thermostat-client-command- at project.version@.jar
++          thermostat-client-command- at project.version@.jar, \
++          netty.jar
+ 
+ description = using the Command Channel, send a ping to a running agent
+ 
+diff -r 81b822320e48 distribution/config/commands/save-heap-dump-to-file.properties
+--- a/distribution/config/commands/save-heap-dump-to-file.properties	Wed Oct 10 19:22:19 2012 -0400
++++ b/distribution/config/commands/save-heap-dump-to-file.properties	Thu Oct 18 18:09:32 2012 +0200
+@@ -4,7 +4,10 @@
+           thermostat-client-command- at project.version@.jar, \
+           thermostat-client-heapdumper- at project.version@.jar, \
+           thermostat-swing-components- at project.version@.jar, \
+-          thermostat-laf- at project.version@.jar
++          thermostat-laf- at project.version@.jar, \
++          netty.jar, \
++          jcommon.jar, \
++          jfreechart.jar
+ 
+ description = saves a heap dump to a local file
+ 
+diff -r 81b822320e48 distribution/config/commands/service.properties
+--- a/distribution/config/commands/service.properties	Wed Oct 10 19:22:19 2012 -0400
++++ b/distribution/config/commands/service.properties	Thu Oct 18 18:09:32 2012 +0200
+@@ -3,7 +3,8 @@
+           thermostat-common-core- at project.version@.jar, \
+           thermostat-common-command- at project.version@.jar, \
+           thermostat-agent-command- at project.version@.jar, \
+-          thermostat-agent-cli- at project.version@.jar
++          thermostat-agent-cli- at project.version@.jar, \
++          netty.jar
+ 
+ description = starts and stops the thermostat storage and agent
+ 
+diff -r 81b822320e48 distribution/config/commands/show-heap-histogram.properties
+--- a/distribution/config/commands/show-heap-histogram.properties	Wed Oct 10 19:22:19 2012 -0400
++++ b/distribution/config/commands/show-heap-histogram.properties	Thu Oct 18 18:09:32 2012 +0200
+@@ -4,7 +4,10 @@
+           thermostat-client-command- at project.version@.jar, \
+           thermostat-client-heapdumper- at project.version@.jar, \
+           thermostat-swing-components- at project.version@.jar, \
+-          thermostat-laf- at project.version@.jar
++          thermostat-laf- at project.version@.jar, \
++          netty.jar, \
++          jcommon.jar, \
++          jfreechart.jar
+ 
+ description = show the heap histogram
+ 
+diff -r 81b822320e48 distribution/config/commands/storage.properties
+--- a/distribution/config/commands/storage.properties	Wed Oct 10 19:22:19 2012 -0400
++++ b/distribution/config/commands/storage.properties	Thu Oct 18 18:09:32 2012 +0200
+@@ -3,7 +3,8 @@
+           thermostat-common-core- at project.version@.jar, \
+           thermostat-agent-cli- at project.version@.jar, \
+           thermostat-common-command- at project.version@.jar, \
+-          thermostat-agent-command- at project.version@.jar
++          thermostat-agent-command- at project.version@.jar, \
++          netty.jar
+ 
+ description = starts and stops the thermostat storage
+ 
+@@ -31,4 +32,4 @@
+ quiet.long = quiet
+ quiet.hasarg = false
+ quiet.required = false
+-quiet.description = don't produce any output
+\ No newline at end of file
++quiet.description = don't produce any output
+diff -r 81b822320e48 distribution/config/osgi-export.properties
+--- a/distribution/config/osgi-export.properties	Wed Oct 10 19:22:19 2012 -0400
++++ b/distribution/config/osgi-export.properties	Thu Oct 18 18:09:32 2012 +0200
+@@ -32,25 +32,6 @@
+ # library, but you are not obligated to do so.  If you do not wish
+ # to do so, delete this exception statement from your version.
+ 
+-# OSGi public API
+-com.mongodb
+-com.mongodb.gridfs
+-org.apache.commons.cli=1.2.0
+-org.apache.commons.beanutils=1.8.3
+-org.bson
+-org.bson.types
+-org.jfree.chart
+-org.jfree.chart.axis
+-org.jfree.chart.event
+-org.jfree.chart.labels
+-org.jfree.chart.plot
+-org.jfree.chart.renderer.xy
+-org.jfree.data
+-org.jfree.data.general
+-org.jfree.data.time
+-org.jfree.data.xy
+-org.jfree.ui
+-org.jfree.data.gantt
+ sun.swing
+ sun.swing.table
+ 
+@@ -62,24 +43,6 @@
+ com.sun.tools.attach
+ com.sun.management
+ 
+-jline=2.5.0
+-jline.console=2.5.0
+-jline.console.history=2.5.0
+ sun.jvmstat
+ sun.jvmstat.monitor
+ sun.jvmstat.monitor.event
+-
+-org.jboss.netty=3.2.4.Final
+-org.jboss.netty.bootstrap=3.2.4.Final
+-org.jboss.netty.buffer=3.2.4.Final
+-org.jboss.netty.channel=3.2.4.Final
+-org.jboss.netty.channel.group=3.2.4.Final
+-org.jboss.netty.channel.socket.nio=3.2.4.Final
+-org.jboss.netty.handler.codec.frame=3.2.4.Final
+-
+-org.apache.lucene.analysis
+-org.apache.lucene.document
+-org.apache.lucene.index
+-org.apache.lucene.search
+-org.apache.lucene.store
+-org.apache.lucene.util
+diff -r 81b822320e48 main/src/main/resources/com/redhat/thermostat/main/impl/bootstrapbundles.properties
+--- a/main/src/main/resources/com/redhat/thermostat/main/impl/bootstrapbundles.properties	Wed Oct 10 19:22:19 2012 -0400
++++ b/main/src/main/resources/com/redhat/thermostat/main/impl/bootstrapbundles.properties	Thu Oct 18 18:09:32 2012 +0200
+@@ -3,4 +3,12 @@
+         thermostat-bundles-${project.version}.jar, \
+         thermostat-tools-${project.version}.jar, \
+         thermostat-launcher-${project.version}.jar, \
+-        thermostat-main-${project.version}.jar
++        thermostat-main-${project.version}.jar, \
++        apache-commons-beanutils.jar, \
++        apache-commons-collections.jar, \
++        apache-commons-logging.jar, \
++        mongo.jar, \
++        apache-commons-cli.jar, \
++        jline2.jar, \
++        jansi.jar, \
++        lucene.jar
diff --git a/fix_natives.patch b/fix_natives.patch
new file mode 100644
index 0000000..c76eb21
--- /dev/null
+++ b/fix_natives.patch
@@ -0,0 +1,36 @@
+diff --git a/agent/core/src/main/java/com/redhat/thermostat/utils/hostname/HostName.java b/agent/core/src/main/java/com/redhat/thermostat/utils/hostname/HostName.java
+--- a/agent/core/src/main/java/com/redhat/thermostat/utils/hostname/HostName.java
++++ b/agent/core/src/main/java/com/redhat/thermostat/utils/hostname/HostName.java
+@@ -36,10 +36,13 @@
+ 
+ package com.redhat.thermostat.utils.hostname;
+ 
++import java.io.File;
++
+ public class HostName {
+ 
+     static {
+-        System.loadLibrary("HostNameWrapper");
++        String home = System.getenv("THERMOSTAT_HOME");
++        System.load(home + File.separatorChar + "libs" + File.separatorChar + "native" + File.separatorChar + "libHostNameWrapper.so");
+     }
+     
+     public static String getLocalHostName() {
+diff --git a/keyring/src/main/java/com/redhat/thermostat/utils/keyring/GnomeKeyringLibraryNative.java b/keyring/src/main/java/com/redhat/thermostat/utils/keyring/GnomeKeyringLibraryNative.java
+--- a/keyring/src/main/java/com/redhat/thermostat/utils/keyring/GnomeKeyringLibraryNative.java
++++ b/keyring/src/main/java/com/redhat/thermostat/utils/keyring/GnomeKeyringLibraryNative.java
+@@ -36,10 +36,13 @@
+ 
+ package com.redhat.thermostat.utils.keyring;
+ 
++import java.io.File;
++
+ class GnomeKeyringLibraryNative implements Keyring {
+     
+     static {
+-        System.loadLibrary("GnomeKeyringWrapper");
++        String home = System.getenv("THERMOSTAT_HOME");
++        System.load(home + File.separatorChar + "libs" + File.separatorChar + "native" + File.separatorChar + "libGnomeKeyringWrapper.so");
+     }
+     
+     public GnomeKeyringLibraryNative() {
diff --git a/fix_pom.patch b/fix_pom.patch
new file mode 100644
index 0000000..348a33a
--- /dev/null
+++ b/fix_pom.patch
@@ -0,0 +1,82 @@
+--- pom.xml.orig	2012-10-11 00:02:38.000000000 +0200
++++ pom.xml	2012-10-17 19:04:14.279459142 +0200
+@@ -73,7 +73,7 @@
+     <commons-beanutils.version>1.8.3</commons-beanutils.version>
+     <commons-cli.version>1.2</commons-cli.version>
+     <jline.version>2.5</jline.version>
+-    <lucene.version>3.6.0</lucene.version>
++    <lucene.version>2.9.4</lucene.version>
+     <!--
+          felix 4.0 is compliant with osgi 4.3
+          for osgi clients, 4.3 is backwards compatible with 4.2
+@@ -109,7 +109,6 @@
+     <module>unix-process-handler</module>
+     <module>keyring</module>
+     <module>thread</module>
+-    <module>web</module>
+   </modules>
+ 
+   <build>
+@@ -155,62 +154,14 @@
+           </dependencies>
+         </plugin>
+         <plugin>
+-          <groupId>org.jacoco</groupId>
+-          <artifactId>jacoco-maven-plugin</artifactId>
+-          <version>0.5.10.201208310627</version>
+-        </plugin>
+-        <plugin>
+           <groupId>org.apache.felix</groupId>
+           <artifactId>maven-bundle-plugin</artifactId>
+           <version>1.4.0</version>
+         </plugin>
+-        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+-        <plugin>
+-          <groupId>org.eclipse.m2e</groupId>
+-          <artifactId>lifecycle-mapping</artifactId>
+-          <version>1.0.0</version>
+-          <configuration>
+-            <lifecycleMappingMetadata>
+-              <pluginExecutions>
+-                <pluginExecution>
+-                  <pluginExecutionFilter>
+-                    <groupId>org.jacoco</groupId>
+-                    <artifactId>
+-                      jacoco-maven-plugin
+-                    </artifactId>
+-                    <versionRange>
+-                      [0.5.10.201208310627,)
+-                    </versionRange>
+-                    <goals>
+-                      <goal>prepare-agent</goal>
+-                    </goals>
+-                  </pluginExecutionFilter>
+-                  <action>
+-                    <ignore />
+-                  </action>
+-                </pluginExecution>
+-              </pluginExecutions>
+-            </lifecycleMappingMetadata>
+-          </configuration>
+-        </plugin>
+       </plugins>
+     </pluginManagement>
+     <plugins>
+       <plugin>
+-        <groupId>org.jacoco</groupId>
+-        <artifactId>jacoco-maven-plugin</artifactId>
+-        <executions>
+-          <execution>
+-            <goals>
+-              <goal>prepare-agent</goal>
+-            </goals>
+-            <configuration>
+-              <propertyName>coverageAgent</propertyName>
+-            </configuration>
+-          </execution>
+-        </executions>
+-      </plugin>
+-      <plugin>
+         <groupId>org.apache.maven.plugins</groupId>
+         <artifactId>maven-assembly-plugin</artifactId>
+         <version>2.3</version>
diff --git a/lucene_2.9.4_compat.patch b/lucene_2.9.4_compat.patch
new file mode 100644
index 0000000..7cae5ed
--- /dev/null
+++ b/lucene_2.9.4_compat.patch
@@ -0,0 +1,30 @@
+diff --git a/common/core/src/main/java/com/redhat/thermostat/common/heap/HeapDump.java b/common/core/src/main/java/com/redhat/thermostat/common/heap/HeapDump.java
+--- a/common/core/src/main/java/com/redhat/thermostat/common/heap/HeapDump.java
++++ b/common/core/src/main/java/com/redhat/thermostat/common/heap/HeapDump.java
+@@ -55,7 +55,6 @@
+ import org.apache.lucene.index.CorruptIndexException;
+ import org.apache.lucene.index.IndexReader;
+ import org.apache.lucene.index.IndexWriter;
+-import org.apache.lucene.index.IndexWriterConfig;
+ import org.apache.lucene.index.Term;
+ import org.apache.lucene.search.IndexSearcher;
+ import org.apache.lucene.search.ScoreDoc;
+@@ -64,7 +63,6 @@
+ import org.apache.lucene.store.Directory;
+ import org.apache.lucene.store.LockObtainFailedException;
+ import org.apache.lucene.store.RAMDirectory;
+-import org.apache.lucene.util.Version;
+ 
+ import com.redhat.thermostat.common.dao.HeapDAO;
+ import com.redhat.thermostat.common.model.HeapInfo;
+@@ -132,8 +130,8 @@
+ 
+         Enumeration<JavaHeapObject> thingos = snapshot.getThings();
+         Directory dir = new RAMDirectory();
+-        IndexWriterConfig indexWriterConfig = new IndexWriterConfig(Version.LUCENE_36, new SimpleAnalyzer(Version.LUCENE_36));
+-        IndexWriter writer = new IndexWriter(dir, indexWriterConfig);
++        // FIXME: work with lucene 2.9.4 
++        IndexWriter writer = new IndexWriter(dir, new SimpleAnalyzer(), true, IndexWriter.MaxFieldLength.UNLIMITED);
+         while (thingos.hasMoreElements()) {
+             JavaHeapObject thingo = thingos.nextElement();
+             Document doc = new Document();
diff --git a/per-user-home.patch b/per-user-home.patch
index 5ade155..bbe4c89 100644
--- a/per-user-home.patch
+++ b/per-user-home.patch
@@ -1,6 +1,6 @@
-diff --git a/distribution/scripts/thermostat b/distribution/scripts/thermostat
---- a/distribution/scripts/thermostat
-+++ b/distribution/scripts/thermostat
+diff -r 1c430d80ed06 distribution/scripts/thermostat
+--- a/distribution/scripts/thermostat	Tue Oct 16 14:23:29 2012 -0400
++++ b/distribution/scripts/thermostat	Wed Oct 17 17:54:27 2012 +0200
 @@ -43,6 +43,8 @@
  if [ x"$THERMOSTAT_HOME" = x ] ; then
    THERMOSTAT_HOME="@thermostat.home@"
@@ -10,10 +10,10 @@ diff --git a/distribution/scripts/thermostat b/distribution/scripts/thermostat
  export THERMOSTAT_HOME
  THERMOSTAT_LIBS="${THERMOSTAT_HOME}/libs"
  
-diff --git a/distribution/scripts/thermostat-client-gui b/distribution/scripts/thermostat-client-gui
---- a/distribution/scripts/thermostat-client-gui
-+++ b/distribution/scripts/thermostat-client-gui
-@@ -43,6 +43,7 @@
+diff -r 1c430d80ed06 distribution/scripts/thermostat-client-gui
+--- a/distribution/scripts/thermostat-client-gui	Tue Oct 16 14:23:29 2012 -0400
++++ b/distribution/scripts/thermostat-client-gui	Wed Oct 17 17:54:27 2012 +0200
+@@ -40,6 +40,7 @@
  if [ x"$THERMOSTAT_HOME" = x ] ; then
    THERMOSTAT_HOME="@thermostat.home@"
  fi
@@ -21,18 +21,16 @@ diff --git a/distribution/scripts/thermostat-client-gui b/distribution/scripts/t
  export THERMOSTAT_HOME
  
  $THERMOSTAT_HOME/bin/thermostat gui
-diff --git a/distribution/scripts/thermostat-init-layout b/distribution/scripts/thermostat-init-layout
---- a/distribution/scripts/thermostat-init-layout
-+++ b/distribution/scripts/thermostat-init-layout
-@@ -38,43 +38,83 @@
+diff -r 1c430d80ed06 distribution/scripts/thermostat-init-layout
+--- a/distribution/scripts/thermostat-init-layout	Tue Oct 16 14:23:29 2012 -0400
++++ b/distribution/scripts/thermostat-init-layout	Wed Oct 17 17:54:27 2012 +0200
+@@ -38,43 +38,89 @@
  #
  # Some necessary variables.
  if [ "$THERMOSTAT_HOME" = "" ]; then
 -    echo "THERMOSTAT_HOME not set!"
-+    THERMOSTAT_HOME="@thermostat.home@"
++    THERMOSTAT_HOME="/usr/share/thermostat"
 +fi
-+
-+USER_THERMOSTAT_HOME="${HOME}/.thermostat"
  
 -else
 -    THERMOSTAT_STORAGE="${THERMOSTAT_HOME}/storage/db"
@@ -43,7 +41,9 @@ diff --git a/distribution/scripts/thermostat-init-layout b/distribution/scripts/
 -    THERMOSTAT_AGENT_LOG="${THERMOSTAT_HOME}/agent/logs"
 -    THERMOSTAT_AGENT_RUN="${THERMOSTAT_HOME}/agent/run"
 -    THEMROSTAT_CLIENT="${THERMOSTAT_HOME}/client"
--    THERMOSTAT_LIBS="${THERMOSTAT_HOME}/libs"
+-    THERMOSTAT_LIBS="${THERMOSTAT_HOME}/libs/native"
++USER_THERMOSTAT_HOME="${HOME}/.thermostat"
+ 
 +THERMOSTAT_STORAGE="${USER_THERMOSTAT_HOME}/storage/db"
 +THERMOSTAT_LOG="${USER_THERMOSTAT_HOME}/storage/logs"
 +THERMOSTAT_PID="${USER_THERMOSTAT_HOME}/storage/run"
@@ -54,7 +54,8 @@ diff --git a/distribution/scripts/thermostat-init-layout b/distribution/scripts/
 +THERMOSTAT_CLIENT="${USER_THERMOSTAT_HOME}/client"
 +THERMOSTAT_LIBS="${USER_THERMOSTAT_HOME}/libs"
 +THERMOSTAT_ETC="${USER_THERMOSTAT_HOME}/etc"
- 
++THERMOSTAT_OSGI_CACHE="${USER_THERMOSTAT_HOME}/osgi-cache"
++
 +if [ ! -d "${THERMOSTAT_STORAGE}" ] ; then
      echo "creating $THERMOSTAT_STORAGE"
      mkdir -p $THERMOSTAT_STORAGE
@@ -100,11 +101,11 @@ diff --git a/distribution/scripts/thermostat-init-layout b/distribution/scripts/
      echo "creating $THERMOSTAT_AGENT_RUN"
      mkdir -p $THERMOSTAT_AGENT_RUN
 +fi
-+
+ 
 +if [ ! -e "${USER_THERMOSTAT_HOME}/agent/agent.properties" ] ; then
 +    cp "${THERMOSTAT_HOME}"/agent/agent.properties "${USER_THERMOSTAT_HOME}"/agent/agent.properties
 +fi
- 
++
 +if [ ! -d "${THERMOSTAT_CLIENT}" ] ; then
      echo "creating $THERMOSTAT_CLIENT"
      mkdir -p "$THERMOSTAT_CLIENT"
@@ -121,4 +122,9 @@ diff --git a/distribution/scripts/thermostat-init-layout b/distribution/scripts/
 +    ln -s "${THERMOSTAT_HOME}"/etc "$THERMOSTAT_ETC"
 +fi
 +
++if [ ! -d "${THERMOSTAT_OSGI_CACHE}" ] ; then
++    echo "creating $THERMOSTAT_OSGI_CACHE"
++    mkdir -p "$THERMOSTAT_OSGI_CACHE"
++fi
++
 +THERMOSTAT_HOME="${USER_THERMOSTAT_HOME}"
diff --git a/sources b/sources
index 29706ed..c8a2251 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-41bc22901a644fd97a71167604eefd87  thermostat-0.3.tar.gz
+d38c211c0c7d7ffea312de788c394e10  thermostat-0.4.0.tar.gz
diff --git a/thermostat.spec b/thermostat.spec
index cb70012..a9564f3 100644
--- a/thermostat.spec
+++ b/thermostat.spec
@@ -1,6 +1,6 @@
 Name:       thermostat
-Version:    0.3
-Release:    3%{?dist}
+Version:    0.4.0
+Release:    1%{?dist}
 Summary:    A monitoring and serviceability tool for OpenJDK
 License:    GPLv2+ with exceptions
 URL:        http://icedtea.classpath.org/thermostat/
@@ -8,13 +8,15 @@ URL:        http://icedtea.classpath.org/thermostat/
 # a build every so often based on a HG revision
 #Source0:    http://icedtea.classpath.org/hg/thermostat/archive/0.3.tar.bz2
 Source0:    http://icedtea.classpath.org/download/%{name}/%{name}-%{version}.tar.gz
-
 Patch0:     per-user-home.patch
-Patch1:     fix-test-scopes.patch
-Patch2:     ignore-missing-activator.patch
-Patch3:     follow-lib-symlinks.patch
-
-BuildArch:  noarch
+# Don't build web stuff and remove jacoco references
+Patch1:     fix_pom.patch
+# This should be a F17 only patch. F18 and up has lucene 3.6
+Patch2:     lucene_2.9.4_compat.patch
+# Use System.load() over System.loadLibrary() as per Java packaging guidelines
+Patch3:     fix_natives.patch
+# Start all deps as bundles
+Patch4:     fix_bundle_loading.patch
 
 BuildRequires:  java-devel >= 1:1.7.0
 BuildRequires:  jpackage-utils
@@ -23,23 +25,28 @@ BuildRequires: maven
 BuildRequires: maven-dependency-plugin
 BuildRequires: maven-surefire-plugin
 BuildRequires: maven-surefire-provider-junit4
+# Native bits are built with this
+BuildRequires: maven-plugin-exec
 
+BuildRequires: libgnome-keyring-devel
 BuildRequires: felix-framework
 BuildRequires: felix-osgi-core
 BuildRequires: felix-osgi-compendium
 BuildRequires: fusesource-pom
 BuildRequires: jansi
-BuildRequires: jfreechart >= 1.0.14
+# 1.0.14-3 has OSGi metadata
+BuildRequires: jfreechart >= 1.0.14-3
+# 1.0.17-4 has OSGi metadata
+BuildRequires: jcommon >= 1.0.17-4
+BuildRequires: apache-commons-logging
+BuildRequires: apache-commons-beanutils
+BuildRequires: apache-commons-cli
 BuildRequires: jline2
 BuildRequires: mongo-java-driver
 BuildRequires: mongo-java-driver-bson
 BuildRequires: netty
-# Not sure if we need this as Requires as well
-# --------------------------------------------
-# Could not resolve dependencies for project
-# com.redhat.thermostat:thermostat-client-core:bundle:0.3:
-# The repository system is offline but the artifact com.lowagie:itext:jar:2.1.5
-# is not available in the local repository.
+BuildRequires: lucene >= 2.9.4
+# thermostat-client-core wants itext
 BuildRequires: itext-core
 
 Requires: java >= 1:1.7.0
@@ -51,12 +58,21 @@ Requires: felix-osgi-compendium
 Requires: jansi
 Requires: java-devel >= 1:1.7.0
 Requires: jline2
-Requires: jfreechart >= 1.0.14
+# 1.0.14-3 has OSGi metadata
+Requires: jfreechart >= 1.0.14-3
+# 1.0.17-4 has OSGi metadata
+Requires: jcommon >= 1.0.17-4
 Requires: mongodb
 Requires: mongodb-server
 Requires: mongo-java-driver
 Requires: mongo-java-driver-bson
 Requires: netty
+Requires: lucene >= 2.9.4
+Requires: itext-core
+Requires: libgnome-keyring
+Requires: apache-commons-logging
+Requires: apache-commons-beanutils
+Requires: apache-commons-cli
 
 %description
 Thermostat is a monitoring and instrumentation tool for the Hotspot JVM,
@@ -79,9 +95,10 @@ This package contains the API documentation for %{name}
 %prep
 %setup -q
 %patch0 -p1
-%patch1 -p1
+%patch1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 %build
 mvn-rpmbuild \
@@ -98,12 +115,34 @@ mv thermostat-*jar distribution/target/libs/
 sed -i 's|^JAVA=.*|JAVA="/usr/lib/jvm/java-openjdk/jre/bin/java"|' distribution/target/bin/thermostat
 sed -i 's|^JAVA=.*|JAVA="/usr/lib/jvm/java-openjdk/jre/bin/java"|' distribution/target/bin/thermostat-client-gui
 
+# remove dirs/files which we don't need shipped
+rm -rf distribution/target/maven-archiver
+rm -rf distribution/target/thermostat-distribution-0.3.jar
+rm -rf distribution/target/osgi-cache
+
 %install
 mkdir -p %{buildroot}%{_bindir}
 mkdir -p %{buildroot}%{_sysconfdir}/%{name}
 mkdir -p %{buildroot}%{_datarootdir}
-
-# move everything thermostat into /usr/share/thermostat
+# JNI things live there
+mkdir -p %{buildroot}%{_libdir}/%{name}
+mkdir -p %{buildroot}%{_jnidir}
+
+pushd distribution/target/libs
+# JNI files are in %{_libdir}
+mv thermostat-keyring-%{version}.jar \
+   thermostat-agent-core-%{version}.jar \
+   %{buildroot}%{_libdir}/%{name}
+mv native/* %{buildroot}%{_libdir}/%{name}
+# JNI jars need to be in %{_jnidir}, we symlink to
+# %{_libdir}/%{name} files
+for i in thermostat-keyring-%{version}.jar \
+    thermostat-agent-core-%{version}.jar; do
+  ln -s %{_libdir}/%{name}/$i %{buildroot}%{_jnidir}/$i
+done
+popd
+
+# move everything else into /usr/share/thermostat
 cp -a distribution/target %{buildroot}%{_datarootdir}/%{name}
 
 # symlink dependencies into the right directory
@@ -111,13 +150,32 @@ build-jar-repository -s -p %{buildroot}%{_datarootdir}/%{name}/libs \
     felix/org.apache.felix.framework \
     felix/org.osgi.core \
     felix/org.osgi.compendium \
-    commons-cli \
+    apache-commons-cli \
+    apache-commons-collections \
+    apache-commons-beanutils \
+    apache-commons-logging \
     hawtjni-runtime \
     jansi \
     jcommon \
-    jfreechart \
+    jfreechart/jfreechart \
     jline2 \
-    mongo
+    lucene \
+    netty \
+    mongo \
+    
+
+pushd %{buildroot}%{_libdir}/%{name}
+# symlink JNI jars
+for i in *.jar; do
+  ln -s %{_libdir}/%{name}/$i \
+        %{buildroot}%{_datarootdir}/%{name}/libs/$i
+done
+# symlink shared libs
+for i in *.so; do
+  ln -s %{_libdir}/%{name}/$i \
+        %{buildroot}%{_datarootdir}/%{name}/libs/native/$i
+done
+popd
 
 ln -s /usr/lib/jvm/java-openjdk/lib/tools.jar \
     %{buildroot}%{_datarootdir}/%{name}/libs/
@@ -155,6 +213,8 @@ cp -a target/site/apidocs %{buildroot}%{_javadocdir}/%{name}
 %doc README
 %config(noreplace) %{_sysconfdir}/%{name}
 %{_datarootdir}/%{name}
+%{_libdir}/%{name}
+%{_jnidir}
 %{_bindir}/thermostat-client
 %{_bindir}/thermostat
 
@@ -162,6 +222,10 @@ cp -a target/site/apidocs %{buildroot}%{_javadocdir}/%{name}
 %{_javadocdir}/%{name}
 
 %changelog
+* Tue Oct 16 2012 Severin Gehwolf <sgehwolf at redhat.com> 0.4.0-1
+- Update to upstream 0.4 release.
+- Starts dependencies as bundles.
+
 * Sat Jul 21 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.3-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 


More information about the scm-commits mailing list