blob: 34d128230f8a82e83537aa0c05dc76c2998f86bb (
plain)
1 # Description: Java project management and project comprehension tool
2 # URL: https://maven.apache.org/
3 # Maintainer: Tim Biermann, tbier at posteo dot de
4 # Depends on: openjdk17-jdk
5
6 name=maven
7 version=3.8.4
8 release=1
9 source=(https://www-eu.apache.org/dist/maven/maven-3/$version/source/apache-$name-$version-src.tar.gz)
10 bin_source=(https://archive.apache.org/dist/maven/maven-3/$version/binaries/apache-$name-$version-bin.tar.gz)
11 _bootstrapsum=2cdc9c519427bb20fdc25bef5a9063b790e4abd930e7b14b4e9f4863d6f9f13c
12
13 # bootstrap_mvn() {{{
14 bootstrap_mvn() {
15 # check if the binary is already available
16 if [ ! -f "$PKGMK_SOURCE_DIR/apache-$name-$version-bin.tar.gz" ];
17 then
18 wget $bin_source \
19 --output-document="$PKGMK_SOURCE_DIR/apache-$name-$version-bin.tar.gz"
20 fi
21
22 # check checksum of the binary package
23 if [ $_bootstrapsum != $(sha256sum \
24 "$PKGMK_SOURCE_DIR/apache-$name-$version-bin.tar.gz" | cut -d' ' \
25 -f1) ];
26 then
27 echo "Error Bootstrap file $PKGMK_SOURCE_DIR/apache-$name-$version-bin.tar.gz failed sha256sum"
28 exit $E_GENERAL
29 fi
30
31 mkdir binary
32 cd binary
33 bsdtar -xf "$PKGMK_SOURCE_DIR/apache-$name-$version-bin.tar.gz"
34
35 # append binary to our PATH
36 export PATH="$SRC/binary/apache-$name-$version/bin:${PATH}"
37 cd $SRC
38 }
39 # }}}
40 build() {
41 export PATH="/usr/lib/java/openjdk17-jdk/bin:${PATH}"
42
43 # if we don't have maven on our system already, bootstrap it
44 if [ ! -e "/usr/bin/mvn" ]; then
45 bootstrap_mvn
46 fi
47
48 cd apache-$name-$version
49
50 mvn -DdistributionTargetDir=$PKG/usr \
51 -Dproject.build.sourceEncoding=UTF-8 -e \
52 -Dmaven.repo.local=$PKGMK_SOURCE_DIR/maven-repo \
53 -DskipTests -Dmaven.test.skip=true \
54 install
55
56 find $PKG \( \
57 -iname "*readme*" -o \
58 -iname "*notice*" -o \
59 -iname "*license*" -o \
60 -iname "*licence*" \) -exec rm -fr '{}' \+
61 }
62 # vim: foldmethod=marker foldlevelstart=1
|