aboutsummaryrefslogtreecommitdiffstats
path: root/testing/commons-daemon/APKBUILD
blob: 069d6cc612ee7049f5f3155e4d5eb92df90426df (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: TBK <alpine@jjtc.eu>
pkgname=commons-daemon
pkgver=1.1.0
pkgrel=0
pkgdesc="Tools to allow Java programs to run as UNIX daemons."
url="https://commons.apache.org/daemon/"
arch="all"
license="Apache-2.0"
options="!check" # can't get "ant test" to work correctly
depends="openjdk8-jre-base"
makedepends="apache-ant docbook2x linux-headers openjdk8" # update --with-java when bumping openjdk
subpackages="$pkgname-doc jsvc:_jsvc jsvc-doc:_jsvc_doc"
source="http://mirrors.dotsrc.org/apache/commons/daemon/source/commons-daemon-$pkgver-src.tar.gz"
builddir="$srcdir/$pkgname-$pkgver-src"

build() {
	# commons-daemon.jar + docs
	ant -Dcompile.source=1.6 -Dcompile.target=1.6 jar javadoc
	
	# jsvc
	cd "$builddir/src/native/unix"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--with-java=/usr/lib/jvm/java-1.8-openjdk \
		CFLAGS="-I/usr/lib/jvm/java-1.8-openjdk/include/linux"
	make

	# jsvc manpage
	db2x_xsltproc -s man man/jsvc.1.xml -o jsvc.1
	gzip -9 jsvc.1
}

package() {
	install -Dm644 dist/$pkgname-$pkgver.jar \
		"$pkgdir"/usr/share/java/$pkgname-$pkgver.jar
	ln -s $pkgname-$pkgver.jar "$pkgdir"/usr/share/java/$pkgname.jar
}

doc() {
	default_doc

	mkdir -p "$subpkgdir"/usr/share/doc/$pkgname
	cp -a "$builddir"/dist/docs/* "$subpkgdir"/usr/share/doc/$pkgname/
	cp -a "$builddir"/src/docs/* "$subpkgdir"/usr/share/doc/$pkgname/
	cp -a "$builddir"/src/samples "$subpkgdir"/usr/share/doc/$pkgname/
}

_jsvc() {
	pkgdesc="Executes classfile that implements a Daemon interface."
	url="https://commons.apache.org/proper/commons-daemon/jsvc.html"
	depends="$pkgname libcap"
	
	cd "$builddir/src/native/unix"
	install -Dm755 jsvc "$subpkgdir"/usr/bin/jsvc
}

_jsvc_doc() {
	cd "$builddir/src/native/unix"
	install -Dm644 jsvc.1.gz "$subpkgdir"/usr/share/man/man1/jsvc.1.gz
}

sha512sums="a370085a991cd6b121fcfb49822660dfc0aac19f164677dd2e6373750c1a526ef5a10334a8e075fd965c038198f6638b9e9130b5b13256f4a23a6c5a29959701  commons-daemon-1.1.0-src.tar.gz"