description="Ant package is a Java-based build tool."
url="http://ant.apache.org/"

packager="spiky <spiky@nutyx.org>"
contributors="Pierre,B.,Tnut"

makedepends=(glib openjdk)

name=apache-ant
version=1.10.12

source=(https://www.apache.org/dist/ant/binaries/$name-$version-bin.tar.xz)
build() {

cd $name-$version

install -d $PKG/opt/ant-$version/{bin,lib}
cp -rf * $PKG/opt/ant-$version/lib
ln -svf ../lib/bin/ant $PKG/opt/ant-$version/bin/ant

ln -v -sf ant-$version $PKG/opt/ant

mkdir -p $PKG/etc/profile.d
cat >  $PKG/etc/profile.d/ant.sh << "EOF"
#  Beginof /etc/profile.d/ant.sh

# Adjust the path
pathappend /opt/ant/bin
export ANT_HOME=/opt/ant

# End of /etc/profile.d/ant.sh
EOF

}
