msrb pushed to jenkins-matrix-project-plugin (master). "Migrate to .hpi with symlinks"
notifications at fedoraproject.org
notifications at fedoraproject.org
Thu Apr 16 07:33:52 UTC 2015
>From b10fa44f1eee48c907a5d896471b523774a49077 Mon Sep 17 00:00:00 2001
From: Michal Srb <msrb at redhat.com>
Date: Thu, 16 Apr 2015 09:33:07 +0200
Subject: Migrate to .hpi with symlinks
diff --git a/jenkins-matrix-project-plugin.spec b/jenkins-matrix-project-plugin.spec
index 11648d8..ecdde93 100644
--- a/jenkins-matrix-project-plugin.spec
+++ b/jenkins-matrix-project-plugin.spec
@@ -1,10 +1,10 @@
%global mod_name matrix-project-plugin
%global short_name matrix-project
-%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.1
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Jenkins Matrix Project Plugin
# License is specified in pom.xml
@@ -38,8 +38,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}
# TODO: this should be pulled in from somewhere else
%pom_add_dep org.jenkins-ci.plugins:junit:1.1
@@ -51,13 +50,18 @@ cp %{SOURCE1} .
%mvn_build -f -- -DdisabledTestDepPluginsResolution=true -Dmaven-hpi-plugin.disabledTestInjection=true
%install
-# unpack hpi file to 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.4.1-2
+- Migrate to .hpi with symlinks
+
* Tue Mar 31 2015 Michal Srb <msrb at redhat.com> - 1.4.1-1
- Update to upstream version 1.4.1
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/jenkins-matrix-project-plugin.git/commit/?h=master&id=b10fa44f1eee48c907a5d896471b523774a49077
More information about the scm-commits
mailing list