ant/ant.spec

260 lines
9.2 KiB
RPMSpec

#
# spec file for package ant (Version 1.6.5)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: ant
BuildRequires: java2-devel-packages xerces-j2
%define ant_home %{_datadir}/ant
%define section free
%define cvs_name apache-%{name}
Version: 1.6.5
Release: 67
Summary: A Java-Based Build Tool
License: The Apache Software License
URL: http://jakarta.apache.org/
Group: Development/Tools/Building
Source0: %{cvs_name}-%{version}-src.tar.bz2
Source2: %{cvs_name}-1.6.5.ant.conf
# Ant configuration file which is edited when each optional subpackage
# is installed/uninstalled
# Fix temp directory used for file containing large command strings (> 4k)
Patch0: %{name}-%{version}-use_system_libs.patch
Patch1: %{cvs_name}-%{version}-rpm.patch
Patch150: java150_build.patch
Requires: xerces-j2 >= 2.7.1-2
Requires: jaxp_parser_impl
Requires: xml-commons-apis
Requires: xml-commons-resolver
Requires: jpackage-utils >= 1.5
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Obsoletes: apache-ant
Provides: apache-ant
%description
Apache Ant is a Java-based build tool. In theory, it is kind of like
Make, but without Make's wrinkles.
Why another build tool when there is already make, gnumake, nmake, jam,
and others? Because all those tools have limitations that Ant's
original author could not live with when developing software across
multiple platforms. Make-like tools are inherently shell-based--they
evaluate a set of dependencies then execute commands, not unlike what
you would issue in a shell. This means that you can easily extend these
tools by using or writing any program for the OS that you are working
on. However, this also means that you limit yourself to the OS, or at
least the OS type, such as Unix, that you are working on.
Makefiles are inherently evil as well. Anybody who has worked on them
for any time has run into the dreaded tab problem. "Is my command not
executing because I have a space in front of my tab???" said the
original author of Ant way too many times. Tools like Jam took care of
this to a great degree, but still have yet another format to use and
remember.
Ant is different. Instead of a model where it is extended with
shell-based commands, Ant is extended using Java classes. Instead of
writing shell commands, the configuration files are XML-based, calling
out a target tree where various tasks are executed. Each task is run by
an object that implements a particular task interface.
Granted, this removes some of the expressive power that is inherent by
being able to construct a shell command such as `find . -name foo -exec
rm {}`, but it gives you the ability to be cross-platform--to work
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.
%package manual
Summary: Manual for ant
Group: Development/Tools/Building
%description manual
Apache Ant is a Java-based build tool.
This package contains the manual for Apache Ant.
%package javadoc
Summary: Javadoc for ant
Group: Development/Tools/Building
PreReq: coreutils
%description javadoc
Apache Ant is a Java-based build tool.
This package contains the javadoc documentation for Apache Ant.
%package scripts
Summary: Additional scripts for ant
Group: Development/Tools/Building
#AutoReqProv: no
Requires: ant = %{version}
Requires: /usr/bin/perl
Requires: /usr/bin/python
%description scripts
Apache Ant is a Java-based build tool.
This package contains additional perl and python scripts for Apache
Ant.
%prep
%setup -q -n apache-ant-%{version}
%patch0
%patch1
%patch150 -p1
# Fix temp directory used for file containing large command strings (> 4k)
# clean jar files
find . -name "*.jar" -exec rm -f {} \;
# -----------------------------------------------------------------------------
%build
find . -name "*.jar" -delete
# classpath selects optional components to build
export CLASSPATH=$(%{_bindir}/build-classpath jaxp_parser_impl xml-commons-apis)
#[ -n "$JAVA_HOME" ] && unset JAVA_HOME
#[ -r %{_sysconfdir}/java/java.conf ] && . %{_sysconfdir}/java/java.conf
#[ -z "$JAVA_HOME" ] && JAVA_HOME=%{_jvmdir}/java
#. /usr/share/java-utils/java-functions
export JAVA_HOME
sh bootstrap.sh
sh build.sh --noconfig jars javadocs
# -----------------------------------------------------------------------------
%install
rm -rf $RPM_BUILD_ROOT
rm src/script/ant.orig
# ANT_HOME and subdirs
mkdir -p $RPM_BUILD_ROOT%{ant_home}/{lib,etc,bin}
# jars
mkdir -p $RPM_BUILD_ROOT%{_javadir}
cp -p build/lib/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
cp -p build/lib/%{name}-launcher.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-launcher-%{version}.jar
# where optional tasks will put their stuff
mkdir -p $RPM_BUILD_ROOT%{_javadir}/%{name}
# jar aliases
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do if [ -e ${jar} ]; then ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; fi; done)
(cd $RPM_BUILD_ROOT%{_javadir}/%{name} && for jar in *-%{version}.jar; do if [ -e ${jar} ]; then ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; fi; done)
# scripts: remove dos and os/2 scripts
rm -f src/script/*.bat
rm -f src/script/*.cmd
# install everything else
mkdir -p $RPM_BUILD_ROOT%{_bindir}
cp -p src/script/* $RPM_BUILD_ROOT%{_bindir}
rm $RPM_BUILD_ROOT%{_bindir}/antRun*
cp -p src/script/antRun* $RPM_BUILD_ROOT%{ant_home}/bin
# default ant.conf
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d
# -----------------------------------------------------------------------------
# javadoc
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/ant-%{version}
cp -pr build/javadocs/* $RPM_BUILD_ROOT%{_javadocdir}/ant-%{version}
# fix link between manual and javadoc
pushd docs/manual
ln -sf ../../../../../ant-%{version} api
popd
# -----------------------------------------------------------------------------
cp src/etc/ant-update.xsl $RPM_BUILD_ROOT%{ant_home}/etc
cp src/etc/changelog.xsl $RPM_BUILD_ROOT%{ant_home}/etc
cp src/etc/junit-frames-xalan1.xsl $RPM_BUILD_ROOT%{ant_home}/etc
cp src/etc/log.xsl $RPM_BUILD_ROOT%{ant_home}/etc
cp src/etc/tagdiff.xsl $RPM_BUILD_ROOT%{ant_home}/etc
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{ant_name}.d
%clean
rm -rf $RPM_BUILD_ROOT
# -----------------------------------------------------------------------------
%files
%defattr(0644,root,root,0755)
%doc KEYS LICENSE README WHATSNEW
%attr(0755,root,root) %{_bindir}/ant
#% attr(0755,root,root) % {_bindir}/complete-ant-cmd.pl
#% attr(0755,root,root) % {_bindir}/runant.pl
#% attr(0755,root,root) % {_bindir}/runant.py
%attr(0755,root,root) %{ant_home}/bin
%dir %{_javadir}/%{name}
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-launcher.jar
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/%{name}-launcher-%{version}.jar
%dir %{ant_home}
%dir %{_sysconfdir}/%{name}.d
%config %dir %{_sysconfdir}/%{name}.conf
%exclude %{_bindir}/*.pl
%exclude %{_bindir}/*.py
%dir %{ant_home}/lib
%{ant_home}/etc
# -----------------------------------------------------------------------------
%files scripts
%defattr(0755,root,root,0755)
%{_bindir}/*.pl
%{_bindir}/*.py
%files manual
%defattr(0644,root,root,0755)
%doc docs/*
%files javadoc
%defattr(0644,root,root,0755)
%{_javadocdir}/ant-%{version}
# -----------------------------------------------------------------------------
%changelog
* Fri Sep 22 2006 - dbornkessel@suse.de
- read in properties in /etc/ant.conf
- added source=1.4
* Mon May 08 2006 - dbornkessel@suse.de
- only ant-antlr updates
* Thu Feb 02 2006 - dbornkessel@suse.de
- fixed rpmlint errors and warnings
* Tue Jan 31 2006 - dbornkessel@suse.de
- only ant-antlr updates
* Fri Jan 27 2006 - dbornkessel@suse.de
- added four missing xsl files
- removed JAVA_HOME magic
* Tue Jan 24 2006 - dbornkessel@suse.de
- Not dependend on xml-commons-apis, which are provided by xerces-j2, which does not
depend on ant package (in contrast to old dependency on
xml-commons-apis <-> ant)
- optional task are now again in extra spec file ant-antlr
* Thu Jan 19 2006 - dbornkessel@suse.de
- Integrated ant and ant-antlr again in one spec file as there is no
dependency loop ... jpackage BuildRequires were wrong.
- updated to version 1.6.5
* Mon Dec 19 2005 - dbornkessel@suse.de
- added if statement that hinders unwanted creation of a file within a for loop
* Thu Sep 29 2005 - dmueller@suse.de
- add norootforbuild
* Fri Mar 04 2005 - skh@suse.de
- rely on jpackage-utils' java-functions to set JAVA_HOME correctly
* Sun Sep 05 2004 - skh@suse.de
- create and add /usr/share/java/ant to file list for optional
tasks to put their jars into
* Thu Sep 02 2004 - skh@suse.de
- renamed from apache-ant to ant
- switched to JPackage 1.5 version
- updated to version 1.6.2
- split off optional tasks into separate package to solve build
dependency loop in JPackage