[thermostat/f20] Update to upstream 1.0.0 release.
jerboaa
jerboaa at fedoraproject.org
Thu Nov 28 14:47:34 UTC 2013
commit a108861676772ffe3742dd2c8a97502684f21f6c
Author: Severin Gehwolf <sgehwolf at redhat.com>
Date: Thu Nov 28 15:09:33 2013 +0100
Update to upstream 1.0.0 release.
- Add support for building release branch snapshots.
- thermostat-storage service starts in permissive mode.
- Add scriptlet to start storage, agent and gui via the
installed icon.
.gitignore | 13 +--
fix_bundle_loading.patch | 24 ++++-
fix_keyring_warnings.patch | 25 +++++
hc_core_client_versions.patch | 235 -----------------------------------------
ignore_bundle_versions.patch | 19 ++++
osgi_spec_fixes.patch | 15 ---
sources | 2 +-
thermostat-local | 43 ++++++++
thermostat.spec | 177 +++++++++++++++++--------------
9 files changed, 208 insertions(+), 345 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 7fccc66..614da24 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,13 +1,4 @@
-/6f83cf36541d.tar.gz
-/2140a7c81a4b.tar.gz
-/thermostat-0.3.tar.gz
-/thermostat-0.4.0.tar.gz
-/thermostat-a96af4716d10.tar.bz2
-/thermostat-9fdbdf22d9d4.tar.bz2
-/thermostat-09c2918d8656.tar.bz2
-/thermostat-d6145521e208.tar.bz2
-/thermostat-0.6.0.tar.gz
-/thermostat-97e66ed2e4ae.tar.bz2
-/thermostat-0.9.0.tar.gz
/thermostat-0.9.2.tar.gz
/thermostat-0.15.0.tar.gz
+/thermostat-1.0-b7c6db90e034.tar.bz2
+/thermostat-1.0.0.tar.gz
diff --git a/fix_bundle_loading.patch b/fix_bundle_loading.patch
index b5c3ea5..feb564b 100644
--- a/fix_bundle_loading.patch
+++ b/fix_bundle_loading.patch
@@ -126,13 +126,33 @@ diff --git a/distribution/config/osgi-export.properties b/distribution/config/os
-# available.
-javax.transaction="1.1"
-javax.mail="1.4"
+diff --git a/distribution/scripts/thermostat b/distribution/scripts/thermostat
+--- a/distribution/scripts/thermostat
++++ b/distribution/scripts/thermostat
+@@ -56,15 +56,12 @@
+
+ # This is the minimal boot classpath thermostat needs. Other dependencies
+ # will get started by the OSGi framework once that's up.
+-SERVICE_CLASSPATH="${THERMOSTAT_LIBS}/org.apache.felix.framework- at felix.framework.version@.jar"
++SERVICE_CLASSPATH="${THERMOSTAT_LIBS}/org.apache.felix.framework.jar"
+ SERVICE_CLASSPATH="${SERVICE_CLASSPATH}:${THERMOSTAT_LIBS}/thermostat-launcher- at project.version@.jar"
+ SERVICE_CLASSPATH="${SERVICE_CLASSPATH}:${THERMOSTAT_LIBS}/thermostat-main- at project.version@.jar"
+ SERVICE_CLASSPATH="${SERVICE_CLASSPATH}:${THERMOSTAT_LIBS}/thermostat-shared-config- at project.version@.jar"
+ # This needs to be on the classpath for the RMI registry to find it
+ SERVICE_CLASSPATH="${SERVICE_CLASSPATH}:${THERMOSTAT_LIBS}/thermostat-agent-proxy-common- at project.version@.jar"
+-# FIXME: Remove once jfreechart is a real OSGi bundle upstream
+-SERVICE_CLASSPATH="${SERVICE_CLASSPATH}:${THERMOSTAT_LIBS}/jfreechart- at jfreechart.version@.jar"
+-SERVICE_CLASSPATH="${SERVICE_CLASSPATH}:${THERMOSTAT_LIBS}/jcommon- at jcommon.version@.jar"
+ SERVICE_CLASSPATH="${TOOLS_JAR}:${SERVICE_CLASSPATH}"
+
+ THERMOSTAT_MAIN="com.redhat.thermostat.main.Thermostat"
diff --git a/main/src/main/resources/com/redhat/thermostat/main/impl/bootstrapbundles.properties b/main/src/main/resources/com/redhat/thermostat/main/impl/bootstrapbundles.properties
--- a/main/src/main/resources/com/redhat/thermostat/main/impl/bootstrapbundles.properties
+++ b/main/src/main/resources/com/redhat/thermostat/main/impl/bootstrapbundles.properties
-@@ -5,6 +5,7 @@
+@@ -4,6 +4,7 @@
+ thermostat-common-core-${project.version}.jar, \
thermostat-plugin-validator-${project.version}.jar, \
thermostat-launcher-${project.version}.jar, \
- thermostat-main-${project.version}.jar, \
- jline-${jline.version}.jar, \
- commons-cli-${commons-cli.version}.jar, \
- org.apache.servicemix.bundles.lucene-${lucene.version}.jar
diff --git a/fix_keyring_warnings.patch b/fix_keyring_warnings.patch
new file mode 100644
index 0000000..599ccbc
--- /dev/null
+++ b/fix_keyring_warnings.patch
@@ -0,0 +1,25 @@
+diff --git a/keyring/src/main/native/GnomeKeyringLibraryNative.c b/keyring/src/main/native/GnomeKeyringLibraryNative.c
+--- a/keyring/src/main/native/GnomeKeyringLibraryNative.c
++++ b/keyring/src/main/native/GnomeKeyringLibraryNative.c
+@@ -73,7 +73,7 @@
+ }
+
+ jsize passwordLength = (*env)->GetArrayLength(env, jpassword);
+- char *password = (*env)->GetByteArrayElements(env, jpassword, NULL);
++ jbyte *password = (*env)->GetByteArrayElements(env, jpassword, NULL);
+ if (password == NULL) {
+ (*env)->ReleaseStringUTFChars(env, jurl, url);
+ (*env)->ReleaseStringUTFChars(env, juserName, userName);
+@@ -162,9 +162,11 @@
+ (*env)->ReleaseStringUTFChars(env, juserName, userName);
+
+ if (res == GNOME_KEYRING_RESULT_OK) {
++ const jbyte *jbytePassword = (const jbyte *) password;
++
+ jsize passwordLength = strlen(password);
+ jbyteArray jpassword = (*env)->NewByteArray(env, passwordLength);
+- (*env)->SetByteArrayRegion(env, jpassword, 0, passwordLength, password);
++ (*env)->SetByteArrayRegion(env, jpassword, 0, passwordLength, jbytePassword);
+ gnome_keyring_free_password(password);
+ return jpassword;
+ } else {
diff --git a/ignore_bundle_versions.patch b/ignore_bundle_versions.patch
new file mode 100644
index 0000000..555de2f
--- /dev/null
+++ b/ignore_bundle_versions.patch
@@ -0,0 +1,19 @@
+diff --git a/distribution/scripts/thermostat b/distribution/scripts/thermostat
+--- a/distribution/scripts/thermostat
++++ b/distribution/scripts/thermostat
+@@ -113,13 +113,13 @@
+ if [ x"$PID_FILE" = "x" ]; then
+ usage
+ else
+- ${JAVA} "${JAVA_ARGS[@]}" -cp ${SERVICE_CLASSPATH} ${THERMOSTAT_MAIN} "${ARGS[@]}" &
++ ${JAVA} "${JAVA_ARGS[@]}" -cp ${SERVICE_CLASSPATH} ${THERMOSTAT_MAIN} --ignore-bundle-versions "${ARGS[@]}" &
+ retval=$?
+ echo $! > $PID_FILE
+ retval=$(( $retval + $? ))
+ fi
+ else
+- ${JAVA} "${JAVA_ARGS[@]}" -cp ${SERVICE_CLASSPATH} ${THERMOSTAT_MAIN} "${ARGS[@]}"
++ ${JAVA} "${JAVA_ARGS[@]}" -cp ${SERVICE_CLASSPATH} ${THERMOSTAT_MAIN} --ignore-bundle-versions "${ARGS[@]}"
+ retval=$?
+ fi
+ exit $retval
diff --git a/osgi_spec_fixes.patch b/osgi_spec_fixes.patch
index aa4212d..33f709d 100644
--- a/osgi_spec_fixes.patch
+++ b/osgi_spec_fixes.patch
@@ -1402,21 +1402,6 @@ diff --git a/web/client/pom.xml b/web/client/pom.xml
</dependency>
<dependency>
-diff --git a/web/cmd/pom.xml b/web/cmd/pom.xml
---- a/web/cmd/pom.xml
-+++ b/web/cmd/pom.xml
-@@ -92,9 +92,8 @@
- </dependency>
-
- <dependency>
-- <groupId>org.osgi</groupId>
-- <artifactId>org.osgi.core</artifactId>
-- <scope>provided</scope>
-+ <groupId>org.apache.felix</groupId>
-+ <artifactId>org.apache.felix.framework</artifactId>
- </dependency>
-
- <dependency>
diff --git a/web/server/pom.xml b/web/server/pom.xml
--- a/web/server/pom.xml
+++ b/web/server/pom.xml
diff --git a/sources b/sources
index 9d3f72a..f70e40e 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-39d52b8d0bed51fa9cff9391ea4b3d72 thermostat-0.15.0.tar.gz
+8700f2d408d6684ea2e424a7e3fb333d thermostat-1.0.0.tar.gz
diff --git a/thermostat-local b/thermostat-local
new file mode 100644
index 0000000..d1bc42b
--- /dev/null
+++ b/thermostat-local
@@ -0,0 +1,43 @@
+#!/bin/bash
+#
+# Starts thermostat storage (i.e. DB), attaches a
+# local thermostat agent and opens up the
+# thermostat gui (swing client).
+#
+#set -xv
+
+function stop_agent() {
+ if [ -e "${THERMOSTAT_AGENT_PID}" ]; then
+ pid=$(cat "${THERMOSTAT_AGENT_PID}")
+ kill ${pid}
+ retval=$?
+ # cleanup pid
+ rm -rf "${THERMOSTAT_AGENT_PID}"
+ return ${retval}
+ else
+ return 1
+ fi
+}
+
+USER_THERMOSTAT_HOME=${HOME}/.thermostat
+if [! -e ${USER_THERMOSTAT_HOME} ]; then
+ mkdir -p ${USER_THERMOSTAT_HOME}
+fi
+if [! -e ${USER_THERMOSTAT_HOME}/run ]; then
+ mkdir ${USER_THERMOSTAT_HOME}
+fi
+
+THERMOSTAT=@thermostat.home@/bin/thermostat
+THERMOSTAT_AGENT_SCRIPT=@thermostat.home@
+THERMOSTAT_AGENT_PID=${USER_THERMOSTAT_HOME}/run/thermostat-local-agent.pid
+
+# Start storage
+${THERMOSTAT} storage --start
+# Start an agent in the background
+${THERMOSTAT} -Tbg "${THERMOSTAT_AGENT_PID}" agent
+# Start the gui; this blocks
+${THERMOSTAT} gui
+
+# This means gui finished, stop agent and storage
+stop_agent
+${THERMOSTAT} storage --stop
diff --git a/thermostat.spec b/thermostat.spec
index 00fd44b..30320b6 100644
--- a/thermostat.spec
+++ b/thermostat.spec
@@ -1,3 +1,7 @@
+# Thermostat version
+%global major 1
+%global minor 0
+%global patchlevel 0
# Thermostat requires exact versions for bundle dependencies.
# We use those versions to pass to the maven build in order for
# it to set it in relevant files.
@@ -37,9 +41,11 @@
%if %{is_scl_build}
%global system_confdir %{_root_sysconfdir}
%global system_root_datadir %{_root_datadir}
+ %global system_tmpfilesdir %{_root_exec_prefix}/lib/tmpfiles.d
%else
%global system_confdir %{_sysconfdir}
%global system_root_datadir %{_datadir}
+ %global system_tmpfilesdir %{_tmpfilesdir}
%endif
# system java dir definition (non-scl)
%global system_javadir %{system_root_datadir}/java
@@ -63,45 +69,56 @@
%endif
# Uncomment to build from snapshot out of hg. See also Release and Source0
-#%global hgrev 97e66ed2e4ae
+#%global hgrev b7c6db90e034
Name: %{?scl_prefix}thermostat
-Version: 0.15.0
+Version: %{major}.%{minor}.%{patchlevel}
# If building from snapshot out of hg, uncomment and adjust below value as appropriate
-#Release: 0.1.20130521hg%{hgrev}%{?dist}
+#Release: 0.1.20131122hg%{hgrev}%{?dist}
Release: 1%{?dist}
Summary: A monitoring and serviceability tool for OpenJDK
License: GPLv2+ with exceptions
URL: http://icedtea.classpath.org/thermostat/
# This is the source URL to be used for released versions
Source0: http://icedtea.classpath.org/download/%{pkg_name}/%{pkg_name}-%{version}.tar.gz
-# This is the source to be used for hg snapshot versions
+# This is the source to be used for hg snapshot versions from HEAD
#wget -O thermostat-%{hgrev}.tar.bz2 http://icedtea.classpath.org/hg/%{pkg_name}/archive/%{hgrev}.tar.bz2
#Source0: thermostat-%{hgrev}.tar.bz2
+# This is the source to be used for hg snapshot versions from a release branch
+#wget -O thermostat-%{major}.%{minor}-%{hgrev}.tar.bz2 http://icedtea.classpath.org/hg/release/%{pkg_name}-%{major}.${minor}/archive/%{hgrev}.tar.bz2
+#Source0: thermostat-%{major}.%{minor}-%{hgrev}.tar.bz2
# This is _NOT_ suitable for upstream at this point.
# It's very Fedora specific.
Source1: thermostat-sysconfig
Source2: thermostat_icon_64px.svg
# SCL only sources
Source3: scl-thermostat-tomcat-service-sysconfig
-# Patch proposed upstream. Remove with next packaged version from upstream.
-# See http://icedtea.classpath.org/pipermail/thermostat/2013-October/008591.html
-# Pushed as revision 64d12b250c46. Remove with next update.
-Patch0: hc_core_client_versions.patch
+Source4: thermostat-local
# This is _NOT_ suitable for upstream at this point.
# jfreechart isn't a bundle upstream. Also some httpclient* related bundles
# include transitive deps upstream, which isn't the case in Fedora (i.e. is
# properly done in Fedora)
-Patch1: fix_bundle_loading.patch
+Patch0: fix_bundle_loading.patch
# Patch proposed upstream, but was denied.
# See http://icedtea.classpath.org/pipermail/thermostat/2013-October/008602.html
# For now _NOT_ suitable for upstream until felix ships an API only package which
# is 4.3 OSGi spec.
-Patch2: osgi_spec_fixes.patch
+Patch1: osgi_spec_fixes.patch
# This is _NOT_ suitable for upstream at this point.
# Sets the default log level to something reasonable (if during release procedure
# it was forgotten to set it). Not upstream-able.
-Patch3: fix_loglevel.patch
+Patch2: fix_loglevel.patch
+# This is _NOT_ suitable for upstream at this point.
+# Adds an CLI option to the Thermostat main class so that it ignores
+# bundle symbolic names and versions it has in the config files.
+# The config files are set in stone at build time and updates of
+# transitive deps (which we can't control) might break thermostat.
+# We rely on RPM's dep solving mechanism instead.
+# See: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1591
+Patch3: ignore_bundle_versions.patch
+# This has been proposed upstream. See:
+# http://icedtea.classpath.org/pipermail/thermostat/2013-November/008962.html
+Patch4: fix_keyring_warnings.patch
BuildRequires: java-devel >= 1:1.7.0
BuildRequires: jpackage-utils
@@ -218,7 +235,8 @@ BuildArch: noarch
This package contains the API documentation for %{name}
%package webapp
-Summary: Web storage for Thermostat
+Summary: Web storage endpoint for Thermostat
+BuildArch: noarch
# Not sure if we need this, but better be safe than sorry.
# This version will allow custom catalina-base/systemd stuff as
# we do it.
@@ -227,20 +245,22 @@ Requires: apache-commons-fileupload
Requires: %{name} = %{version}
%description webapp
-This package contains the exploded web archive which installs into
-tomcat's webapps directory.
+This package contains the exploded web archive. This web application
+contains the server-side parts for deploying thermostat with improved
+security.
%prep
-#%setup -q -n %{pkg_name}-%{hgrev}
+# When Source0 is released version.
%setup -q -n %{pkg_name}-%{version}
+# When Source0 is a snapshot from HEAD.
+#%setup -q -n %{pkg_name}-%{hgrev}
+# When Source 0 is a snapshot from a release branch.
+#%setup -q -n %{pkg_name}-%{major}-%{minor}-%{hgrev}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
-
-# webservice command is going to be disabled.
-rm distribution/config/commands/webservice.properties
-%pom_disable_module cmd web
+%patch4 -p1
# Fix up artifact names which have different name upstream
# lucene
@@ -265,6 +285,7 @@ rm distribution/config/commands/webservice.properties
%pom_remove_plugin org.codehaus.mojo:exec-maven-plugin agent/core
%pom_remove_plugin org.codehaus.mojo:exec-maven-plugin keyring
%pom_remove_plugin org.codehaus.mojo:exec-maven-plugin laf-utils
+%pom_remove_plugin org.codehaus.mojo:exec-maven-plugin agent/proxy/server
# Remove jacoco-coverage plugin (in main pom.xml and web/war/pom.xml)
%pom_remove_plugin org.jacoco:jacoco-maven-plugin
@@ -281,7 +302,6 @@ rm distribution/config/commands/webservice.properties
%pom_disable_module integration-tests
# Part of the disable webservice patch can be done with pom macros
-%pom_remove_dep com.redhat.thermostat:thermostat-web-cmd distribution
%pom_remove_dep org.eclipse.jetty:jetty-server distribution
%pom_remove_dep org.eclipse.jetty:jetty-webapp distribution
@@ -293,17 +313,16 @@ rm distribution/config/commands/webservice.properties
%pom_xpath_remove "pom:dependencies/pom:dependency[pom:groupId='com.sun']/pom:scope" vm-heap-analysis/command
%pom_xpath_remove "pom:dependencies/pom:dependency[pom:groupId='com.sun']/pom:scope" vm-heap-analysis/client-swing
%pom_xpath_remove "pom:dependencies/pom:dependency[pom:groupId='com.sun']/pom:scope" vm-heap-analysis/client-core
+%pom_xpath_remove "pom:dependencies/pom:dependency[pom:groupId='com.sun']/pom:scope" agent/proxy/common
+%pom_xpath_remove "pom:dependencies/pom:dependency[pom:groupId='com.sun']/pom:scope" agent/proxy/server
%pom_xpath_remove "pom:dependencies/pom:dependency[pom:groupId='com.sun']/pom:systemPath" agent/core
%pom_xpath_remove "pom:dependencies/pom:dependency[pom:groupId='com.sun']/pom:systemPath" common/core
%pom_xpath_remove "pom:dependencies/pom:dependency[pom:groupId='com.sun']/pom:systemPath" thread/collector
%pom_xpath_remove "pom:dependencies/pom:dependency[pom:groupId='com.sun']/pom:systemPath" vm-heap-analysis/command
%pom_xpath_remove "pom:dependencies/pom:dependency[pom:groupId='com.sun']/pom:systemPath" vm-heap-analysis/client-swing
%pom_xpath_remove "pom:dependencies/pom:dependency[pom:groupId='com.sun']/pom:systemPath" vm-heap-analysis/client-core
-
-# FIXME: Inject <scope>test</scope> for test-only dep. Remove next release.
-# See http://icedtea.classpath.org/pipermail/thermostat/2013-November/008614.html
-# Fixed with revision 0f8feaacab68
-%pom_xpath_inject "pom:dependencies/pom:dependency[pom:artifactId='thermostat-common-test']" "<scope>test</scope>" thermostat-plugin-validator
+%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 the war module.
# We install it manually. Without this "config" %mvn_build -f
@@ -321,10 +340,8 @@ rm distribution/config/commands/webservice.properties
# webapp
%mvn_package com.redhat.thermostat:thermostat-web-server webapp
-# FIXME: Hack xmvn for SCL.
-%if %{is_scl_build}
- %mvn_config installerSettings/jarDir %{buildroot}/%{_datarootdir}/java
-%endif
+# copy the thermostat-local script into place. This is downstream only.
+cp %{SOURCE4} distribution/scripts
%build
export CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS"
@@ -337,35 +354,48 @@ export JAVA_HOME
# JNI bits depend on NativeLibraryResolver so compile that
# first and relevant Java classes with native methods
# after.
+pushd annotations
+ mkdir -p target/classes
+ javac -d target/classes \
+ src/main/java/com/redhat/thermostat/annotations/Service.java
+popd
pushd config
mkdir -p target/classes
javac -d target/classes \
+ -cp ../annotations/target/classes \
src/main/java/com/redhat/thermostat/shared/config/NativeLibraryResolver.java \
- src/main/java/com/redhat/thermostat/shared/config/Configuration.java \
+ src/main/java/com/redhat/thermostat/shared/config/CommonPaths.java \
+ src/main/java/com/redhat/thermostat/shared/config/internal/CommonPathsImpl.java \
src/main/java/com/redhat/thermostat/shared/config/InvalidConfigurationException.java \
- src/main/java/com/redhat/thermostat/shared/locale/LocalizedString.java
+ src/main/java/com/redhat/thermostat/shared/locale/Translate.java \
+ src/main/java/com/redhat/thermostat/shared/locale/LocalizedString.java \
+ src/main/java/com/redhat/thermostat/shared/locale/internal/LocaleResources.java
popd
pushd keyring
mkdir -p target/classes
- javac -cp ../config/target/classes \
+ javac -cp ../config/target/classes:../annotations/target/classes \
-d target/classes \
src/main/java/com/redhat/thermostat/utils/keyring/Keyring.java \
- src/main/java/com/redhat/thermostat/utils/keyring/Credentials.java \
- src/main/java/com/redhat/thermostat/utils/keyring/GnomeKeyringLibraryNative.java \
- ../annotations/src/main/java/com/redhat/thermostat/annotations/Service.java
+ src/main/java/com/redhat/thermostat/utils/keyring/impl/KeyringImpl.java
make all
- rm target/classes/com/redhat/thermostat/annotations/Service.class
popd
pushd agent/core
mkdir -p target/classes
- javac -cp ../../config/target/classes \
+ javac -cp ../../config/target/classes:../../annotations/target/classes \
-d target/classes \
- src/main/java/com/redhat/thermostat/utils/hostname/HostName.java \
- src/main/java/com/redhat/thermostat/utils/username/UserNameUtil.java \
- src/main/java/com/redhat/thermostat/utils/username/UserNameLookupException.java \
+ src/main/java/com/redhat/thermostat/agent/utils/hostname/HostName.java \
+ src/main/java/com/redhat/thermostat/agent/utils/username/UserNameUtil.java \
+ src/main/java/com/redhat/thermostat/agent/utils/username/UserNameLookupException.java \
src/main/java/com/redhat/thermostat/utils/username/internal/UserNameUtilImpl.java
make all
popd
+pushd agent/proxy/server
+ mkdir -p target/classes
+ javac -cp ../../../config/target/classes \
+ -d target/classes \
+ src/main/java/com/redhat/thermostat/agent/proxy/server/AgentProxyNativeUtils.java
+ make all
+popd
pushd laf-utils
mkdir -p target/classes
javac -cp ../config/target/classes \
@@ -473,12 +503,14 @@ pushd distribution/target/image/libs
# %{_libdir}/%{pkg_name} next.
for i in thermostat-keyring-*.jar \
thermostat-agent-core-*.jar \
+ thermostat-agent-proxy-server-*.jar \
thermostat-laf-utils-*.jar; do
ln -s %{_libdir}/%{pkg_name}/$i %{buildroot}%{_jnidir}/$i
done
# JNI files are in %{_libdir}
mv thermostat-keyring-*.jar \
thermostat-agent-core-*.jar \
+ thermostat-agent-proxy-server-*.jar \
thermostat-laf-utils-*.jar \
%{buildroot}%{_libdir}/%{pkg_name}
# Make native libs executable so that debuginfos get properly
@@ -489,24 +521,26 @@ popd
# Install systemd unit files
pushd distribution/target
-############################################################
-# Reinstate installation of thermostat-agent.service once
-# the following bug is resolved:
-# http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1460
-############################################################
- #sed -i 's/User=thermostat/User=root/g' thermostat-agent.service
- #sed -i 's/Group=thermostat/Group=root/g' thermostat-agent.service
- rm thermostat-agent.service
- cp -a *.service %{buildroot}%{_unitdir}/
+ sed -i 's/User=thermostat/User=root/g' thermostat-agent.service
+ sed -i 's/Group=thermostat/Group=root/g' thermostat-agent.service
+ # FIXME: install or not-to-install agent service running as root?
+ # Currently: Don't install.
+ cp -a thermostat-storage.service %{buildroot}%{_unitdir}/
popd
# Move the thermostat desktop file to /usr/share/applications
# This makes "thermostat gui" show up in gnome shell.
+sed -i 's#Exec=.*#Exec=%{thermostat_home}/bin/thermostat-local#g' distribution/target/%{pkg_name}.desktop
cp distribution/target/%{pkg_name}.desktop %{buildroot}%{_datarootdir}/applications/%{pkg_name}.desktop
# Install the SVG icon
cp %{SOURCE2} %{buildroot}%{_datarootdir}/icons/hicolor/scalable/apps/%{pkg_name}.svg
+# Install tmpfiles.d config file for /var/run/%{pkg_name}
+mkdir -p %{buildroot}%{system_tmpfilesdir}
+install -m 0644 distribution/target/tmpfiles.d/%{pkg_name}.conf %{buildroot}%{system_tmpfilesdir}/%{pkg_name}.conf
+
# move everything else into $THERMOSTAT_HOME
+rm -rf distribution/target/image/bin/%{pkg_name}.orig
cp -a distribution/target/image %{buildroot}%{thermostat_home}
# symlink dependencies into the right directory
@@ -523,12 +557,10 @@ ln -s %{system_javadir}/apache-commons-cli.jar %{buildroot}%{thermostat_home}/li
ln -s %{system_javadir}/apache-commons-collections.jar %{buildroot}%{thermostat_home}/libs/commons-collections.jar
ln -s %{system_javadir}/apache-commons-beanutils.jar %{buildroot}%{thermostat_home}/libs/commons-beanutils.jar
ln -s %{system_javadir}/apache-commons-logging.jar %{buildroot}%{thermostat_home}/libs/commons-logging.jar
-ln -s %{system_javadir}/apache-commons-io.jar %{buildroot}%{thermostat_home}/libs/commons-io.jar
ln -s %{system_javadir}/netty.jar %{buildroot}%{thermostat_home}/libs/netty.jar
ln -s %{system_javadir}/mongo.jar %{buildroot}%{thermostat_home}/libs/mongo.jar
ln -s %{system_javadir}/tomcat-servlet-api.jar %{buildroot}%{thermostat_home}/libs/javax-servlet.jar
# The following deps are packaged as part of the thermostat-scl
-ln -s %{scl_javadir}/apache-commons-fileupload.jar %{buildroot}%{thermostat_home}/libs/commons-fileupload.jar
ln -s %{scl_javadir}/jfreechart/jfreechart.jar %{buildroot}%{thermostat_home}/libs/jfreechart.jar
ln -s %{scl_javadir}/jcommon.jar %{buildroot}%{thermostat_home}/libs/jcommon.jar
ln -s %{scl_javadir}/jline2.jar %{buildroot}%{thermostat_home}/libs/jline2.jar
@@ -594,7 +626,6 @@ ln -s %{system_datadir} %{buildroot}%{thermostat_home}/data
ln -s %{system_statedir} %{buildroot}%{thermostat_home}/run
ln -s %{system_logdir} %{buildroot}%{thermostat_home}/logs
ln -s %{system_cachedir} %{buildroot}%{thermostat_home}/cache
-
#######################################################
# Thermostat web storage webapp
#######################################################
@@ -637,6 +668,10 @@ for i in $(find -name 'thermostat-*common*.jar' -o \
%{buildroot}%{thermostat_catalina_base}/webapps/%{pkg_name}/WEB-INF/lib
done
popd
+# Don't need thermostat-thread-client-common*.jar in webapp
+pushd %{buildroot}%{thermostat_catalina_base}/webapps/%{pkg_name}/WEB-INF/lib
+ rm thermostat-thread-client-common*.jar
+popd
# Symlink other dependencies
pushd %{buildroot}%{thermostat_catalina_base}/webapps/%{pkg_name}/WEB-INF/lib
ln -s %{system_javadir}/apache-commons-collections.jar
@@ -663,11 +698,6 @@ pushd %{buildroot}/%{thermostat_catalina_base}
done
popd
-# Fix .mfiles until xmvn officially supports SCLs.
-sed -i 's#%{buildroot}##' .mfiles
-sed -i 's#%{buildroot}##' .mfiles-javadoc
-sed -i 's#%{buildroot}##' .mfiles-webapp
-
%pre
# add the thermostat user and group
%{_sbindir}/groupadd -r thermostat 2>/dev/null || :
@@ -676,23 +706,11 @@ sed -i 's#%{buildroot}##' .mfiles-webapp
%post
# Install but don't activate
-############################################################
-# Reinstate installation of thermostat-agent.service once
-# the following bug is resolved:
-# http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1460
-############################################################
-#%systemd_post %{pkg_name}-agent.service
%systemd_post %{pkg_name}-storage.service
# Required for icon cache (i.e. Thermostat icon)
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%preun
-############################################################
-# Reinstate installation of thermostat-agent.service once
-# the following bug is resolved:
-# http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1460
-############################################################
-#%systemd_preun %{pkg_name}-agent.service
%systemd_preun %{pkg_name}-storage.service
%postun
@@ -701,12 +719,6 @@ if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor &> /dev/null
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
-############################################################
-# Reinstate installation of thermostat-agent.service once
-# the following bug is resolved:
-# http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1460
-############################################################
-#%systemd_postun %{pkg_name}-agent.service
%systemd_postun %{pkg_name}-storage.service
%posttrans
@@ -729,6 +741,7 @@ fi
%config(noreplace) %{_sysconfdir}/%{pkg_name}/logging.properties
%config(noreplace) %{_sysconfdir}/%{pkg_name}/osgi-export.properties
%config(noreplace) %{_sysconfdir}/%{pkg_name}/ssl.properties
+%config(noreplace) %{_sysconfdir}/%{pkg_name}/agent_proxy_jaas.conf
# Required for systemd services
%config(noreplace) %{system_confdir}/sysconfig/%{pkg_name}
# thermostat.desktop lives in /usr/share/applications
@@ -740,18 +753,16 @@ fi
%{_jnidir}/thermostat-*.jar
%{_bindir}/thermostat
%{_unitdir}/%{pkg_name}-storage.service
-############################################################
-# Reinstate installation of thermostat-agent.service once
-# the following bug is resolved:
-# http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1460
-############################################################
-#%{_unitdir}/%{pkg_name}-agent.service
+%{system_tmpfilesdir}/%{pkg_name}.conf
# To these directories get written to when thermostat storage/agent
# run as systemd services
%attr(0770,thermostat,thermostat) %dir %{system_datadir}
%attr(0770,thermostat,thermostat) %dir %{system_cachedir}
%attr(0770,thermostat,thermostat) %dir %{system_logdir}
%attr(0770,thermostat,thermostat) %dir %{system_statedir}
+# Agent-proxy installs into jni_dir, but we symlink to it in
+# java_dir. Own the symlink here.
+%{_javadir}/%{?scl_prefix}%{pkg_name}/thermostat-agent-proxy-server.jar
%files javadoc
%doc LICENSE
@@ -769,6 +780,10 @@ fi
%config(noreplace) %{system_confdir}/sysconfig/tomcat@%{pkg_name}
%changelog
+* 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.
+
* Tue Nov 05 2013 Severin Gehwolf <sgehwolf at redhat.com> - 0.15.0-1
- Update to latest upstream release.
- Use osgi-style R/BR in order to ensure that things work during
More information about the scm-commits
mailing list