blob: 17fcf1c65ae03e5f2be5096eb34347f515163eb7 (
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
|
# Maintainer: devome <evinedeng@hotmail.com>
pkgname="backrest"
pkgver=1.6.2
pkgrel=1
pkgdesc="A web UI and orchestrator for restic backup."
arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64' 'riscv64')
url="https://github.com/garethgeorge/${pkgname}"
license=("GPL-3.0-or-later")
depends=("restic")
makedepends=("npm" "go")
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz"
"${pkgname}@.service")
sha256sums=('8d02da83b360a196624427cfe39d6f14fa3e5e5a34497fe6dac4a1ee72869d0b'
'54d7ceddc2d3abb1c00a3f45ff7dd43b5fdc05c6be1019ead7f7cbf4a40ab926')
build() {
export BACKREST_BUILD_VERSION="${pkgver}"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
cd "${pkgname}-${pkgver}"
go mod tidy
npm --prefix webui install
npm --prefix webui run build
find webui/dist -type f -name '*.map' -exec rm {} \;
go build -trimpath -ldflags="-s -w -extldflags '${LDFLAGS}'" -o "${pkgname}" ./cmd/"${pkgname}"
}
package() {
install -Dm644 "${pkgname}@.service" -t "${pkgdir}/usr/lib/systemd/system"
cd "${pkgname}-${pkgver}"
install -Dm755 "${pkgname}" -t "${pkgdir}/usr/bin"
install -Dm644 {README,CHANGELOG}.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}
|