Build on Fedora

This commit is contained in:
gbenson 2004-10-07 14:46:20 +00:00
parent c101fc6f27
commit 6c5cb19ad5

View File

@ -1,6 +1,9 @@
%define ant_home %{_datadir}/ant %define ant_home %{_datadir}/ant
%define section free %define section free
# This flag causes the omission of the bsf subpackage.
%define no_bsf 1
Name: ant Name: ant
Version: 1.6.1 Version: 1.6.1
Release: 1jpp_3rh Release: 1jpp_3rh
@ -19,6 +22,7 @@ Source1: apache-ant-%{version}.ant
Source2: apache-ant-%{version}.ant.conf Source2: apache-ant-%{version}.ant.conf
# Fix temp directory used for file containing large command strings (> 4k) # Fix temp directory used for file containing large command strings (> 4k)
Patch0: apache-ant-%{version}.patch Patch0: apache-ant-%{version}.patch
Patch1: apache-ant-javac-ecj.patch
Requires: jaxp_parser_impl Requires: jaxp_parser_impl
Requires: jpackage-utils >= 0:1.5 Requires: jpackage-utils >= 0:1.5
BuildRequires: jaxp_parser_impl BuildRequires: jaxp_parser_impl
@ -59,6 +63,7 @@ Optional antlr tasks for %{name}.
%description antlr -l fr %description antlr -l fr
Taches antlr optionelles pour %{name}. Taches antlr optionelles pour %{name}.
%if !%{no_bsf}
%package apache-bsf %package apache-bsf
Summary: Optional apache bsf tasks for %{name} Summary: Optional apache bsf tasks for %{name}
Group: Development/Build Tools Group: Development/Build Tools
@ -73,6 +78,7 @@ Optional apache bsf tasks for %{name}.
%description apache-bsf -l fr %description apache-bsf -l fr
Taches apache bsf optionelles pour %{name}. Taches apache bsf optionelles pour %{name}.
%endif
%package apache-resolver %package apache-resolver
Summary: Optional apache resolver tasks for %{name} Summary: Optional apache resolver tasks for %{name}
@ -375,6 +381,11 @@ cp -p %{SOURCE1} src/script/%{name}
# clean jar files # clean jar files
find . -name "*.jar" -exec rm -f {} \; find . -name "*.jar" -exec rm -f {} \;
# fix classpath for java-x.y.z-gcj-compat
if java -version 2>&1 | grep -q "gcj"; then
%patch1 -p1
fi
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
%build %build
@ -388,6 +399,10 @@ export CLASSPATH=$(%{_bindir}/build-classpath jaxp_parser_impl xml-commons-apis
[ -r %{_sysconfdir}/java/java.conf ] && . %{_sysconfdir}/java/java.conf [ -r %{_sysconfdir}/java/java.conf ] && . %{_sysconfdir}/java/java.conf
[ -z "$JAVA_HOME" ] && JAVA_HOME=%{_jvmdir}/java [ -z "$JAVA_HOME" ] && JAVA_HOME=%{_jvmdir}/java
export JAVA_HOME export JAVA_HOME
if java -version 2>&1 | grep -q "gcj"; then
# make sure we do not use an installed native ant during the build
export ANT_OPTS="-Dgnu.gcj.runtime.VMClassLoader.library_control=never"
fi
sh build.sh --noconfig jars javadocs sh build.sh --noconfig jars javadocs
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@ -406,7 +421,9 @@ cp -p build/lib/%{name}-launcher.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-launcher
# optional jars # optional jars
mkdir -p $RPM_BUILD_ROOT%{_javadir}/%{name} mkdir -p $RPM_BUILD_ROOT%{_javadir}/%{name}
cp -p build/lib/%{name}-antlr.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-antlr-%{version}.jar cp -p build/lib/%{name}-antlr.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-antlr-%{version}.jar
%if !%{no_bsf}
cp -p build/lib/%{name}-apache-bsf.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-apache-bsf-%{version}.jar cp -p build/lib/%{name}-apache-bsf.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-apache-bsf-%{version}.jar
%endif
cp -p build/lib/%{name}-apache-resolver.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-apache-resolver-%{version}.jar cp -p build/lib/%{name}-apache-resolver.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-apache-resolver-%{version}.jar
cp -p build/lib/%{name}-commons-logging.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-commons-logging-%{version}.jar cp -p build/lib/%{name}-commons-logging.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-commons-logging-%{version}.jar
#cp -p build/lib/%{name}-commons-net.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-commons-net-%{version}.jar #cp -p build/lib/%{name}-commons-net.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-commons-net-%{version}.jar
@ -481,6 +498,7 @@ fi
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
%if !%{no_bsf}
%post apache-bsf %post apache-bsf
if [ -f %{_sysconfdir}/%{name}.conf ]; then if [ -f %{_sysconfdir}/%{name}.conf ]; then
mv -f %{_sysconfdir}/%{name}.conf %{_sysconfdir}/%{name}.conf.tmp mv -f %{_sysconfdir}/%{name}.conf %{_sysconfdir}/%{name}.conf.tmp
@ -495,6 +513,7 @@ if [ "$1" = "0" ]; then
sed -e '/# RPM package apache-bsf$/d' %{_sysconfdir}/%{name}.conf.tmp > %{_sysconfdir}/%{name}.conf sed -e '/# RPM package apache-bsf$/d' %{_sysconfdir}/%{name}.conf.tmp > %{_sysconfdir}/%{name}.conf
rm -f %{_sysconfdir}/%{name}.conf.tmp rm -f %{_sysconfdir}/%{name}.conf.tmp
fi fi
%endif
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@ -821,10 +840,12 @@ fi
%{_javadir}/%{name}/%{name}-antlr.jar %{_javadir}/%{name}/%{name}-antlr.jar
%{_javadir}/%{name}/%{name}-antlr-%{version}.jar %{_javadir}/%{name}/%{name}-antlr-%{version}.jar
%if !%{no_bsf}
%files apache-bsf %files apache-bsf
%defattr(0644,root,root,0755) %defattr(0644,root,root,0755)
%{_javadir}/%{name}/%{name}-apache-bsf.jar %{_javadir}/%{name}/%{name}-apache-bsf.jar
%{_javadir}/%{name}/%{name}-apache-bsf-%{version}.jar %{_javadir}/%{name}/%{name}-apache-bsf-%{version}.jar
%endif
%files apache-resolver %files apache-resolver
%defattr(0644,root,root,0755) %defattr(0644,root,root,0755)