Files
LFSPkgBuilds/LFSPkgBuildScripts/devel/apache-ant/apache-ant.LFSBuild
2021-03-14 11:04:02 +00:00

68 lines
1.9 KiB
Bash
Executable File

#!/bin/bash -e
. /usr/share/LFSPkg/LFSFunctions
DEPENDS="OpenJDK-9.0.4 glib-2.66.7"
if ! lfspkg -B "$DEPENDS";then
exit 100
fi
PKGNAME="apache-ant"
TARNAME="$PKGNAME"
VERSION="1.10.6"
BUILD=${BUILD:-1}
SECTION="DEVEL"
SUFFIX="LFSPKG"
TARBALL="${TARNAME}-${VERSION}-src.tar.xz"
PKG="${OUTPUT}/${PKGNAME}"
DOWHAT=${1:-"build"}
CWD=$(pwd)
scriptLog "${PKGNAME}-${VERSION}"
gettar "http://archive.apache.org/dist/ant/source/${TARBALL}" $SECTION
#gettar "https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/javax/media/jai-core/1.1.3/jai-core-1.1.3.jar" $SECTION
#gettar "https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/com/sun/media/jai-codec/1.1.3/jai-codec-1.1.3.jar" $SECTION
#gettar "http://central.maven.org/maven2/org/tukaani/xz/1.0/xz-1.0.jar" $SECTION
#gettar "http://www.netrexx.org/files/NetRexx-3.06-GA.zip" $SECTION
rm -rf "$PKG" || true
mkdir -p "$PKG"
#make sure JAVA_HOME is set and exported ( best to do this in ~/.lfspkg.rc
pushd $COMPILEAT 2>/dev/null||true
extractarchive "${SOURCEARCHIVES}/${SECTION}/${TARBALL}"
pushd "${TARNAME}-${VERSION}"
. /etc/profile.d/openjdk.sh
sed -i 's/--add-modules java.activation/-html4/' build.xml
./bootstrap.sh
bootstrap/bin/ant -f fetch.xml -Ddest=optional || true
mkdir -vp $PKG/opt/ant-${VERSION}||true
./build.sh -Ddist.dir=$PKG/opt/ant-${VERSION} dist
ln -sfv ant-${VERSION} $PKG/opt/ant
popd
checketc $PKG
packageclean "$PKG" "$CWD"
pushd "$PKG"
lfspkg -n "$PKGNAME" -p "$VERSION" -d $SECTION -b $BUILD -s $SUFFIX -m
popd
case $DOWHAT in
up*)
lfspkg "^${PKGNAME}-[0-9][0-9]*" "${PKGARCHIVES}/${SECTION}/${PKGNAME}-${VERSION}-${BUILD}_${SECTION}_${SUFFIX}.tar.gz" -u
;;
"install")
lfspkg "${PKGARCHIVES}/${SECTION}/${PKGNAME}-${VERSION}-${BUILD}_${SECTION}_${SUFFIX}.tar.gz" -i
;;
"build")
echo "Just built"
;;
*)
echo "*** Unknown command ***"
exit 1
esac
rm -r "$PKG" "${TARNAME}-${VERSION}"
popd 2>/dev/null||true