# TODO
# - prepare all BR and test the full build
-# (TODO: stylebook, starteam, weblogic)
+# TODO:
+# - stylebook: http://svn.apache.org/viewcvs.cgi/xml/stylebook/
+# - starteam: http://www.borland.com/downloads/download_starteam.html (30-day trial, needs registration)
+# - weblogic: http://www.bea.com/ ? (needs registration)
#
# Conditional build:
%bcond_with bootstrap # minimal build for bootstrap
%bcond_without junit # disable building junit optional task(s)
%bcond_without netrexx # disable building netrexx optional taks(s)
#
-%if !%{with nonfree}
+%if %{without nonfree}
%undefine with_jai
%endif
%if %{with bootstrap}
%undefine with_netrexx
%endif
#
-%define _rel 0.1
+%define _rel 3
Summary: Ant build tool for Java
Summary(fr.UTF-8): Outil de compilation pour java
Summary(it.UTF-8): Tool per la compilazione di programmi java
Summary(pl.UTF-8): Ant - narzędzie do budowania w Javie
Name: ant
-Version: 1.7.0
-Release: %{?with_bootstrap:bootstrap.}%{_rel}
+Version: 1.7.1
+Release: %{_rel}%{?with_bootstrap:.bootstrap}
License: Apache
Group: Development/Languages/Java
Source0: http://www.apache.org/dist/ant/source/apache-%{name}-%{version}-src.tar.bz2
-# Source0-md5: 22b378e27ab300e4d73bf09d91c7e2a6
+# Source0-md5: 0d68db4a1ada5c91bcbf53cefd0c2fd7
Source1: %{name}.conf
Patch0: %{name}-antRun.patch
+Patch1: %{name}-gcjtask.patch
URL: http://ant.apache.org/
%{?with_antlr:BuildRequires: antlr}
%{?with_apache_bsf:BuildRequires: beanshell}
%{?with_apache_bsf:BuildRequires: bsf}
%{?with_javamail:BuildRequires: jaf}
+%{?with_jai:BuildRequires: jai}
%{?with_apache_bcel:BuildRequires: jakarta-bcel}
%{?with_commons_logging:BuildRequires: jakarta-commons-logging}
%{?with_commons_net:BuildRequires: jakarta-commons-net}
%{?with_apache_oro:BuildRequires: jakarta-oro}
%{?with_apache_regexp:BuildRequires: jakarta-regexp}
-%{?with_jai:BuildRequires: jai}
%{?with_javamail:BuildRequires: javamail}
BuildRequires: jaxp_parser_impl
+%{?with_jdepend:BuildRequires: jdepend}
BuildRequires: jdk
BuildRequires: jpackage-utils
%{?with_jsch:BuildRequires: jsch >= 0.1.21}
%prep
%setup -q -n apache-%{name}-%{version}
%patch0 -p1
+%patch1 -p1
# clean jar files
find . -name "*.jar" -exec rm -f {} \;
src/main/org/apache/tools/ant/taskdefs/Exec.java \
src/main/org/apache/tools/ant/taskdefs/Execute.java
+# fix link between manual and javadoc
+ln -sf %{_javadocdir}/%{name}-%{version} docs/manual/api
+
%build
export JAVA_HOME="%{java_home}"
%{?with_jsch:required_jars="$required_jars jsch"}
%{?with_netrexx:required_jars="$required_jars NetRexxC"}
-export CLASSPATH="`/usr/bin/build-classpath $required_jars`"
+export CLASSPATH="`%{_bindir}/build-classpath $required_jars`"
sh build.sh --noconfig main javadocs
# javadoc
install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr build/javadocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
-
-# fix link between manual and javadoc
-cd docs/manual
-ln -sf %{_javadocdir}/%{name}-%{version} api
-cd ..
+ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink
%clean
rm -rf $RPM_BUILD_ROOT
%post javadoc
-rm -f %{_javadocdir}/%{name}
-ln -s %{name}-%{version} %{_javadocdir}/%{name}
-
-%postun javadoc
-if [ "$1" = "0" ]; then
- rm -f %{_javadocdir}/%{name}
-fi
+ln -nfs %{name}-%{version} %{_javadocdir}/%{name}
%files
%defattr(644,root,root,755)
%files javadoc
%defattr(644,root,root,755)
%{_javadocdir}/%{name}-%{version}
+%ghost %{_javadocdir}/%{name}