msrb pushed to jenkins-ssh-slaves-plugin (master). "Migrate to .hpi with symlinks"

notifications at fedoraproject.org notifications at fedoraproject.org
Thu Apr 16 07:58:03 UTC 2015


>From c285e3ea3deaca651f7f33ba231690a1aab9302b Mon Sep 17 00:00:00 2001
From: Michal Srb <msrb at redhat.com>
Date: Thu, 16 Apr 2015 09:56:48 +0200
Subject: Migrate to .hpi with symlinks


diff --git a/jenkins-ssh-slaves-plugin.spec b/jenkins-ssh-slaves-plugin.spec
index 7de4718..5122076 100644
--- a/jenkins-ssh-slaves-plugin.spec
+++ b/jenkins-ssh-slaves-plugin.spec
@@ -1,10 +1,10 @@
 %global mod_name ssh-slaves-plugin
 %global short_name ssh-slaves
-%global plugin_home %{_datadir}/jenkins/webroot/WEB-INF/plugins/%{short_name}.jpi
+%global plugin_home %{_datadir}/jenkins/webroot/WEB-INF/plugins/
 
 Name:           jenkins-ssh-slaves-plugin
 Version:        1.9
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Jenkins SSH Slaves Plugin
 
 License:        MIT
@@ -39,22 +39,25 @@ This package contains the API documentation for %{name}.
 
 cp %{SOURCE1} .
 
-%mvn_package ::hpi: __noinstall
-%mvn_file ::jar:: %{name}/%{short_name} %{plugin_home}/WEB-INF/lib/%{short_name}
+%mvn_file ::hpi:: %{name}/%{short_name}
 
 %build
 # tests are disabled because of missing dep (org.jenkins-ci.main:jenkins-test-harness)
 %mvn_build -f
 
 %install
-# unpack hpi file into the correct location
 install -d -m 755 %{buildroot}/%{plugin_home}
-unzip -d %{buildroot}/%{plugin_home} target/%{short_name}.hpi
-rm %{buildroot}/%{plugin_home}/WEB-INF/lib/%{short_name}.jar
-xmvn-subst %{buildroot}/%{plugin_home}/WEB-INF/lib/
-
+unzip -d target/%{short_name}.hpi-unpacked target/%{short_name}.hpi
+pushd target/%{short_name}.hpi-unpacked/WEB-INF/lib/
+  rm %{short_name}.jar && ln -s %{_javadir}/%{name}/%{short_name}.jar .
+  xmvn-subst -s .
+popd
+pushd target/%{short_name}.hpi-unpacked/
+  zip -y -r %{short_name}.hpi .
+popd
+mv target/%{short_name}.hpi-unpacked/%{short_name}.hpi target/
+cp target/%{short_name}.hpi %{buildroot}/%{plugin_home}/
 %mvn_install
-sed -i 's|%{plugin_home}/WEB-INF/lib/%{short_name}.jar||' .mfiles
 
 %files -f .mfiles
 %dir %{_javadir}/%{name}
@@ -65,6 +68,9 @@ sed -i 's|%{plugin_home}/WEB-INF/lib/%{short_name}.jar||' .mfiles
 %doc LICENSE.txt
 
 %changelog
+* Thu Apr 16 2015 Michal Srb <msrb at redhat.com> - 1.9-4
+- Migrate to .hpi with symlinks
+
 * Tue Apr 14 2015 Michal Srb <msrb at redhat.com> - 1.9-3
 - Rebuild
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/jenkins-ssh-slaves-plugin.git/commit/?h=master&id=c285e3ea3deaca651f7f33ba231690a1aab9302b


More information about the scm-commits mailing list