Linux HOWTOs

About | Home | Search


ERROR: Slooooow dooooown... this page load was delayed.

HOWTO: ant
Description: Java based build tool
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# Apache Ant 1.7.0
# ================
# Prerequisites:
# JDK (Java Development Kit)

cd
test -f installed/apache-ant-1.7.0-src.tar.bz2 &&
 mv installed/apache-ant-1.7.0-src.tar.bz2 .
test ! -f apache-ant-1.7.0-src.tar.bz2 &&
 wget http://apache.seekmeup.com/ant/source/\
apache-ant-1.7.0-src.tar.bz2

# Verify tarball w/ md5sum:
echo "22b378e27ab300e4d73bf09d91c7e2a6  apache-ant-1.7.0-src.tar.bz2" | \
 md5sum -c

# Verify tarball w/ sha1sum:
echo "3f01c35265ba50a49caafe1fb34ec8998bf45eb3  apache-ant-1.7.0-src.tar.bz2" | \
 sha1sum -c

# Verify tarball w/ gpg:
( gpg --list-keys 265B4C63 > /dev/null 2>&1 || gpg --recv-keys 265B4C63 ) &&
 wget -nc http://www.apache.org/dist/ant/source/\
apache-ant-1.7.0-src.tar.bz2.asc
  gpg --verify apache-ant-1.7.0-src.tar.bz2.asc &&
   rm apache-ant-1.7.0-src.tar.bz2.asc

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "apache-ant-*" -exec rm -r {} \;
tar xjvf ~/apache-ant-1.7.0-src.tar.bz2
cd apache-ant-1.7.0
test $UID = 0 && chown -R root:root .
chmod -R u+w .

# Make sure $JAVA_HOME is set, this should've been taken care of when
# you installed the JDK

# Put JUnit in ./lib/optional/ or the build will fail
# (see http://ant.apache.org/faq.html#170-requires-junit)
mkdir lib/optional
cd lib/optional
wget http://superb-east.dl.sourceforge.net/sourceforge/junit/junit-4.4.jar
cd ../..

# Go here for info about other jar files that you may want to put in there:
# http://ant.apache.org/manual/install.html#librarydependencies

# Become root
su

# Build and install it
./build.sh -Ddist.dir=/usr/local/ant dist

# Create a /etc/profile.d/ant.sh to set $ANT_HOME
cat > /etc/profile.d/ant.sh << EOF
#!/bin/sh
export ANT_HOME=/usr/local/ant
export PATH=\$PATH:\$ANT_HOME/bin
EOF
chmod 755 /etc/profile.d/ant.sh

# Become yourself again
exit

# Manually set ANT_HOME for your current shell
# (so you don't have to log out and in)
. /etc/profile.d/ant.sh

cd
mkdir -p -m 0700 installed
rm -f installed/apache-ant-*.tar.*
mv apache-ant-1.7.0-src.tar.bz2 installed/

Back to the list


Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>