summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9b3cafa26eda83147b2109cc8d99e9eef5aeaafc (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
66
67
68
69
70
71
72
73
74
75
76
77
78
# Maintainer: Donien <donien.96@hotmail.com>

pkgbase="icingadb"
pkgname=(
    "icingadb"
    "icingadb-migrate"
)
pkgver="1.2.0"
pkgrel=2
epoch=0
pkgdesc="Icinga configuration and state database supporting multiple environments"
arch=(
    "x86_64"
    "aarch64"
)
url="https://github.com/Icinga/icingadb"
license=("GPL")
groups=()
depends=()
makedepends=(
    "go"
)
optdepends=()
provides=(
    "icingadb"
    "icingadb-migrate"
)
conflicts=()
replaces=()
backup=(
    "etc/icingadb/config.yml"
)
options=()
install="icingadb.install"
changelog="icingadb.changelog"
source=(
    "https://github.com/Icinga/${pkgbase}/archive/refs/tags/v${pkgver}.tar.gz"
    "icingadb.sysusers"
    "icingadb.service"
)
noextract=()
sha256sums=(
    "f3452f796a471e848c2e51d2820444df8907be7f972cdd139e2abcd6f66a4890"
    "SKIP"
    "SKIP"
)



build() {
    cd "${srcdir}/${pkgbase}-${pkgver}"
    go build -buildvcs=false -trimpath -o icingadb ./cmd/icingadb
    go build -buildvcs=false -trimpath -o icingadb-migrate ./cmd/icingadb-migrate
}

package_icingadb() {
    install -dm700                                                     "${pkgdir}/etc/icingadb"
    install -Dm600 "${srcdir}/${pkgbase}-${pkgver}/config.example.yml" "${pkgdir}/etc/icingadb/config.yml"
    install -Dm755 "${srcdir}/${pkgbase}-${pkgver}/icingadb"           "${pkgdir}/usr/bin/icingadb"

    install -Dm644 "${srcdir}/icingadb.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgbase}.conf"
    install -Dm644 "${srcdir}/icingadb.service"  "${pkgdir}/usr/lib/systemd/system/${pkgbase}.service"

    install -Dm644 "${srcdir}/${pkgbase}-${pkgver}/LICENSE" "${pkgdir}/usr/share/licenses/icingadb/LICENSE"

    install -dm755 "${pkgdir}/usr/share/icingadb"
    cp -r "${srcdir}/${pkgbase}-${pkgver}/schema" "${pkgdir}/usr/share/icingadb/"
}

package_icingadb-migrate() {
    install -dm700                                                                     "${pkgdir}/etc/icingadb"
    install -Dm600 "${srcdir}/${pkgbase}-${pkgver}/doc/icingadb-migration.example.yml" "${pkgdir}/etc/icingadb/icingadb-migration.yml"
    install -Dm755 "${srcdir}/${pkgbase}-${pkgver}/icingadb-migrate"                   "${pkgdir}/usr/bin/icingadb-migrate"

    sed -i '1s|^|# Documentation: https://icinga.com/docs/icinga-db/latest/doc/06-Migration/#migration-from-ido\n\n|' "${pkgdir}/etc/icingadb/icingadb-migration.yml"

    install -Dm644 "${srcdir}/${pkgbase}-${pkgver}/LICENSE" "${pkgdir}/usr/share/licenses/icingadb-migrate/LICENSE"
}