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

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


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


diff --git a/jenkins-mailer-plugin.spec b/jenkins-mailer-plugin.spec
index de97bac..8a2cc18 100644
--- a/jenkins-mailer-plugin.spec
+++ b/jenkins-mailer-plugin.spec
@@ -1,10 +1,10 @@
 %global mod_name mailer-plugin
 %global short_name mailer
-%global plugin_home %{_datadir}/jenkins/webroot/WEB-INF/plugins/%{short_name}.jpi
+%global plugin_home %{_datadir}/jenkins/webroot/WEB-INF/plugins/
 
 Name:           jenkins-mailer-plugin
 Version:        1.15
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Jenkins Mailer Plugin
 
 # License is specified in pom.xml
@@ -44,21 +44,25 @@ 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
 # missing test dep org.jvnet.mock-javamail:mock-javamail
 %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}
@@ -68,6 +72,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.15-2
+- Migrate to .hpi with symlinks
+
 * Mon Feb 09 2015 Michal Srb <msrb at redhat.com> - 1.15-1
 - Update to upstream version 1.15
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/jenkins-mailer-plugin.git/commit/?h=master&id=71dc10b8f954f0c5a6eaadfc8af3f40abbb94cb9


More information about the scm-commits mailing list