%global build_jars \\\ -DgroovyJar=%( build-classpath groovy ) \\\ -Dcommons-cliJar=%( build-classpath commons-cli ) \\\ -Dasm2Jar=%( build-classpath asm2/asm2 ) \\\ -DantlrJar=%( build-classpath antlr ) \\\ -DantJar=%( build-classpath ant ) \\\ -DjunitJar=%( build-classpath junit ) \\\ -Dant-junitJar=%( build-classpath ant/ant-junit ) \\\ -Dant-launcherJar=%( build-classpath ant-launcher ) \\\ -DivyJar=%( build-classpath ivy ) Name: gant Version: 1.8.1 Release: 1%{?dist} Summary: Groovy-based build system that uses Ant tasks Group: Development/Tools License: ASL 2.0 URL: http://gant.codehaus.org/ Source0: http://dist.codehaus.org/gant/distributions/gant_src-%{version}.tgz Patch0: 0001-Make-it-build-against-our-jars.patch Patch1: 0001-Fix-tests.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: groovy BuildRequires: jakarta-commons-cli BuildRequires: asm2 BuildRequires: antlr BuildRequires: ant BuildRequires: junit BuildRequires: ant-junit BuildRequires: ivy BuildRequires: jpackage-utils Requires: jpackage-utils BuildArch: noarch %description Gant is a tool for scripting Ant tasks using Groovy instead of XML to specify the logic. A Gant specification is a Groovy script and so can bring all the power of Groovy to bear directly, something not possible with Ant scripts. Whilst it might be seen as a competitor to Ant, Gant uses Ant tasks for many of the actions, so Gant is really an alternative way of doing things using Ant, but using a programming language rather than XML to specify the rules. %prep %setup -q %patch0 -p1 -b .build %patch1 -p1 -b .tests %build find . -name '*.jar' -delete ant %{build_jars} package %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_javadir} install -p -m0644 target_gant/%{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir} ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar %check # Gant_Test "failed to create task or type urn:maven-artifact-ant:dependencies" rm -f src/test/groovy/org/codehaus/gant/ant/tests/Gant_Test.java rm -f target_gant/test-classes/org/codehaus/gant/ant/tests/Gant_Test.class # For GANT_33_Test mkdir -p .gant/cache # Run the test suite ant %{build_jars} test # Ant always returns success, let us look at the test reports ourselves if FAILED=$(egrep -l 'errors="[^0]"|failures="[^0]"' \ target_gant/test-reports/*.xml) then echo $FAILED |sed 's/\.xml/.txt/' |xargs cat exit 1 fi %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %{_javadir}/*.jar %doc README_Install.txt LICENCE.txt releaseNotes.txt %changelog * Mon Nov 23 2009 Lubomir Rintel - 1.8.1-1 - Initial packaging