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

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


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


diff --git a/jenkins-junit-plugin.spec b/jenkins-junit-plugin.spec
index 3541182..f3c0ac5 100644
--- a/jenkins-junit-plugin.spec
+++ b/jenkins-junit-plugin.spec
@@ -1,10 +1,10 @@
 %global mod_name junit-plugin
 %global short_name junit
-%global plugin_home %{_datadir}/jenkins/webroot/WEB-INF/plugins/%{short_name}.jpi
+%global plugin_home %{_datadir}/jenkins/webroot/WEB-INF/plugins/
 
 Name:           jenkins-junit-plugin
 Version:        1.4
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Jenkins JUnit Plugin
 
 # License is specified in pom.xml
@@ -35,8 +35,7 @@ This package contains the API documentation for %{name}.
 %setup -q -n %{mod_name}-%{short_name}-%{version}
 
 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 have special needs:
@@ -45,13 +44,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}
@@ -62,6 +66,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
+
 * Mon Feb 09 2015 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-junit-plugin.git/commit/?h=master&id=6779491bb84d33a9c0af650dbf157add4a371d73


More information about the scm-commits mailing list