msrb pushed to jenkins-ant-plugin (master). "Migrate to .hpi with symlinks"
notifications at fedoraproject.org
notifications at fedoraproject.org
Thu Apr 16 07:08:41 UTC 2015
>From 8a6ada4bb5f840fa66d5e5e250a085770b1ef49a Mon Sep 17 00:00:00 2001
From: Michal Srb <msrb at redhat.com>
Date: Thu, 16 Apr 2015 09:06:51 +0200
Subject: Migrate to .hpi with symlinks
diff --git a/jenkins-ant-plugin.spec b/jenkins-ant-plugin.spec
index f91d004..586bc03 100644
--- a/jenkins-ant-plugin.spec
+++ b/jenkins-ant-plugin.spec
@@ -1,10 +1,10 @@
%global mod_name ant-plugin
%global short_name ant
-%global plugin_home %{_datadir}/jenkins/webroot/WEB-INF/plugins/%{short_name}.jpi
+%global plugin_home %{_datadir}/jenkins/webroot/WEB-INF/plugins/
Name: jenkins-ant-plugin
Version: 1.2
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Jenkins Ant Plugin
# License is specified in pom.xml
@@ -39,8 +39,7 @@ This package contains the API documentation 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 com.gargoylesoftware.htmlunit.html does not exist"
@@ -48,13 +47,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}
@@ -65,6 +69,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.2-4
+- Migrate to .hpi with symlinks
+
* Tue Nov 18 2014 Michal Srb <msrb at redhat.com> - 1.2-3
- Rebuild to fix plugin dependencies
- Fix FTBFS
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/jenkins-ant-plugin.git/commit/?h=master&id=8a6ada4bb5f840fa66d5e5e250a085770b1ef49a
More information about the scm-commits
mailing list