blob: 30c236513f247f22ff17369579ea37b95844ceb0 (
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: openjdk16-jdk
5
6 name=maven
7 version=3.8.3
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=0f1597d11085b8fe93d84652a18c6deea71ece9fabba45a02cf6600c7758fd5b
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/openjdk16-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
|