summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 63564df65077512755832511d10bc0a9ccca3af4 (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
# Maintainer: Integral <integral@member.fsf.org>
# Maintainer: cubercsl <2014cais01 at gmail dot com>

pkgname=daed-git
_pkgname=${pkgname%-git}
pkgver=0.7.0rc1.1.r0.g740cf42
pkgrel=2
pkgdesc="A modern dashboard for dae, bundled with dae-wing (backend API server) and dae (core)."
arch=('x86_64' 'aarch64')
url="https://github.com/daeuniverse/daed"
license=('AGPL-3.0-or-later AND MIT')
makedepends=('git' 'pnpm' 'clang' 'go')
provides=("${_pkgname}" "dae")
conflicts=("${_pkgname}" "dae")
source=("git+https://github.com/daeuniverse/${_pkgname}.git")
sha256sums=('SKIP')
install="${_pkgname}.install"
options=(!debug)

pkgver() {
	cd "${_pkgname}/"
	(
		set -o pipefail
		git describe --tags --long --match="v[0-9]*" --abbrev=7 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
			printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
	)
}

prepare() {
	cd "${_pkgname}/"
	git submodule update --init --recursive
}

build() {
	export GOFLAGS="-buildmode=pie -trimpath -modcacherw"
	export CFLAGS="-fno-stack-protector"
	cd "${_pkgname}/"
	make VERSION="unstable-${pkgver}"
}

package() {
	depends=(
		v2ray-geoip
		v2ray-domain-list-community
	)

	cd "${_pkgname}/"

	install -vDm755 "${_pkgname}" -t "${pkgdir}/usr/bin/"
	install -vDm644 "install/${_pkgname}.service" -t "${pkgdir}/usr/lib/systemd/system/"
	install -vDm644 "LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}/"
	install -d "${pkgdir}/etc/daed/"

	install -d "${pkgdir}/usr/share/daed"
	ln -vs "/usr/share/v2ray/geoip.dat" "${pkgdir}/usr/share/daed/geoip.dat"
	ln -vs "/usr/share/v2ray/geosite.dat" "${pkgdir}/usr/share/daed/geosite.dat"
}