contrib/maven/Pkgfile

63 lines
1.8 KiB
Plaintext

# Description: Java project management and project comprehension tool
# URL: https://maven.apache.org/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: openjdk17-jdk
name=maven
version=3.8.6
release=1
source=(https://www-eu.apache.org/dist/maven/maven-3/$version/source/apache-$name-$version-src.tar.gz)
bin_source=(https://archive.apache.org/dist/maven/maven-3/$version/binaries/apache-$name-$version-bin.tar.gz)
_bootstrapsum=c7047a48deb626abf26f71ab3643d296db9b1e67f1faa7d988637deac876b5a9
# bootstrap_mvn() {{{
bootstrap_mvn() {
# check if the binary is already available
if [ ! -f "$PKGMK_SOURCE_DIR/apache-$name-$version-bin.tar.gz" ];
then
wget $bin_source \
--output-document="$PKGMK_SOURCE_DIR/apache-$name-$version-bin.tar.gz"
fi
# check checksum of the binary package
if [ $_bootstrapsum != $(sha256sum \
"$PKGMK_SOURCE_DIR/apache-$name-$version-bin.tar.gz" | cut -d' ' \
-f1) ];
then
echo "Error Bootstrap file $PKGMK_SOURCE_DIR/apache-$name-$version-bin.tar.gz failed sha256sum"
exit $E_GENERAL
fi
mkdir binary
cd binary
bsdtar -xf "$PKGMK_SOURCE_DIR/apache-$name-$version-bin.tar.gz"
# append binary to our PATH
export PATH="$SRC/binary/apache-$name-$version/bin:${PATH}"
cd $SRC
}
# }}}
build() {
export PATH="/usr/lib/java/openjdk17-jdk/bin:${PATH}"
# if we don't have maven on our system already, bootstrap it
if [ ! -e "/usr/bin/mvn" ]; then
bootstrap_mvn
fi
cd apache-$name-$version
mvn -DdistributionTargetDir=$PKG/usr \
-Dproject.build.sourceEncoding=UTF-8 -e \
-Dmaven.repo.local=$PKGMK_SOURCE_DIR/maven-repo \
-DskipTests -Dmaven.test.skip=true \
install
find $PKG \( \
-iname "*readme*" -o \
-iname "*notice*" -o \
-iname "*license*" -o \
-iname "*licence*" \) -exec rm -fr '{}' \+
}
# vim: foldmethod=marker foldlevelstart=1