aboutsummaryrefslogblamecommitdiffstats
path: root/community/commons-daemon/APKBUILD
blob: b936a948091afad225209896bc68c7338d50f981 (plain) (tree)
1
2
3
4
5
6
7
8
9


                                   
            
        
                                                             
                                        
                        
                    
                                
                           
                                                                                                         
                                                        


                                                                                                 


                                       


                                                                  






                                                           
                                                                              







                                                     
                                                    







                                                                        







                                                                          
 








                                                                          
                                                                                                                                                                             
                                                                                                                                                       
# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: TBK <alpine@jjtc.eu>
pkgname=commons-daemon
pkgver=1.2.3
pkgrel=0
pkgdesc="Tools to allow Java programs to run as UNIX daemons"
url="https://commons.apache.org/daemon/"
arch="all !mips !mips64"
license="Apache-2.0"
options="!check" # No test suite
depends="openjdk8-jre-base"
makedepends="docbook2x libcap-dev linux-headers maven openjdk8" # update --with-java when bumping openjdk
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/java-1.8-openjdk \
		CFLAGS="$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 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="ddce2b90bd847f584f1d2207c5ed70b1554b9aa3a579821724a4e37d4bbaaf47425b85779216b449ee58ec9fdd38f4f3930080c8971febc7fca39dd3e73ace61  commons-daemon-1.2.3-src.tar.gz
1ede66e199e82bb788280159be238fba5d1e405c6f01b8123486397f5cc010b48df023c6a799a53de3e09c128a69842c4c2ff5adf735f0ae253ccec4eac28a5d  rat_workaround.patch"