APKBUILD 1.64 KB
Newer Older
Steeve Chailloux's avatar
Steeve Chailloux committed
1
# Contributor: Steeve Chailloux <steeve@chaahk.com>
2 3
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
Steeve Chailloux's avatar
Steeve Chailloux committed
4
pkgname=apache-ant
5
pkgver=1.10.1
6
pkgrel=0
Steeve Chailloux's avatar
Steeve Chailloux committed
7 8
pkgdesc="A java-based build tool."
url="http://ant.apache.org/"
9
arch="noarch"
10
license="Apache-2.0"
11
depends="openjdk8-jre-base"
12
makedepends=""
13 14
source="http://archive.apache.org/dist/ant/binaries/$pkgname-$pkgver-bin.tar.bz2"
builddir="$srcdir/$pkgname-$pkgver"
Steeve Chailloux's avatar
Steeve Chailloux committed
15

16
_anthome="/usr/share/java/$pkgname"
Steeve Chailloux's avatar
Steeve Chailloux committed
17 18

build() {
19 20 21
	cd "$builddir"

	cat > $pkgname.sh <<-EOF
22 23
	ANT_HOME="$_anthome"
	export ANT_HOME
24
	EOF
Steeve Chailloux's avatar
Steeve Chailloux committed
25 26 27
}

package() {
28
	local destdir="$pkgdir/$_anthome"
Steeve Chailloux's avatar
Steeve Chailloux committed
29

30
	cd "$builddir"
Steeve Chailloux's avatar
Steeve Chailloux committed
31

32 33 34
	install -dm755 "$destdir"/bin
	rm bin/*.bat bin/*.cmd
	install -m755 bin/* "$destdir"/bin || return 1
Steeve Chailloux's avatar
Steeve Chailloux committed
35

36 37
	install -dm755 "$pkgdir"/usr/bin
	ln -sf $_anthome/bin/ant "$pkgdir"/usr/bin/ant || return 1
Steeve Chailloux's avatar
Steeve Chailloux committed
38

39
	cp -r etc "$destdir"/ || return 1
Steeve Chailloux's avatar
Steeve Chailloux committed
40

41 42 43 44 45 46 47 48 49 50 51 52 53
	install -dm755 "$destdir"/lib
	install -m644 lib/*.jar "$destdir"/lib || return 1

	# symlink to junit so it's on the javac build path for ant
	# matches behavior on ubuntu 9 and makes sense for compatibility
	# http://bugs.archlinux.org/task/15229
	ln -sf ../../junit.jar "$destdir"/lib/junit.jar || return 1

	# The license says the NOTICE file should be redistributed for
	# derivative works, so lets supply it.
	local file; for file in LICENSE NOTICE; do
		install -m644 -D $file "$pkgdir"/usr/share/licenses/$pkgname/$file || return 1
	done
Steeve Chailloux's avatar
Steeve Chailloux committed
54

55
	install -m644 -D $pkgname.sh "$pkgdir"/etc/profile.d/$pkgname.sh
Steeve Chailloux's avatar
Steeve Chailloux committed
56 57
}

58
sha512sums="91992ae8ed122be8d5a6cc423149a8d0cef4e49ada60691c4802eab44bf65dc4d14b9cdfde61b3d4b705a24c7cdc8ab62502f93b4b8a1cbf0b3ffa580ff23738  apache-ant-1.10.1-bin.tar.bz2"