[antlr-maven-plugin] Build with maven 3.

Alexander Kurtakov akurtakov at fedoraproject.org
Wed Mar 9 21:48:02 UTC 2011


commit de5e866428214bfc0b2c2217ff34731eb87fa429
Author: Alexander Kurtakov <akurtako at redhat.com>
Date:   Wed Mar 9 23:47:23 2011 +0200

    Build with maven 3.
    
    Use upstream sources.
    Adapt to current guidelines.

 .gitignore              |    1 +
 antlr-maven-plugin.spec |   51 ++++++++++++++++------------------------------
 sources                 |    2 +-
 3 files changed, 20 insertions(+), 34 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index cc7439f..23e504f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 /antlr-maven-plugin-20101012svn12849.tar.bz2
 /antlr-maven-plugin-2.2.tar.bz2
+antlr-maven-plugin-2.2-source-release.zip
diff --git a/antlr-maven-plugin.spec b/antlr-maven-plugin.spec
index 362d302..33d0f64 100644
--- a/antlr-maven-plugin.spec
+++ b/antlr-maven-plugin.spec
@@ -1,37 +1,28 @@
-%global svndate		20110307
-%global	svnver		13719
-%global svnstring	%{svndate}svn%{svnver}
-
 Name:			antlr-maven-plugin
 Version:		2.2
-Release:		1.%{svnstring}%{?dist}
+Release:		2%{?dist}
 Summary:		Maven plugin that generates files based on grammar file(s)
 License:		ASL 2.0
 URL:			http://mojo.codehaus.org/antlr-maven-plugin/
 Group:			Development/Libraries
-# No source tarball known.
-# Checked out from SVN
-# svn export https://svn.codehaus.org/mojo/tags/antlr-maven-plugin-2.2 antlr-maven-plugin
-# tar cfj antlr-maven-plugin-2.2.tar.bz2 antlr-maven-plugin
-Source0:		%{name}-%{version}.tar.bz2
+Source0:		http://repo1.maven.org/maven2/org/codehaus/mojo/%{name}/%{version}/%{name}-%{version}-source-release.zip
 # Modern modello expects to see <models></models>, even if there is only one. 
 Patch0:			maven-antlr-plugin-2.2-modello-issue.patch
 # Add maven-artifact to the pom.xml, we need it to build
 Patch1:			maven-antlr-plugin-2.1-artifact.patch
 # siteRenderer.createSink doesn't exist anymore
 Patch2:			maven-antlr-plugin-2.1-sinkfix.patch
-BuildRoot:		%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:		noarch
 BuildRequires:		java-devel
 BuildRequires:		jpackage-utils
 BuildRequires:		antlr
-BuildRequires:		maven2
-BuildRequires:		maven2-plugin-compiler
-BuildRequires:		maven2-plugin-install
-BuildRequires:		maven2-plugin-jar
-BuildRequires:		maven2-plugin-javadoc
-BuildRequires:		maven2-plugin-resources
-BuildRequires:		maven2-plugin-surefire
+BuildRequires:		maven
+BuildRequires:		maven-compiler-plugin
+BuildRequires:		maven-install-plugin
+BuildRequires:		maven-jar-plugin
+BuildRequires:		maven-javadoc-plugin
+BuildRequires:		maven-resources-plugin
+BuildRequires:		maven-surefire-plugin
 BuildRequires:		maven-antrun-plugin
 BuildRequires:		maven-clean-plugin
 BuildRequires:		maven-invoker-plugin
@@ -44,6 +35,7 @@ BuildRequires:		maven-plugin-cobertura
 BuildRequires:		apache-commons-exec
 BuildRequires:		maven2-common-poms
 Requires:		antlr
+Requires:       maven
 Requires:		jpackage-utils
 Requires:		java >= 1:1.6.0
 Requires(post):		jpackage-utils
@@ -66,7 +58,7 @@ Requires:		jpackage-utils
 This package contains the API documentation for %{name}.
 
 %prep
-%setup -q -n %{name}
+%setup -q 
 %patch0 -p1 -b .modello
 %patch1 -p1 -b .artifact
 %patch2 -p1 -b .sink
@@ -76,22 +68,13 @@ find -name '*.class' -exec rm -f '{}' \;
 find -name '*.jar' -exec rm -f '{}' \;
 
 %build
-export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
-mkdir -p $MAVEN_REPO_LOCAL
-
-# Tests seem unhappy, skipping them.
-mvn-jpp -Dmaven.test.skip=true \
--Dmaven.repo.local=$MAVEN_REPO_LOCAL \
+mvn-rpmbuild -Dmaven.test.skip=true \
 install javadoc:javadoc
 
 %install
-rm -rf %{buildroot}
 mkdir -p %{buildroot}%{_javadir}
 
-cp -p target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
-pushd %{buildroot}%{_javadir}
-ln -s %{name}-%{version}.jar %{name}.jar
-popd
+cp -p target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
 
 mkdir -p %{buildroot}%{_javadocdir}/%{name}
 cp -rp target/site/apidocs/ %{buildroot}%{_javadocdir}/%{name}
@@ -100,9 +83,6 @@ install -d -m 755 %{buildroot}%{_mavenpomdir}
 %add_to_maven_depmap org.codehaus.mojo %{name} %{version} JPP %{name}
 install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
 
-%clean
-rm -rf %{buildroot}
-
 %post
 %update_maven_depmap
 
@@ -120,6 +100,11 @@ rm -rf %{buildroot}
 %{_javadocdir}/%{name}
 
 %changelog
+* Wed Mar 9 2011 Alexander Kurtakov <akurtako at redhat.com> 2.2-2
+- Build with maven 3.
+- Use upstream sources.
+- Adapt to current guidelines.
+
 * Mon Mar  3 2011 Tom Callaway <spot at fedoraproject.org> 2.2-1.20110307svn13719
 - update to 2.2 tag
 
diff --git a/sources b/sources
index bb07f26..13473b7 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-2229ab165062b3c922653c6f1de893b9  antlr-maven-plugin-2.2.tar.bz2
+06fd9cafe19b4dcc3849be1045aca4a2  antlr-maven-plugin-2.2-source-release.zip


More information about the scm-commits mailing list