aboutsummaryrefslogtreecommitdiffstats
path: root/community/commons-daemon/APKBUILD
blob: 57c7216342105618f7a94ba4f0cef7ec4244fed5 (plain) (blame)
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
66
67
68
69
70
# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: TBK <alpine@jjtc.eu>
pkgname=commons-daemon
pkgver=1.3.0
pkgrel=0
pkgdesc="Tools to allow Java programs to run as UNIX daemons"
url="https://commons.apache.org/daemon/"
# riscv64 blocked by java-jdk
arch="all !riscv64"
license="Apache-2.0"
options="!check" # No test suite
depends="java-jre-headless"
makedepends="docbook2x libcap-dev linux-headers maven java-jdk"
subpackages="$pkgname-doc jsvc:_jsvc jsvc-doc:_jsvc_doc"
source="https://mirrors.dotsrc.org/apache/commons/daemon/source/commons-daemon-$pkgver-src.tar.gz
	rat_workaround.patch
	"
builddir="$srcdir/$pkgname-$pkgver-src"

build() {
	# commons-daemon.jar
	mvn install -DskipTests=true -Dmaven.javadoc.skip=false -B

	# jsvc
	cd "$builddir/src/native/unix"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--with-java=/usr/lib/jvm/default-jvm \
		CFLAGS="$CFLAGS -I/usr/lib/jvm/default-jvm/include/linux"
	make

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

package() {
	install -Dm644 target/$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"/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="
392ae1a4f36294c31f8f549c61bdf0a9fcd59a1e4eee3c54ceba30473066184271636b11ee6073526640c245d3f3a94d1d4d34413787c5b3323e6eedc7026816  commons-daemon-1.3.0-src.tar.gz
3e64d521e8ed7c6a1ff6b67911087e6553edddbd847c13633ec773cfcdc5486ddd24d9e6a518493bef1855741445bb92d149d8bfdd2d5fb1ae6af4ad4d211426  rat_workaround.patch
"