msrb pushed to jenkins-external-monitor-job-plugin (master). "Migrate to .hpi with symlinks"

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


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


diff --git a/jenkins-external-monitor-job-plugin.spec b/jenkins-external-monitor-job-plugin.spec
index f1a6dab..6c457e7 100644
--- a/jenkins-external-monitor-job-plugin.spec
+++ b/jenkins-external-monitor-job-plugin.spec
@@ -1,10 +1,10 @@
 %global mod_name external-monitor-job-plugin
 %global short_name external-monitor-job
-%global plugin_home %{_datadir}/jenkins/webroot/WEB-INF/plugins/%{short_name}.jpi
+%global plugin_home %{_datadir}/jenkins/webroot/WEB-INF/plugins/
 
 Name:           jenkins-%{mod_name}
 Version:        1.4
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Jenkins External Monitor Job Plugin
 
 # License is specified in pom.xml
@@ -40,8 +40,7 @@ for %{name}.
 %patch0 -p1
 
 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: "package org.jvnet.hudson.test does not exist"
@@ -49,13 +48,18 @@ cp %{SOURCE1} .
 %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/*
-
+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}
@@ -66,6 +70,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.4-2
+- Migrate to .hpi with symlinks
+
 * Fri Nov 21 2014 Michal Srb <msrb at redhat.com> - 1.4-1
 - Update to upstream version 1.4
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/jenkins-external-monitor-job-plugin.git/commit/?h=master&id=0caf4ed3256e3163f3759d2cbd70f786bacbb987


More information about the scm-commits mailing list