From d46893ec60052374063d6a4a5a3e1f67091cd24e Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Wed, 17 Apr 2013 18:54:37 +0200 Subject: [PATCH 1/3] Update plexus-containers-container-default JAR location --- xmvn.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xmvn.spec b/xmvn.spec index c648769..9505be5 100644 --- a/xmvn.spec +++ b/xmvn.spec @@ -1,6 +1,6 @@ Name: xmvn Version: 0.4.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Local Extensions for Apache Maven License: ASL 2.0 URL: http://mizdebsk.fedorapeople.org/xmvn @@ -63,7 +63,7 @@ ln -sf %{_datadir}/maven/boot %{buildroot}%{_datadir}/%{name}/boot ln -sf %{_datadir}/maven/lib %{buildroot}%{_datadir}/%{name}/lib/maven # /usr/bin/xmvn-resolve script -%jpackage_script org.fedoraproject.maven.tools.resolver.ResolverCli "" "" %{name}/%{name}-core:%{name}/%{name}-resolve:beust-jcommander:xml-commons-apis:plexus/containers-container-default:plexus/classworlds:plexus/utils:xbean/xbean-reflect:guava %{name}-resolve true +%jpackage_script org.fedoraproject.maven.tools.resolver.ResolverCli "" "" %{name}/%{name}-core:%{name}/%{name}-resolve:beust-jcommander:xml-commons-apis:plexus-containers/plexus-container-default:plexus/classworlds:plexus/utils:xbean/xbean-reflect:guava %{name}-resolve true # /usr/bin/xmvn script cat <%{buildroot}%{_bindir}/%{name} @@ -83,6 +83,9 @@ EOF %doc LICENSE NOTICE %changelog +* Wed Apr 17 2013 Mikolaj Izdebski - 0.4.2-2 +- Update plexus-containers-container-default JAR location + * Tue Apr 9 2013 Mikolaj Izdebski - 0.4.2-1 - Update to upstream version 0.4.2 From 47df11f28c693c7c551bab421860fb393c7450a2 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 17 May 2013 07:24:33 +0200 Subject: [PATCH 2/3] Add patch: install MOJO fix --- 0001-Install-MOJO-fix.patch | 27 +++++++++++++++++++++++++++ xmvn.spec | 9 ++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0001-Install-MOJO-fix.patch diff --git a/0001-Install-MOJO-fix.patch b/0001-Install-MOJO-fix.patch new file mode 100644 index 0000000..35528ba --- /dev/null +++ b/0001-Install-MOJO-fix.patch @@ -0,0 +1,27 @@ +From bd88b6fbba3b251ea9b7a47488377e95e3004ab3 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Fri, 17 May 2013 07:19:54 +0200 +Subject: [PATCH] Install MOJO fix + +Don't attempt to install packages whict are not installable. +--- + .../java/org/fedoraproject/maven/rpminstall/plugin/InstallMojo.java | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/xmvn-mojo/src/main/java/org/fedoraproject/maven/rpminstall/plugin/InstallMojo.java b/xmvn-mojo/src/main/java/org/fedoraproject/maven/rpminstall/plugin/InstallMojo.java +index 0047366..39e11d5 100644 +--- a/xmvn-mojo/src/main/java/org/fedoraproject/maven/rpminstall/plugin/InstallMojo.java ++++ b/xmvn-mojo/src/main/java/org/fedoraproject/maven/rpminstall/plugin/InstallMojo.java +@@ -137,7 +137,8 @@ public class InstallMojo + packages.put( packageName, pkg ); + } + +- installProject( project, pkg, rule ); ++ if ( pkg.isInstallable() ) ++ installProject( project, pkg, rule ); + } + + Path installRoot = Paths.get( settings.getInstallRoot() ); +-- +1.8.1.4 + diff --git a/xmvn.spec b/xmvn.spec index 9505be5..1493bb1 100644 --- a/xmvn.spec +++ b/xmvn.spec @@ -1,12 +1,15 @@ Name: xmvn Version: 0.4.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Local Extensions for Apache Maven License: ASL 2.0 URL: http://mizdebsk.fedorapeople.org/xmvn BuildArch: noarch Source0: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.xz Source1: %{name}-classworlds.conf +# Backported upstream fix, will be available in 0.5.0 +# https://github.com/mizdebsk/xmvn/commit/76f2d25c2b6ca4233bda9f5f9c8c8120d3164086 +Patch0001: 0001-Install-MOJO-fix.patch BuildRequires: maven-local BuildRequires: beust-jcommander @@ -41,6 +44,7 @@ This package provides %{summary}. %prep %setup -q +%patch0001 -p1 # Add cglib test dependency as a workaround for rhbz#911365 %pom_xpath_inject pom:project "" %pom_add_dep cglib:cglib::test @@ -83,6 +87,9 @@ EOF %doc LICENSE NOTICE %changelog +* Fri May 17 2013 Mikolaj Izdebski - 0.4.2-3 +- Add patch: install MOJO fix + * Wed Apr 17 2013 Mikolaj Izdebski - 0.4.2-2 - Update plexus-containers-container-default JAR location From 7685bd45d7f87ff24551bdf6840a63914e0f77a0 Mon Sep 17 00:00:00 2001 From: Stanislav Ochotnicky Date: Fri, 24 May 2013 10:25:51 +0200 Subject: [PATCH 3/3] Update to upstream version 0.5.0 --- .gitignore | 1 + 0001-Install-MOJO-fix.patch | 27 ------------- sources | 2 +- xmvn-classworlds.conf | 7 ---- xmvn.spec | 76 ++++++++++++++++++++++++++++--------- 5 files changed, 61 insertions(+), 52 deletions(-) delete mode 100644 0001-Install-MOJO-fix.patch delete mode 100644 xmvn-classworlds.conf diff --git a/.gitignore b/.gitignore index d670c4e..61b7308 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ /xmvn-0.4.0.tar.xz /xmvn-0.4.1.tar.xz /xmvn-0.4.2.tar.xz +/xmvn-0.5.0.tar.xz diff --git a/0001-Install-MOJO-fix.patch b/0001-Install-MOJO-fix.patch deleted file mode 100644 index 35528ba..0000000 --- a/0001-Install-MOJO-fix.patch +++ /dev/null @@ -1,27 +0,0 @@ -From bd88b6fbba3b251ea9b7a47488377e95e3004ab3 Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Fri, 17 May 2013 07:19:54 +0200 -Subject: [PATCH] Install MOJO fix - -Don't attempt to install packages whict are not installable. ---- - .../java/org/fedoraproject/maven/rpminstall/plugin/InstallMojo.java | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/xmvn-mojo/src/main/java/org/fedoraproject/maven/rpminstall/plugin/InstallMojo.java b/xmvn-mojo/src/main/java/org/fedoraproject/maven/rpminstall/plugin/InstallMojo.java -index 0047366..39e11d5 100644 ---- a/xmvn-mojo/src/main/java/org/fedoraproject/maven/rpminstall/plugin/InstallMojo.java -+++ b/xmvn-mojo/src/main/java/org/fedoraproject/maven/rpminstall/plugin/InstallMojo.java -@@ -137,7 +137,8 @@ public class InstallMojo - packages.put( packageName, pkg ); - } - -- installProject( project, pkg, rule ); -+ if ( pkg.isInstallable() ) -+ installProject( project, pkg, rule ); - } - - Path installRoot = Paths.get( settings.getInstallRoot() ); --- -1.8.1.4 - diff --git a/sources b/sources index 0a2f6e0..9e34fe0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ab84b57e1f85485dc2d4f266d45518fc xmvn-0.4.2.tar.xz +faabdb9e0aac0de78ae92ca810b8f2b9 xmvn-0.5.0.tar.xz diff --git a/xmvn-classworlds.conf b/xmvn-classworlds.conf deleted file mode 100644 index 3b899b1..0000000 --- a/xmvn-classworlds.conf +++ /dev/null @@ -1,7 +0,0 @@ -main is org.fedoraproject.maven.connector.Main from plexus.core - -[plexus.core] -optionally ${maven.home}/lib/ext/*.jar -load ${maven.home}/lib/*.jar -optionally ${maven.home}/lib/maven/ext/*.jar -load ${maven.home}/lib/maven/*.jar diff --git a/xmvn.spec b/xmvn.spec index 1493bb1..cb3cd79 100644 --- a/xmvn.spec +++ b/xmvn.spec @@ -1,15 +1,11 @@ Name: xmvn -Version: 0.4.2 -Release: 3%{?dist} +Version: 0.5.0 +Release: 1%{?dist} Summary: Local Extensions for Apache Maven License: ASL 2.0 URL: http://mizdebsk.fedorapeople.org/xmvn BuildArch: noarch Source0: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.xz -Source1: %{name}-classworlds.conf -# Backported upstream fix, will be available in 0.5.0 -# https://github.com/mizdebsk/xmvn/commit/76f2d25c2b6ca4233bda9f5f9c8c8120d3164086 -Patch0001: 0001-Install-MOJO-fix.patch BuildRequires: maven-local BuildRequires: beust-jcommander @@ -20,6 +16,7 @@ BuildRequires: plexus-containers-container-default BuildRequires: plexus-utils BuildRequires: xbean BuildRequires: xml-commons-apis +BuildRequires: maven-dependency-plugin Requires: maven Requires: beust-jcommander @@ -44,30 +41,63 @@ This package provides %{summary}. %prep %setup -q -%patch0001 -p1 # Add cglib test dependency as a workaround for rhbz#911365 -%pom_xpath_inject pom:project "" -%pom_add_dep cglib:cglib::test +%pom_add_dep cglib:cglib::test %{name}-core + + +# remove dependency plugin, we provide apache-maven by symlink +%pom_remove_plugin :maven-dependency-plugin +# get mavenVersion that is expected +mver=$(sed -n '//{s/.*>\(.*\)<.*/\1/;p}' \ + xmvn-parent/pom.xml) +mkdir -p target/dependency/ +ln -s %{_datadir}/maven target/dependency/apache-maven-$mver %build %mvn_file ":{xmvn-{core,connector}}" %{name}/@1 %{_datadir}/%{name}/lib/@1 %mvn_build -X +# let's use generated tarball to copy directory structure +# workaround for plexus-archiver bug +# https://github.com/sonatype/plexus-archiver/pull/9 +sed -i '1s:^BZBZ:BZ:' target/*tar.bz2 +tar --delay-directory-restore -xvf target/*tar.bz2 +chmod -R +rwX %{name}-%{version}* + + %install %mvn_install -install -d -m 755 %{buildroot}%{_datadir}/%{name}/bin -install -d -m 755 %{buildroot}%{_datadir}/%{name}/lib/ext -install -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/%{name}/bin/m2.conf +cp -r %{name}-%version/* %{buildroot}%{_datadir}/%{name}/ ln -sf %{_datadir}/maven/bin/mvn %{buildroot}%{_datadir}/%{name}/bin/mvn ln -sf %{_datadir}/maven/bin/mvnDebug %{buildroot}%{_datadir}/%{name}/bin/mvnDebug ln -sf %{_datadir}/maven/bin/mvnyjp %{buildroot}%{_datadir}/%{name}/bin/mvnyjp -ln -sf %{_datadir}/maven/conf %{buildroot}%{_datadir}/%{name}/conf -ln -sf %{_datadir}/maven/boot %{buildroot}%{_datadir}/%{name}/boot -ln -sf %{_datadir}/maven/lib %{buildroot}%{_datadir}/%{name}/lib/maven -# /usr/bin/xmvn-resolve script -%jpackage_script org.fedoraproject.maven.tools.resolver.ResolverCli "" "" %{name}/%{name}-core:%{name}/%{name}-resolve:beust-jcommander:xml-commons-apis:plexus-containers/plexus-container-default:plexus/classworlds:plexus/utils:xbean/xbean-reflect:guava %{name}-resolve true + + +# helper scripts +install -d -m 755 %{buildroot}%{_bindir} +install -m 755 xmvn-tools/src/main/bin/tool-script \ + %{buildroot}%{_datadir}/%{name}/bin/ + +for tool in subst resolve bisect;do + rm %{buildroot}%{_datadir}/%{name}/bin/%{name}-$tool + ln -s tool-script \ + %{buildroot}%{_datadir}/%{name}/bin/%{name}-$tool + + cat <%{buildroot}%{_bindir}/%{name}-$tool +#!/bin/sh -e +exec %{_datadir}/%{name}/bin/%{name}-$tool "\${@}" +EOF + chmod +x %{buildroot}%{_bindir}/%{name}-$tool +done + +# copy over maven lib directory +cp -r %{_datadir}/maven/lib/* %{buildroot}%{_datadir}/%{name}/lib/ + +# possibly recreate symlinks that can be automated with xmvn-subst +%{buildroot}%{_datadir}/%{name}/bin/%{name}-subst \ + %{buildroot}%{_datadir}/%{name}/ # /usr/bin/xmvn script cat <%{buildroot}%{_bindir}/%{name} @@ -76,6 +106,15 @@ export M2_HOME="\${M2_HOME:-%{_datadir}/%{name}}" exec mvn "\${@}" EOF +# make sure our conf is identical to maven so yum won't freak out +cp -P %{_datadir}/maven/conf/settings.xml %{buildroot}%{_datadir}/%{name}/conf/ + +%pre +# we are changing symlink to dir, workaround RPM issues +for dir in conf boot;do +[ $1 -eq 1 ] && [ -L %{_datadir}/%{name}/$dir ] && \ +rm -f %{_datadir}/%{name}/$dir || : +done %files -f .mfiles %doc LICENSE NOTICE @@ -87,6 +126,9 @@ EOF %doc LICENSE NOTICE %changelog +* Fri May 24 2013 Stanislav Ochotnicky - 0.5.0-1 +- Update to upstream version 0.5.0 + * Fri May 17 2013 Mikolaj Izdebski - 0.4.2-3 - Add patch: install MOJO fix