Name: tesla-polyglot Version: 0.1.0 Release: 2%{?dist} Summary: Modules to enable Maven usage in other JVM languages License: EPL URL: https://github.com/takari/maven-polyglot Source0: https://github.com/takari/maven-polyglot/archive/%{name}-%{version}.tar.gz Source1: eclipse-1.0.txt # Force clojure-compat usage Source2: %{name}-0.1.0-depmap # Compile source code with groovy ant task Patch0: %{name}-0.1.0-antrun-plugin.patch # clojure-maven-plugin dont work with clojure 1.5.1 # BuildRequires: mvn(org.clojure:clojure) BuildRequires: clojure-compat BuildRequires: mvn(com.theoryinpractise:clojure-maven-plugin) BuildRequires: mvn(commons-logging:commons-logging) BuildRequires: mvn(org.apache.maven:maven-embedder) BuildRequires: mvn(org.apache.maven:maven-model-builder) BuildRequires: mvn(org.apache.maven:maven-plugin-api) BuildRequires: mvn(org.codehaus.groovy:groovy) BuildRequires: mvn(org.codehaus.plexus:plexus-component-metadata) # BuildRequires: mvn(org.eclipse.sisu:org.eclipse.sisu.inject.tests) BuildRequires: mvn(org.apache.santuario:xmlsec) BuildRequires: maven-local BuildRequires: maven-antrun-plugin BuildRequires: maven-plugin-plugin # groovy deps BuildRequires: mvn(antlr:antlr) BuildRequires: mvn(asm:asm-all) BuildRequires: mvn(commons-cli:commons-cli) BuildRequires: mvn(org.apache.ant:ant) BuildRequires: mvn(org.slf4j:slf4j-nop) BuildRequires: mvn(org.apache.ant:ant-junit) %if 0 # Ruby module BuildRequires: mvn(org.jruby:jruby) BuildRequires: mvn(rubygems:maven-tools) # https://bugzilla.redhat.com/show_bug.cgi?id=859711 BuildRequires: mvn(de.saumya.mojo:gem-maven-plugin) # Scala module BuildRequires: mvn(com.twitter:util-core_2.10:6.3.8) BuildRequires: mvn(com.twitter:util-eval_2.10:6.3.8) BuildRequires: mvn(com.googlecode.kiama:kiama_2.10:1.5.1) BuildRequires: mvn(jline:jline) BuildRequires: mvn(net.alchim31.maven:scala-maven-plugin:3.1.5) BuildRequires: mvn(org.bitbucket.inkytonik.dsinfo:dsinfo_2.10) BuildRequires: mvn(org.bitbucket.inkytonik.dsprofile:dsprofile_2.10) BuildRequires: mvn(org.scala-lang:scala-compiler) BuildRequires: mvn(org.scala-lang:scala-library) BuildRequires: mvn(org.scala-lang:scala-reflect) BuildRequires: mvn(org.specs2:specs2_2.10:2.1.1) # YAML module BuildRequires: mvn(org.yaml:snakeyaml:1.4) # test deps BuildRequires: mvn(junit:junit) # No more available retired BuildRequires: mvn(org.easytesting:fest-assert) %endif BuildArch: noarch %description Polyglot for Maven is an experimental distribution of Maven that allows the expression of a POM in something other than XML. A couple of the dialects also have the capability to write plugins inline: the Groovy, Ruby and Scala dialects allow this. %package atom Summary: Polyglot Tesla :: Atom %description atom Polyglot Tesla :: Atom. %package cli Summary: Polyglot Tesla :: CLI %description cli Polyglot Tesla :: CLI. %package clojure Summary: Polyglot Tesla :: Clojure # Require clojure 1.2.x Requires: clojure-compat %description clojure Polyglot Tesla :: Clojure. %package common Summary: Polyglot Tesla :: Common %description common Polyglot Tesla :: Common. %package groovy Summary: Polyglot Tesla :: Groovy %description groovy Polyglot Tesla :: Groovy. %package maven-plugin Summary: Polyglot Tesla :: Maven Plugin %description maven-plugin This package contains Polyglot Tesla Maven Plugin. %if 0 %package ruby Summary: Polyglot Tesla :: Ruby %description ruby Polyglot Tesla :: Ruby. %package scala Summary: Polyglot Tesla :: Scala %description scala Polyglot Tesla :: Scala. %package yaml Summary: Polyglot Tesla :: YAML %description yaml Polyglot Tesla :: YAML. %endif %package javadoc Summary: Javadoc for %{name} %description javadoc This package contains javadoc for %{name}. %prep %setup -q -n maven-polyglot-%{name}-%{version} find -name "*.class" -delete find -name "*.jar" -delete %patch0 -p0 # Doesn't really need the parent %pom_remove_parent # Remove unavailable plugin %pom_remove_plugin io.tesla.maven.plugins:tesla-license-plugin %pom_remove_plugin :tesla-license-plugin %{name}-atom %pom_remove_plugin :tesla-license-plugin %{name}-cli %pom_remove_plugin :tesla-license-plugin %{name}-clojure %pom_remove_plugin :tesla-license-plugin %{name}-common %pom_remove_plugin :tesla-license-plugin %{name}-groovy %pom_remove_plugin :tesla-license-plugin %{name}-maven-plugin %pom_remove_plugin :tesla-license-plugin %{name}-ruby %pom_remove_plugin :tesla-license-plugin %{name}-scala %pom_remove_plugin :tesla-license-plugin %{name}-yaml # Remove unwanted plugin %pom_remove_plugin :maven-dependency-plugin %{name}-cli %pom_remove_plugin :maven-assembly-plugin %{name}-cli # Unavailable build deps/tools %pom_disable_module %{name}-ruby %pom_disable_module %{name}-scala %pom_disable_module %{name}-yaml # Remove unbuilt modules references # TODO load ${maven.home}/conf/logging ...not clear... sed -i '/ruby/d' %{name}-cli/src/main/underlay/bin/m2.conf sed -i '/ruby/d' %{name}-cli/src/main/underlay/bin/translate.conf sed -i '/scala/d' %{name}-cli/src/main/underlay/bin/m2.conf sed -i '/scala/d' %{name}-cli/src/main/underlay/bin/translate.conf sed -i '/yaml/d' %{name}-cli/src/main/underlay/bin/m2.conf sed -i '/yaml/d' %{name}-cli/src/main/underlay/bin/translate.conf %pom_remove_dep :%{name}-ruby %{name}-cli %pom_remove_dep :%{name}-scala %{name}-cli %pom_remove_dep :%{name}-yaml %{name}-cli # Fix deps %pom_remove_dep xml-security:xmlsec %{name}-cli %pom_add_dep org.apache.santuario:xmlsec %{name}-cli %pom_remove_dep org.eclipse.sisu:org.eclipse.sisu.inject.tests %{name}-atom %pom_remove_dep org.eclipse.sisu:org.eclipse.sisu.inject.tests %{name}-ruby %pom_remove_dep org.eclipse.sisu:org.eclipse.sisu.inject.tests # Update guava library references %pom_remove_dep com.google.collections:google-collections %{name}-clojure %pom_add_dep com.google.guava:guava %{name}-clojure cp -p %{SOURCE1} . sed -i 's/\r//' eclipse-1.0.txt sed -i.classworlds -e s:'-classpath "${M2_HOME}"/boot/plexus-classworlds-\*.jar':'-classpath "${M2_HOME}"/boot/plexus-classworlds.jar':g %{name}-cli/src/main/underlay/bin/translate %build %mvn_alias ':tesla-polyglot-{*}' org.sonatype.pmaven:pmaven-@1 # test skipped for unavailable dependency org.easytesting:fest-assert:1.1 %mvn_build -f -s -- -Dproject.build.sourceEncoding=UTF-8 -Dmaven.local.depmap.file="%{SOURCE2}" %install %mvn_install # TODO # link tesla-polyglot-common tesla-polyglot-cli in /usr/share/maven/lib # link tesla-polyglot-atom in /usr/share/maven/ext/atom # link in /usr/share/maven/lib/ext/groovy # tesla-polyglot-groovy # org.codehaus.groovy:groovy # antlr:antlr # asm:asm # asm:asm-util # asm:asm-analysis # asm:asm-tree # link in /usr/share/maven/lib/ext/clojure # tesla-polyglot-clojure clojure-compat (see comments above) # install tesla-polyglot-cli/src/main/underlay/bin/translate # tesla-polyglot-cli/src/main/underlay/bin/m2.conf # tesla-polyglot-cli/src/main/underlay/bin/translate.conf # in /usr/share/maven/bin %files -f .mfiles-%{name} %dir %{_javadir}/%{name} %doc eclipse-1.0.txt license-header.txt poms %files atom -f .mfiles-%{name}-atom %files cli -f .mfiles-%{name}-cli %files clojure -f .mfiles-%{name}-clojure %files common -f .mfiles-%{name}-common %files groovy -f .mfiles-%{name}-groovy %if 0 %files jruby -f .mfiles-%{name}-ruby %files scala -f .mfiles-%{name}-scala %files yaml -f .mfiles-%{name}-yaml %endif %files maven-plugin -f .mfiles-%{name}-maven-plugin %files javadoc -f .mfiles-javadoc %doc eclipse-1.0.txt license-header.txt %changelog * Thu Oct 23 2014 gil cattaneo 0.1.0-2 - add BR on ant-junit - added alias needed by Gradle * Sun May 25 2014 gil cattaneo 0.1.0-1 - initial rpm