summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4c3a68c7cd5d1d2c668b3f6a7d2d247e2e29b9bf (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
# Maintainer: Grzegorz Baranski <root@gbaranski.com>

_pkgname=houseflow-server
pkgname="${_pkgname}-git"
workspace=server
pkgver=0.5.0
pkgrel=6
pkgdesc="Home automation platform, written in Rust. Server only"
arch=(
    'x86_64'
    'arm'
    'armv6h'
    'armv7h'
    'aarch64'
    'i686'
)
url="https://github.com/gbaranski/houseflow"
license=('GPL-3.0')
makedepends=(
    'git'
    'rust'
    'cargo'
)
source=(
	"${_pkgname}::git+https://github.com/gbaranski/houseflow"
	service
)
sha256sums=(
	'SKIP'
	'SKIP'
)
provides=("${_pkgname}")
conflicts=("${_pkgname}")

pkgver() {
    cd "${_pkgname}/${workspace}"
    git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    cd "${_pkgname}/${workspace}"
    cargo build --release --locked
}

check() {
    cd "${_pkgname}/${workspace}"
    cargo test --release --locked
}

prepare() {
    cd "${_pkgname}/${workspace}"
    cargo fetch --locked
}

package() {
    cd "${_pkgname}"
    install -Dm 755 "target/release/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
    install -Dm 755 "LICENSE" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
    install -Dm 644 "$srcdir"/service "$pkgdir/usr/lib/systemd/system/houseflow-server.service"
}