[thermostat/f19] More pom macro fixes.
jerboaa
jerboaa at fedoraproject.org
Thu May 16 16:58:01 UTC 2013
commit 65ad25418288d31587d155979f8e7d4742f1f2f0
Author: Severin Gehwolf <sgehwolf at redhat.com>
Date: Thu May 16 18:56:37 2013 +0200
More pom macro fixes.
Also some first experiments with new-style packaging.
thermostat.spec | 57 ++++++++++++++++++++++++++++++++----------------------
1 files changed, 34 insertions(+), 23 deletions(-)
---
diff --git a/thermostat.spec b/thermostat.spec
index 77fdff9..ea8cf4a 100644
--- a/thermostat.spec
+++ b/thermostat.spec
@@ -1,13 +1,11 @@
# Uncomment to build from snapshot out of hg. See also Release and Source0
#%global hgrev d6145521e208
-# Set to true for mvn-rpmbuild resolver debug output
-%global maven_debug_flag true
Name: thermostat
Version: 0.6.0
# If building from snapshot out of hg, uncomment and adjust below value as appropriate
#Release: 0.28.20121123hg%{hgrev}%{?dist}
-Release: 13%{?dist}
+Release: 14%{?dist}
Summary: A monitoring and serviceability tool for OpenJDK
License: GPLv2+ with exceptions
URL: http://icedtea.classpath.org/thermostat/
@@ -154,9 +152,14 @@ tomcat's webapps directory.
# httpclient
%pom_remove_dep org.apache.httpcomponents:httpclient-osgi web/client
%pom_add_dep org.apache.httpcomponents:httpclient:4.1.2 web/client
+# add httpmime dep. this is included in upstreams' strange jar
+%pom_add_dep org.apache.httpcomponents:httpmime:4.1.2 web/client
# httpcore
%pom_remove_dep org.apache.httpcomponents:httpcore-osgi web/client
%pom_add_dep org.apache.httpcomponents:httpcore:4.1.2 web/client
+# need jline 2.10 (otherwise this resolves to jline 1)
+%pom_xpath_remove "pom:properties/pom:jline.version"
+%pom_xpath_inject "pom:properties" "<jline.version>2.10</jline.version>"
# Don't use maven-exec-plugin. We do things manually in order to avoid this
# additional dep. It's used in agent/core/pom.xml and in keyring/pom.xml
@@ -205,13 +208,17 @@ javac -d target/classes src/main/java/com/redhat/thermostat/utils/hostname/HostN
make all
popd
-# Build the rest :)
-mvn-rpmbuild \
- -Dmaven.test.skip=true \
- -Dthermostat.home=%{_datarootdir}/%{name} \
- -Dmaven.local.debug=%{maven_debug_flag} \
- -Dthermostat.web.deploy.dir=$(pwd)/webstorage-webapp \
- install javadoc:aggregate
+# This is roughly equivalent to:
+# mvn
+# -Dthermostat.home=%{_datarootdir}/%{name} \
+# -Dmaven.local.debug=%{maven_debug_flag} \
+# -Dthermostat.web.deploy.dir=$(pwd)/webstorage-webapp \
+# package javadoc:aggregate
+%mvn_config properties/thermostat.home %{_datarootdir}/%{name}
+# We need to skip installation of artifacts since it does not recognize the war packaging
+# type yet. This leaves us without many of the goodies that would provide.
+# See https://bugzilla.redhat.com/show_bug.cgi?id=963838
+%mvn_build -f -i
# the build puts all depdency jars into distribution/target/lib as well
mv distribution/target/libs/thermostat-*jar .
@@ -228,10 +235,14 @@ rm -rf distribution/target/thermostat-distribution-*.jar
# clean-up webapp. these are all symlinks to libs in /usr/share/thermostat
# except for thermostat-web-server
-rm -rf webstorage-webapp/WEB-INF/lib/*
-mv distribution/target/libs/thermostat-web-server*.jar webstorage-webapp/WEB-INF/lib
+pushd web/war/target
+WEB_WAR_DIR=$(pwd)/$(find -name 'thermostat-web-war*' -type d)
+rm -rf ${WEB_WAR_DIR}/WEB-INF/lib/*
+popd
+mv distribution/target/libs/thermostat-web-server*.jar ${WEB_WAR_DIR}/WEB-INF/lib
%install
+%mvn_install
#######################################################
# Thermostat core
#######################################################
@@ -338,25 +349,20 @@ mv %{buildroot}%{_datarootdir}/%{name}/etc/ssl.properties \
ln -s %{_sysconfdir}/%{name}/ssl.properties \
%{buildroot}%{_datarootdir}/%{name}/etc/ssl.properties
-
-#######################################################
-# Thermostat java docs
-#######################################################
-
-mkdir -p %{buildroot}%{_javadocdir}/%{name}
-cp -a target/site/apidocs %{buildroot}%{_javadocdir}/%{name}
-
#######################################################
# Thermostat web storage webapp
#######################################################
+pushd web/war/target
+WEB_WAR_DIR=$(pwd)/$(find -name 'thermostat-web-war*' -type d)
mkdir -p %{buildroot}%{_datadir}/tomcat/webapps
# Fixup THERMOSTAT_HOME in web.xml
sed -i '/<param-name>THERMOSTAT_HOME<[/]param-name>/,/<param-value>.*<[/]param-value>/{ s$<param-value>.*</param-value>$<param-value>%{_datadir}/%{name}</param-value>$ }' \
- webstorage-webapp/WEB-INF/web.xml
+ ${WEB_WAR_DIR}/WEB-INF/web.xml
# Fixup 'pathname' to thermostat-users.xml file in context.xml
sed -i '/Realm className="org.apache.catalina.realm.MemoryRealm"/,/pathname=".*"/{ s|pathname=".*\(WEB-INF/thermostat-users.xml\)"|pathname="%{_datadir}/tomcat/webapps/%{name}/\1"| }' \
- webstorage-webapp/META-INF/context.xml
-cp -r webstorage-webapp %{buildroot}%{_datadir}/tomcat/webapps/%{name}
+ ${WEB_WAR_DIR}/META-INF/context.xml
+cp -r ${WEB_WAR_DIR} %{buildroot}%{_datadir}/tomcat/webapps/%{name}
+popd
# Symlink core libs
pushd %{buildroot}%{_datarootdir}/%{name}/libs
@@ -400,6 +406,11 @@ popd
%{_datadir}/tomcat/webapps/%{name}
%changelog
+* Thu May 16 2013 Severin Gehwolf <sgehwolf at redhat.com> 0.6.0-14
+- More fixes using pom macros.
+- Experiment with new-style packaging. Hit a road-block. Need a
+ web archive installer which xmvn doesn't support :(
+
* Thu May 16 2013 Severin Gehwolf <sgehwolf at redhat.com> 0.6.0-13
- Remove one more patch which can be replaced by pom macros.
More information about the scm-commits
mailing list