From 91ffb10eccc77c04550070297d75f7072ee1c1f9 Mon Sep 17 00:00:00 2001 From: Stanislav Ochotnicky Date: Fri, 3 Dec 2010 15:38:46 +0100 Subject: [PATCH] Initial version of the package --- .gitignore | 1 + 0001-Add-plexus-default-container-dep.patch | 27 ++ maven-script | 10 + maven.spec | 287 ++++++++++++++++++++ sources | 1 + 5 files changed, 326 insertions(+) create mode 100644 0001-Add-plexus-default-container-dep.patch create mode 100644 maven-script create mode 100644 maven.spec diff --git a/.gitignore b/.gitignore index e69de29..fe00e61 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/apache-maven-3.0-src.tar.gz diff --git a/0001-Add-plexus-default-container-dep.patch b/0001-Add-plexus-default-container-dep.patch new file mode 100644 index 0000000..82810b0 --- /dev/null +++ b/0001-Add-plexus-default-container-dep.patch @@ -0,0 +1,27 @@ +From 5a04c433c126ae0945bb4a18d708cfc7dc5df29e Mon Sep 17 00:00:00 2001 +From: Stanislav Ochotnicky +Date: Tue, 12 Oct 2010 16:56:50 +0200 +Subject: [PATCH 1/3] Add plexus-default-container dep + +--- + maven-plugin-api/pom.xml | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml +index 2e99b7b..cffc6d2 100644 +--- a/maven-plugin-api/pom.xml ++++ b/maven-plugin-api/pom.xml +@@ -51,6 +51,10 @@ under the License. + org.sonatype.sisu + sisu-inject-plexus + ++ ++ org.codehaus.plexus ++ plexus-container-default ++ + + + +-- +1.7.3.2 + diff --git a/maven-script b/maven-script new file mode 100644 index 0000000..83187d7 --- /dev/null +++ b/maven-script @@ -0,0 +1,10 @@ +#!/bin/sh +if [ -f /usr/share/java-utils/java-functions ] ; then + . /usr/share/java-utils/java-functions + set_jvm + set_javacmd +fi + +export M2_HOME=/usr/share/maven +echo $JAVA_HOME +export JAVA_HOME; $M2_HOME/bin/mvn $@ diff --git a/maven.spec b/maven.spec new file mode 100644 index 0000000..dc19f5a --- /dev/null +++ b/maven.spec @@ -0,0 +1,287 @@ + +Name: maven +Version: 3.0 +Release: 3%{?dist} +Summary: Java project management and project comprehension tool + +Group: Development/Tools +License: ASL 2.0 and MIT and BSD +URL: http://maven.apache.org/ +Source0: http://www.apache.org/dyn/closer.cgi/maven/source/apache-%{name}-%{version}-src.tar.gz + +# 2xx for created non-buildable sources +Source200: %{name}-script + +# Patch1XX could be upstreamed probably +# Patch15X are already upstream +Patch150: 0001-Add-plexus-default-container-dep.patch + +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) +BuildArch: noarch + +BuildRequires: maven2 +BuildRequires: maven-assembly-plugin +BuildRequires: maven-compiler-plugin +BuildRequires: maven-install-plugin +BuildRequires: maven-jar-plugin +BuildRequires: maven-javadoc-plugin +BuildRequires: maven-resources-plugin +BuildRequires: maven-site-plugin +BuildRequires: maven-surefire-plugin +BuildRequires: maven-surefire-provider-junit4 +BuildRequires: buildnumber-maven-plugin +BuildRequires: plexus-containers-component-metadata >= 1.5.4-4 +BuildRequires: plexus-containers-container-default +BuildRequires: animal-sniffer >= 1.6-5 +BuildRequires: mojo-parent +BuildRequires: atinject +BuildRequires: aether +BuildRequires: sisu +BuildRequires: google-guice +BuildRequires: hamcrest +BuildRequires: apache-commons-parent + +Requires: java >= 1:1.6.0 +Requires: plexus-classworlds +Requires: apache-commons-cli +Requires: guava +Requires: hamcrest +Requires: nekohtml +Requires: plexus-cipher +Requires: plexus-containers-component-annotations +Requires: plexus-containers-container-default +Requires: plexus-interpolation +Requires: plexus-sec-dispatcher +Requires: plexus-utils +Requires: xbean +Requires: xerces-j2 +Requires: maven-wagon +Requires: aether +Requires: sisu +Requires: google-guice +Requires: atinject +Requires: animal-sniffer >= 1.6-5 +Requires: mojo-parent +Requires: hamcrest +Requires: apache-commons-parent + + +Requires(post): jpackage-utils +Requires(postun): jpackage-utils + + +%description +Maven is a software project management and comprehension tool. Based on the +concept of a project object model (POM), Maven can manage a project's build, +reporting and documentation from a central piece of information. + +%package javadoc +Summary: API documentation for %{name} +Group: Documentation +Requires: jpackage-utils + +%description javadoc +%{summary}. + +%prep +%setup -q -n apache-%{name}-%{version} +%patch150 -p1 + +# not really used during build, but a precaution +rm maven-ant-tasks-*.jar + +# these fail only with patch 201. No idea why (since that is activated +# only with maven2.jpp.mode=true +rm maven-core/src/test/java/org/apache/maven/MavenLifecycleParticipantTest.java +rm maven-core/src/test/java/org/apache/maven/execution/ProjectSorterTest.java + +# fix line endings +sed -i 's:\r::' *.txt + +# fix for animal-sniffer (we don't generate 1.5 signatures) +sed -i 's:check-java-1.5-compat:check-java-1.6-compat:' pom.xml + +pushd apache-maven +rm src/bin/*bat +sed -i 's:\r::' src/conf/settings.xml + +# Update shell scripts to use unversioned classworlds +sed -i -e s:'-classpath "${M2_HOME}"/boot/plexus-classworlds-\*.jar':'-classpath "${M2_HOME}"/boot/plexus-classworlds.jar':g \ + src/bin/mvn* +popd + +%build +export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository +mkdir -p $MAVEN_REPO_LOCAL + +mvn-jpp -e \ + -Dmaven.repo.local=$MAVEN_REPO_LOCAL \ + install javadoc:aggregate + +mkdir m2home +(cd m2home +tar xvf ../apache-maven/target/*tar.gz +chmod -x apache-%{name}-%{version}/conf/settings.xml +) + + +%install +rm -rf $RPM_BUILD_ROOT + +export M2_HOME=$(pwd)/m2home/apache-maven-%{version} + +# maven2 directory in /usr/share/java +install -dm 755 $RPM_BUILD_ROOT%{_javadir}/%{name} + +# put global m2 config into /etc and symlink it later +install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir} +mv $M2_HOME/bin/m2.conf $RPM_BUILD_ROOT%{_sysconfdir}/ + +########### +# M2_HOME # +########### +install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{name} + +############### +# M2_HOME/bin # +############### +install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/bin +cp -a $M2_HOME/bin/* $RPM_BUILD_ROOT%{_datadir}/%{name}/bin + +ln -sf %{_sysconfdir}/m2.conf $RPM_BUILD_ROOT%{_datadir}/%{name}/bin/m2.conf + + +################ +# M2_HOME/boot # +################ +install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/boot + +# this dangling symlink will be filled in by Requires +(cd $RPM_BUILD_ROOT%{_datadir}/%{name}/boot + ln -sf `build-classpath plexus/classworlds` plexus-classworlds.jar +) + + +################ +# M2_HOME/conf # +################ +install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/conf +cp -a $M2_HOME/conf/* $RPM_BUILD_ROOT%{_datadir}/%{name}/conf/ + +############### +# M2_HOME/lib # +############### +install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/lib + +# jdom is needed for our custom resolving code only +(cd $RPM_BUILD_ROOT%{_datadir}/%{name}/lib + + build-jar-repository -s -p . aether/api aether/connector-wagon aether/impl aether/spi aether/util \ + commons-cli guava hamcrest/core nekohtml plexus/plexus-cipher \ + plexus/containers-component-annotations plexus/containers-container-default \ + plexus/interpolation plexus/plexus-sec-dispatcher plexus/utils \ + sisu/sisu-inject-bean sisu/sisu-inject-plexus maven-wagon/file \ + maven-wagon/http-lightweight maven-wagon/http-shared maven-wagon/provider-api \ + xbean/xbean-reflect xerces-j2 jdom +) + +################ +# M2_HOME/poms # +#*############## +install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/poms + +######################## +# /etc/maven/fragments # +######################## +install -dm 755 $RPM_BUILD_ROOT/%{_sysconfdir}/maven/fragments + +############################## +# /usr/share/java repository # +############################## +install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/repository +ln -s %{_javadir} $RPM_BUILD_ROOT%{_datadir}/%{name}/repository/JPP + +################## +# javadir/maven # +#*################ +install -dm 755 $RPM_BUILD_ROOT%{_javadir}/%{name} + +####################### +# javadir/maven/poms # +#*##################### +ln -s %{_datadir}/%{name}/poms $RPM_BUILD_ROOT%{_javadir}/%{name}/poms + +############ +# /usr/bin # +############ +install -dm 755 $RPM_BUILD_ROOT%{_bindir} + +# Wrappers +cp -af %{SOURCE200} $RPM_BUILD_ROOT%{_bindir}/mvn3 + +################### +# Individual jars # +################### + +for module in maven-aether-provider maven-artifact maven-compat \ + maven-core maven-embedder maven-model \ + maven-model-builder maven-plugin-api \ + maven-repository-metadata maven-settings \ + maven-settings-builder;do + + pushd $module + install -m 644 target/$module-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/ + ln -s $module-%version.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/$module.jar + ln -s %{_javadir}/%{name}/$module-%{version}.jar \ + $RPM_BUILD_ROOT%{_datadir}/%{name}/lib/$module-%{version}.jar + install -m 644 pom.xml $RPM_BUILD_ROOT%{_datadir}/%{name}/poms/JPP.%{name}-$module.pom + %add_to_maven_depmap org.apache.maven $module %{version} JPP/%{name} $module + popd +done + +# maven pom +install -m 644 pom.xml $RPM_BUILD_ROOT%{_datadir}/%{name}/poms/JPP.%{name}-maven.pom +%add_to_maven_depmap org.apache.maven maven %{version} JPP/%{name} maven + + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +%update_maven_depmap + +%postun +%update_maven_depmap + + +%files +%defattr(-,root,root,-) +%doc LICENSE.txt NOTICE.txt README.txt +%attr(0755,root,root) %{_bindir}/mvn3 +%dir %{_datadir}/%{name} +%dir %{_datadir}/%{name}/bin +%attr(0755,root,root) %{_datadir}/%{name}/bin/mvn +%attr(0755,root,root) %{_datadir}/%{name}/bin/mvnyjp +%attr(0755,root,root) %{_datadir}/%{name}/bin/mvnDebug +%{_datadir}/%{name}/bin/*.conf +%config(noreplace) %{_sysconfdir}/m2.conf +%{_datadir}/%{name}/boot +%{_datadir}/%{name}/conf +%{_datadir}/%{name}/lib +%{_datadir}/%{name}/poms +%{_datadir}/%{name}/repository +%config %{_mavendepmapfragdir}/%{name} +%{_javadir}/%{name} + + + +%changelog +* Wed Dec 1 2010 Stanislav Ochotnicky - 3.0-3 +- Remove maven-ant-tasks jar in prep +- Make fragment file as %%config + +* Tue Nov 16 2010 Stanislav Ochotnicky - 3.0-2 +- Added apache-commons-parent to BR after commons changes + +* Tue Oct 12 2010 Stanislav Ochotnicky - 3.0-1 +- Initial package with vanilla maven (no jpp mode yet) diff --git a/sources b/sources index e69de29..3dc133b 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +8daf3549934f12af31de5325b5f3b136 apache-maven-3.0-src.tar.gz