Accepting request 246737 from openSUSE:Factory:Staging:H:DVD

- to bootstrap 13.2 we need another split because bsf depends on things
  that depend on junit and as antlr requires bsf, we need a 3rd step ->
  split ant-junit to build in between ant and ant-antlr

OBS-URL: https://build.opensuse.org/request/show/246737
OBS-URL: https://build.opensuse.org/package/show/Java:packages/ant?expand=0&rev=60
This commit is contained in:
Factory Maintainer
2014-08-28 17:05:23 +00:00
committed by Git OBS Bridge
parent 92685e5b52
commit f6a22379bd
6 changed files with 1545 additions and 115 deletions

View File

@@ -19,7 +19,9 @@
##### WARNING: please do not edit this auto generated spec file. Use the ant.spec! #####
%global bootstrap 0
%bcond_with bootstrap
%bcond_with junit
%bcond_without antlr
# disable javadoc build on arm platform - it delays a build a lot
# mvyskocil: ifarch does not work for noarch packages ...
@@ -49,7 +51,7 @@ Patch0: apache-ant-no-test-jar.patch
Patch1: apache-ant-class-path-in-manifest.patch
#PATCH-FIX-SLE: fix building with old gcj by working around bugs
Patch2: apache-ant-old-gcj-build.patch
%if %bootstrap
%if %{with bootstrap}
BuildRequires: java-1_5_0-gcj-compat-devel
#!BuildIgnore: java-1_6_0-openjdk java-1_6_0-openjdk-devel
#!BuildIgnore: java-1_7_0-openjdk java-1_7_0-openjdk-devel
@@ -62,15 +64,16 @@ BuildRequires: unzip
#BuildRequires: xerces-j2-bootstrap
#!BuildIgnore: xerces-j2-bootstrap
BuildRequires: xml-commons-apis-bootstrap
%if ! %bootstrap
%if %{with junit} || %{with antlr}
BuildRequires: ant = %{version}
BuildRequires: junit
BuildRequires: xalan-j2
BuildRequires: xerces-j2
BuildRequires: xml-commons-apis
#!BuildIgnore: antlr
%endif
%if %bootstrap
%if %{with antlr}
BuildRequires: xerces-j2
BuildRequires: xml-commons-apis
%endif
%if %{with bootstrap}
Requires: java-devel >= 1.5.0
Requires: javapackages-tools
Requires: jaxp_parser_impl
@@ -82,15 +85,26 @@ Obsoletes: ant-nodeps < %{version}
Provides: ant-nodeps = %{version}
Obsoletes: ant-trax < %{version}
Provides: ant-trax = %{version}
%else
# ant-antlr requires
%endif
%if %{with antlr}
Requires: antlr
%requires_eq ant
Provides: ant-antlr = %{version}-%{release}
%endif
%if %{with junit}
Requires: junit4
%requires_eq ant
%endif
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %{with junit}
%description
Apache Ant is a Java-based build tool.
This package contains optional JUnit tasks for Apache Ant.
%else
# FIXME: this should be different for antlr
%description
Apache Ant is a Java-based build tool. In theory, it is kind of like
Make, but without Make's wrinkles.
@@ -125,8 +139,9 @@ anywhere and everywhere. If you really need to execute a shell command,
Ant has an <exec> task that allows different commands to be executed
based on the OS used.
%endif
%if %bootstrap
%if %{with bootstrap}
%package -n ant-jmf
Summary: Optional jmf tasks for ant
License: Apache-2.0
@@ -166,7 +181,8 @@ This package contains additional perl and python scripts for Apache
Ant.
%endif #if bootstrap
%if ! %bootstrap
%if %{with antlr}
%package -n ant-apache-bsf
Summary: Optional apache bsf tasks for ant
@@ -299,6 +315,7 @@ Summary: Optional apache xalan2 tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: regexp
BuildRequires: xalan-j2
Requires: regexp
%requires_eq ant
@@ -344,18 +361,6 @@ Apache Ant is a Java-based build tool.
This package contains optional jsch tasks for Apache Ant.
%package -n ant-junit
Summary: Optional junit tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: junit4
%requires_eq ant
%description -n ant-junit
Apache Ant is a Java-based build tool.
This package contains optional JUnit tasks for Apache Ant.
%package -n ant-testutil
Summary: Test utility classes for ant
License: Apache-2.0
@@ -395,7 +400,7 @@ This package contains the javadoc documentation for Apache Ant.
find -name build.xml -o -name pom.xml | xargs sed -i -e s/-SNAPSHOT//
# When bootstrapping, we don't have junit
%if %bootstrap
%if %{with bootstrap}
%patch0 -p1
%if 0%{?suse_version} < 1200
%patch2 -p1
@@ -419,7 +424,11 @@ rm src/tests/junit/org/apache/tools/ant/types/selectors/SignedSelectorTest.java
#rm src/tests/junit/org/example/junit/JUnit4Skippable.java
#install jars
%if ! %bootstrap
%if %{with junit}
build-jar-repository -s -p lib/optional junit4
%endif
%if %{with antlr}
# we need to build junit in antlr, but we remove it later
build-jar-repository -s -p lib/optional xerces-j2 xml-commons-jaxp-1.3-apis antlr-bootstrap bcel javamail/mailapi jdepend junit4 log4j oro regexp bsf commons-logging commons-net jsch xalan-j2 xml-commons-resolver
%endif
@@ -433,19 +442,20 @@ mv LICENSE.utf8 LICENSE
%build
export OPT_JAR_LIST=:
%if ! %bootstrap
%if %{with antlr} || %{with junit}
ant -Dbuild.sysclasspath=first jars test-jar
#remove empty jai and netrexx jars. Due to missing dependencies they contain only manifests.
rm -rf build/lib/ant-jai.jar build/lib/ant-netrexx.jar
%if 0%{?build_javadoc}
export CLASSPATH=$(build-classpath xerces-j2 xml-commons-jaxp-1.3-apis antlr bcel jaf javamail/mailapi jdepend junit4 log4j oro regexp bsf commons-logging commons-net jsch xalan-j2 xml-commons-resolver)
export CLASSPATH=$(build-classpath xerces-j2 xml-commons-jaxp-1.3-apis antlr bcel jaf javamail/mailapi jdepend junit4 log4j oro regexp bsf commons-logging commons-net jsch xalan-j2 xml-commons-resolver)
ant javadocs
%endif
%else
%endif
%if %{with bootstrap}
export GC_MAXIMUM_HEAP_SIZE="134217728" #128M
export JAVA_HOME=%{java_home}
export CLASSPATH=$JAVA_HOME/lib/tools.jar
@@ -461,6 +471,21 @@ mkdir -p %{buildroot}%{ant_home}/{lib,etc}
install -d -m 755 %{buildroot}%{_javadir}/ant
install -d -m 755 %{buildroot}%{_mavenpomdir}
%if ! %{with junit}
rm build/lib/ant-junit*.jar
%else
# remove all others
for i in build/lib/ant-*.jar ; do
case $i in
*/ant-junit*)
;;
*)
rm -v $i
;;
esac
done
%endif
for jar in build/lib/*.jar
do
jarname=$(basename $jar .jar)
@@ -470,14 +495,14 @@ do
case $jarname in
#These go into %%{_javadir}, pom files have different names
ant | ant-bootstrap | ant-launcher)
%if %bootstrap
%if %{with bootstrap}
destdir=%{buildroot}%{_javadir}; destname="";pomname="JPP-$jarname.pom"
%else
continue
%endif
;;
ant-jmf|ant-swing)
%if %bootstrap
%if %{with bootstrap}
destdir=%{buildroot}%{_javadir}/ant; destname="ant/";
%else
continue
@@ -485,7 +510,7 @@ do
;;
#Bootstracp builds an incomplete ant-foo jars, don't ship them
*)
%if %bootstrap
%if %{with bootstrap}
continue
%else
#These go into %%{_javadir}/ant
@@ -508,7 +533,7 @@ do
%add_maven_depmap ${pomname} ${destname}${jarname}.jar
done
%if %bootstrap
%if %{with bootstrap}
#ant-parent pom
install -m 644 src/etc/poms/pom.xml %{buildroot}/%{_mavenpomdir}/JPP-ant-parent.pom
%add_maven_depmap JPP-ant-parent.pom
@@ -520,28 +545,39 @@ rm -f src/script/*.cmd
# XSLs
cp -p src/etc/*.xsl %{buildroot}%{ant_home}/etc
rm -f %{buildroot}%{ant_home}/etc/{maudit-frames,jdepend,jdepend-frames,junit-frames,junit-noframes}.xsl
%else
cp -p src/etc/{maudit-frames,jdepend,jdepend-frames,junit-frames,junit-noframes}.xsl %{buildroot}%{ant_home}/etc
%endif
%if %{with junit}
cp -p src/etc/{junit-noframes,junit-frames}.xsl %{buildroot}%{ant_home}/etc
%endif
%if %{with antlr}
cp -p src/etc/{maudit-frames,jdepend,jdepend-frames}.xsl %{buildroot}%{ant_home}/etc
%endif
%if %bootstrap
%if %{with bootstrap}
# install everything else
mkdir -p %{buildroot}%{_bindir}
cp -p src/script/* %{buildroot}%{_bindir}/
mkdir -p %{buildroot}%{_datadir}/%{name}/bin/
ln -sf %{_bindir}/antRun %{buildroot}/%{_datadir}/%{name}/bin/antRun
%endif
%if %bootstrap
mkdir -p %{buildroot}%{_sysconfdir}/ant.d
%if %{with bootstrap}
# default ant.conf
mkdir -p %{buildroot}%{_sysconfdir}
cp -p %{SOURCE1} %{buildroot}%{_sysconfdir}/ant.conf
# OPT_JAR_LIST fragments
mkdir -p %{buildroot}%{_sysconfdir}/%{name}.d
echo "ant/ant-jmf" > %{buildroot}%{_sysconfdir}/%{name}.d/jmf
echo "ant/ant-swing" > %{buildroot}%{_sysconfdir}/%{name}.d/swing
%else
mkdir -p %{buildroot}%{_sysconfdir}/ant.d
%endif
%if %{with junit}
echo "junit ant/ant-junit" > %{buildroot}%{_sysconfdir}/ant.d/junit
%endif
%if %{with antlr}
echo "antlr ant/ant-antlr" > %{buildroot}%{_sysconfdir}/ant.d/antlr
echo "bsf ant/ant-apache-bsf" > %{buildroot}%{_sysconfdir}/ant.d/apache-bsf
echo "xml-commons-resolver ant/ant-apache-resolver" > %{buildroot}%{_sysconfdir}/ant.d/apache-resolver
@@ -556,10 +592,10 @@ echo "xalan-j2 ant/ant-apache-xalan2" > %{buildroot}%{_sysconfdir}/ant.d/apache-
echo "javamail jaf ant/ant-javamail" > %{buildroot}%{_sysconfdir}/ant.d/javamail
echo "jdepend ant/ant-jdepend" > %{buildroot}%{_sysconfdir}/ant.d/jdepend
echo "jsch ant/ant-jsch" > %{buildroot}%{_sysconfdir}/ant.d/jsch
echo "junit ant/ant-junit" > %{buildroot}%{_sysconfdir}/ant.d/junit
echo "testutil ant/ant-testutil" > %{buildroot}%{_sysconfdir}/ant.d/testutil
%endif
%if ! %bootstrap
%if %{with antlr}
%if 0%{?build_javadoc}
mkdir -p %{buildroot}%{_javadocdir}/ant
@@ -573,7 +609,7 @@ cp -pr build/javadocs/* %{buildroot}%{_javadocdir}/ant
(cd manual; ln -sf %{_javadocdir}/%{name} api)
%endif #javadoc
%if %bootstrap
%if %{with bootstrap}
find %{buildroot}%{_datadir}/ant/etc -type f -name "*.xsl" \
-a ! -name ant-update.xsl \
-a ! -name changelog.xsl \
@@ -585,7 +621,7 @@ find %{buildroot}%{_datadir}/ant/etc -type f -name "*.xsl" \
| xargs -t rm
%endif
%if %bootstrap
%if %{with bootstrap}
%files
%defattr(0644,root,root,0755)
@@ -621,9 +657,9 @@ find %{buildroot}%{_datadir}/ant/etc -type f -name "*.xsl" \
%config(noreplace) %{_mavendepmapfragdir}/*
%dir %{_mavenpomdir}
%else
# ant-antlr filelist
%endif
%if %{with antlr}
%files
%defattr(0644,root,root,0755)
%{_javadir}/ant/ant-antlr.jar
@@ -634,8 +670,21 @@ find %{buildroot}%{_datadir}/ant/etc -type f -name "*.xsl" \
%dir %{_mavenpomdir}
%endif
%if %{with junit}
%files
%defattr(0644,root,root,0755)
%{_javadir}/ant/ant-junit*.jar
%{ant_home}/lib/ant-junit*.jar
%config(noreplace) %{_sysconfdir}/ant.d/junit
%config(noreplace) %{_mavendepmapfragdir}/ant-junit
%{ant_home}/etc/junit-frames.xsl
%{ant_home}/etc/junit-noframes.xsl
%{_mavenpomdir}/JPP.ant-ant-junit*.pom
%dir %{_mavenpomdir}
%endif
### Basic ant subpackages
%if %bootstrap
%if %{with bootstrap}
%files -n ant-jmf
%defattr(0644,root,root,0755)
@@ -658,7 +707,7 @@ find %{buildroot}%{_datadir}/ant/etc -type f -name "*.xsl" \
%{_bindir}/*.py*
%endif #if bootstrap
%if ! %bootstrap
%if %{with antlr}
%files -n ant-apache-bsf
%defattr(0644,root,root,0755)
@@ -768,16 +817,6 @@ find %{buildroot}%{_datadir}/ant/etc -type f -name "*.xsl" \
%{_mavenpomdir}/JPP.ant-ant-jsch.pom
%dir %{_mavenpomdir}
%files -n ant-junit
%defattr(0644,root,root,0755)
%{_javadir}/ant/ant-junit*.jar
%{ant_home}/lib/ant-junit*.jar
%config(noreplace) %{_sysconfdir}/ant.d/junit
%{ant_home}/etc/junit-frames.xsl
%{ant_home}/etc/junit-noframes.xsl
%{_mavenpomdir}/JPP.ant-ant-junit*.pom
%dir %{_mavenpomdir}
%files -n ant-testutil
%defattr(-,root,root,-)
%{_javadir}/ant/ant-testutil.jar