[thermostat] Fix path to jdk/tools.jar in boot scripts.
jerboaa
jerboaa at fedoraproject.org
Fri Jan 17 16:55:19 UTC 2014
commit ea16b6b3a6db502620f494d9c10017be4d7c683f
Author: Severin Gehwolf <sgehwolf at redhat.com>
Date: Fri Jan 17 16:24:12 2014 +0100
Fix path to jdk/tools.jar in boot scripts.
- Build against netty3 for now. See RHBZ#1053619.
- Fix build bundle versions.
thermostat.spec | 47 ++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 40 insertions(+), 7 deletions(-)
---
diff --git a/thermostat.spec b/thermostat.spec
index 91f9ffb..8bf3392 100644
--- a/thermostat.spec
+++ b/thermostat.spec
@@ -11,9 +11,9 @@
%global jcommon_bundle_version 1.0.18
%global jfreechart_bundle_version 1.0.14
# apache-commons-beanutils
-%global beanutils_bundle_version 1.8.3
+%global beanutils_bundle_version 1.9.1
# apache-commons-codec
-%global codec_bundle_version 1.8.0
+%global codec_bundle_version 1.9.0
# apache-commons-collections
%global collections_bundle_version 3.2.1
# apache-commons-logging
@@ -21,12 +21,15 @@
# Real OSGi Bundle-Version is 2.11.3.RELEASE
%global mongo_bundle_version 2.11.3
%global hc_core_bundle_version 4.3.0
-%global hc_client_bundle_version 4.3.0
+%global hc_client_bundle_version 4.3.1
%global gson_bundle_version 2.2.4
# Flag set to 1 if it's an SCL build. 0 otherwise.
%global is_scl_build %( test -n "$(rpm --eval '%{?scl}')" && echo 1 || echo 0)
+# Base path to the JDK which will be used in boot scripts
+%global jdk_base /usr/lib/jvm/java-1.7.0-openjdk
+
%{?scl:%scl_package thermostat}
%{!?scl:%global pkg_name %{name}}
@@ -75,7 +78,7 @@ Name: %{?scl_prefix}thermostat
Version: %{major}.%{minor}.%{patchlevel}
# If building from snapshot out of hg, uncomment and adjust below value as appropriate
#Release: 0.1.20131122hg%{hgrev}%{?dist}
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A monitoring and serviceability tool for OpenJDK
License: GPLv2+ with exceptions
URL: http://icedtea.classpath.org/thermostat/
@@ -148,6 +151,9 @@ BuildRequires: jansi
# lucene 3.6.0-6 has fixed osgi metadata
BuildRequires: lucene >= 3.6.0-6
BuildRequires: apache-commons-fileupload
+# Change to netty once RHBZ#1053619 is
+# resolved.
+BuildRequires: netty3
###################################################
# The following BRs are specified via osgi's
@@ -205,7 +211,9 @@ Requires: osgi(org.apache.commons.logging) >= %{logging_bundle_version}
Requires: osgi(org.apache.commons.beanutils) >= %{beanutils_bundle_version}
Requires: osgi(org.apache.commons.codec) >= %{codec_bundle_version}
Requires: osgi(org.mongodb.mongo-java-driver) >= %{mongo_bundle_version}
-Requires: osgi(org.jboss.netty) >= %{netty_bundle_version}
+# Change to netty once RHBZ#1053619 has been resolved
+Requires: netty3
+Requires: osgi(org.jboss.netty) = %{netty_bundle_version}
Requires: osgi(com.google.gson) >= %{gson_bundle_version}
Requires: osgi(org.apache.httpcomponents.httpcore) >= %{hc_core_bundle_version}
# httpmime comes from httpcomponents-client just like httpclient itself
@@ -324,6 +332,9 @@ security.
%pom_xpath_remove "pom:dependencies/pom:dependency[pom:groupId='com.sun']/pom:systemPath" agent/proxy/common
%pom_xpath_remove "pom:dependencies/pom:dependency[pom:groupId='com.sun']/pom:systemPath" agent/proxy/server
+# Skip automatic installation of zip artifacts. We only use it for our build
+# to assemble plug-ins.
+%mvn_package com.redhat.thermostat::zip: __noinstall
# Skip automatic installation of the war module.
# We install it manually. Without this "config" %mvn_build -f
# fails. See RHBZ#963838
@@ -434,8 +445,12 @@ mv distribution/target/image/libs/thermostat-*jar .
rm -f distribution/target/image/libs/*jar
mv thermostat-*jar distribution/target/image/libs/
-# fix path to java in scripts
-sed -i 's|^JAVA=.*|JAVA="/usr/lib/jvm/java-openjdk/jre/bin/java"|' distribution/target/image/bin/thermostat
+# Need Java 7 in in scripts
+sed -i 's|^JAVA=.*|JAVA="%{jdk_base}/bin/java"|' distribution/target/image/bin/thermostat
+sed -i 's|^JAVA=.*|JAVA="%{jdk_base}/bin/java"|' distribution/target/image/bin/thermostat-agent-proxy
+# Fix path to tools.jar
+sed -i 's|^TOOLS_JAR=.*|TOOLS_JAR="%{jdk_base}/lib/tools.jar"|' distribution/target/image/bin/thermostat
+sed -i 's|^TOOLS_JAR=.*|TOOLS_JAR="%{jdk_base}/lib/tools.jar"|' distribution/target/image/bin/thermostat-agent-proxy
# Collect a list of filenames which we later use in order to symlink from
# $THERMOSTAT_HOME
@@ -698,6 +713,19 @@ pushd %{buildroot}/%{thermostat_catalina_base}
done
popd
+%check
+# Perform some sanity checks on paths to JAVA/TOOLS_JAR
+# in important boot scripts. See RHBZ#1052992 and
+# RHBZ#1053123
+TOOLS_JAR="$(grep 'TOOLS_JAR=' %{buildroot}/%{thermostat_home}/bin/thermostat | cut -d= -f2 | cut -d\" -f2)"
+test "${TOOLS_JAR}" = "%{jdk_base}/lib/tools.jar"
+TOOLS_JAR="$(grep 'TOOLS_JAR=' %{buildroot}/%{thermostat_home}/bin/thermostat-agent-proxy | cut -d= -f2 | cut -d\" -f2)"
+test "${TOOLS_JAR}" = "%{jdk_base}/lib/tools.jar"
+JAVA="$(grep 'JAVA=' %{buildroot}/%{thermostat_home}/bin/thermostat | cut -d= -f2 | cut -d\" -f2)"
+test "${JAVA}" = "%{jdk_base}/bin/java"
+JAVA="$(grep 'JAVA=' %{buildroot}/%{thermostat_home}/bin/thermostat-agent-proxy | cut -d= -f2 | cut -d\" -f2)"
+test "${JAVA}" = "%{jdk_base}/bin/java"
+
%pre
# add the thermostat user and group
%{_sbindir}/groupadd -r thermostat 2>/dev/null || :
@@ -780,6 +808,11 @@ fi
%config(noreplace) %{system_confdir}/sysconfig/tomcat@%{pkg_name}
%changelog
+* Fri Jan 17 2014 Severin Gehwolf <sgehwolf at redhat.com> - 1.0.0-2
+- Fix path to jdk/tools.jar in boot scripts.
+- Build against netty3 for now. See RHBZ#1053619.
+- Fix build bundle versions.
+
* Thu Nov 28 2013 Severin Gehwolf <sgehwolf at redhat.com> - 1.0.0-1
- Update to upstream 1.0.0 release.
- Add support for building release branch snapshots.
More information about the scm-commits
mailing list