summaryrefslogtreecommitdiff
path: root/pcr/apiguardian/PKGBUILD
blob: e5bfa482d2e35edc76cc932ac26f00d594574a1d (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
# Copyright (C) 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the CC0 1.0 License.
# Maintainers: Parabola hackers <dev@lists.parabola.nu>

pkgname=apiguardian
pkgver=1.1.2
pkgrel=2
pkgdesc='Java library that provides the `@API` annotation'
arch=('any')
url='https://apiguardian-team.github.io/apiguardian/docs/current/api/'
license=('Apache')
depends=('java-environment' 'java-runtime')
makedepends=('jh')
source=("https://github.com/${pkgname}-team/${pkgname}/archive/refs/tags/r${pkgver}.tar.gz")
sha512sums=('7c56ee15e0aba07e95b6f2fe7cedd98e449e774958eb63b2467066c381e1e82ad67c982c2885e18154c62e55fda80a1c2e0f689253afe449db9f7e7563122db6')

build() {
    cd "${srcdir}/${pkgname}-r${pkgver}"

    mkdir -p build/classes
    mkdir -p build/javadoc

    javac -d "build/classes" -encoding UTF-8 \
          "src/main/java/org/${pkgname}/api/API.java"

    javadoc -d build/javadoc/ \
            -sourcepath  src/main/java/ \
            -encoding UTF-8 \
            org.apiguardian.api

    jar -cvf "${pkgname}.jar" -C build/classes .
}

package() {
    cd "${srcdir}/${pkgname}-r${pkgver}"

    # Install license file
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"

    # Install documentation
    install -d "${pkgdir}/usr/share/doc/${pkgname}"
    cp -r build/javadoc "${pkgdir}/usr/share/doc/${pkgname}"

    # Install Maven artifacts
    export DESTDIR=${pkgdir}
    jh mvn-install "org.apiguardian.api" "${pkgname}" ${pkgver} \
                   pom.xml "${pkgname}.jar" "${pkgname}.jar"

    ln -s "/usr/share/java/${_libname}.jar" \
          "$pkgdir/usr/share/java/${_libname}-$pkgver.jar"
}