summaryrefslogtreecommitdiff
path: root/repo/maven/maven.xibuild
blob: 891578260413d489bd8c4f28828434648ef22f4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh

NAME="maven"
DESC="A Java project management and project comprehension tool."

MAKEDEPS=""

PKG_VER=3.8.6
pkgname="maven-${PKG_VER%%.*}"

SOURCE="https://archive.apache.org/dist/maven/maven-${PKG_VER%%.*}/$PKG_VER/binaries/apache-maven-$PKG_VER-bin.tar.gz"

package() {
	local m2_home="/usr/share/java/$pkgname"
	local destdir="${PKG_DEST}$m2_home"

	local dir; for dir in bin boot lib; do
		mkdir -p "$destdir/$dir"
	done

	install -m644 -Dt "$destdir"/bin ./bin/*.conf
	install -m644 -Dt "$destdir"/boot ./boot/*.jar
	install -m644 -Dt "$destdir"/lib ./lib/*.jar
	cp -Rp ./conf "$destdir"/

	mkdir -p "$PKG_DEST"/usr/bin

	local file; for file in mvn mvnDebug mvnyjp; do
		install -m755 -Dt "$destdir"/bin ./bin/$file
		ln -sf "$m2_home"/bin/$file "$PKG_DEST"/usr/bin/$file
	done

	mkdir "$PKG_DEST"/etc
	cat > "$PKG_DEST"/etc/mavenrc <<-EOF
		M2_HOME="$m2_home"
		MAVEN_OPTS="\$MAVEN_OPTS -Xmx512m"
	EOF
}