-
Notifications
You must be signed in to change notification settings - Fork 1
/
PKGBUILD.local
48 lines (38 loc) · 1.33 KB
/
PKGBUILD.local
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
# Maintainer: Bhanupong Petchlert <bpetlert@gmail.com>
pkgname=networkd-broker
pkgver=1.1.1
pkgrel=1
pkgdesc="An event broker daemon for systemd-networkd"
arch=('x86_64')
url="https://github.com/bpetlert/networkd-broker"
license=('GPL-3.0-or-later')
depends=('dbus')
makedepends=(cargo)
options=(!lto)
# Build from local directory
source=()
# Using the most recent annotated tag reachable from the last commit.
pkgver() {
cd "${startdir}"
git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
cd "${startdir}"
export RUSTUP_TOOLCHAIN=stable
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}
build() {
cd "${startdir}"
export RUSTUP_TOOLCHAIN=stable
# Ignore target-dir in ~/.cargo/config, reset it to default: "target".
# Add "${srcdir}" to support BUILDDIR variable in makepkg.
export CARGO_TARGET_DIR=${srcdir}/target
cargo build --frozen --release
}
package() {
cd "${srcdir}"
install -Dm755 "target/release/networkd-broker" "${pkgdir}/usr/bin/networkd-broker"
install -Dm644 "${startdir}/networkd-broker.service" "${pkgdir}/usr/lib/systemd/system/networkd-broker.service"
install -dm755 "${pkgdir}/etc/networkd/broker.d/"{carrier.d,degraded.d,dormant.d,no-carrier.d,off.d,routable.d}
install -Dm644 "${startdir}/README.adoc" "${pkgdir}/usr/share/doc/${pkgname}/README.adoc"
}