summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: aae249fdd4cbd8f023d7e247bf345d9e1968aed0 (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
# Maintainer: Salama <salama@salama.xyz>
# Contributor: skydrome <skydrome@mail.i2p>
# Contributor: Artyom Olshevskiy <siasia@siasia>

pkgname=java-service-wrapper
pkgver=3.5.59
pkgrel=1
pkgdesc="Enables a Java Application to be run as a Windows Service or Unix Daemon"
url="https://wrapper.tanukisoftware.com/doc/english/introduction.html"
arch=('i686' 'x86_64' 'aarch64' 'armv6h' 'armv7h')
license=('GPL2' 'custom:tanuki-community')
makedepends=('ant' 'java-environment>=8')
source=("https://wrapper.tanukisoftware.com/download/${pkgver}/wrapper_${pkgver}_src.tar.gz")
sha256sums=('3b47e7facdd1208ae2570eac301da748a006b551744f3e8db3825bf4ea5c6e06')

prepare() {
    cd "wrapper_${pkgver}_src"

    # Prevent building the testsuite on x64, this requires the cunit pkg
    # from the AUR, its a pain to require just for building
    sed -i "src/c/Makefile-linux-x86"*.make \
        -e '/all:/s/ testsuite//'

    # Hide deprecation warning
    sed -i "build.xml" \
        -e '/deprecation=/s/"on"/"off"/'
}

build() {
    cd "wrapper_${pkgver}_src"

    source /etc/ant.conf
    source /etc/profile
    export JAVA_HOME="${JAVA_HOME:-/usr/lib/jvm/default}"

    [[ "$CARCH" = @(x86_64|aarch64) ]] && _bits=64 || _bits=32

    ant -Dfile.encoding=UTF-8 -Djavac.target.version=8 -Dbits="$_bits" \
        jar compile-c-unix
}

package() {
    cd "wrapper_${pkgver}_src"
    install -Dm755 bin/wrapper       "${pkgdir}/usr/bin/java-service-wrapper"
    install -Dm644 lib/libwrapper.so "${pkgdir}/usr/lib/java-service-wrapper/libwrapper.so"
    install -Dm644 lib/wrapper.jar   "${pkgdir}/usr/share/java/wrapper-${pkgver}.jar"
    install -Dm644 doc/wrapper-community-license*.txt "${pkgdir}/usr/share/licenses/java-service-wrapper/LICENSE"
    ln -s /usr/share/java/wrapper-${pkgver}.jar "${pkgdir}/usr/share/java/wrapper.jar"
}