diff options
author | Jiuyang Liu | 2022-11-10 13:43:16 +0800 |
---|---|---|
committer | Jiuyang Liu | 2022-11-10 13:54:10 +0800 |
commit | 2a34035e9eff66e4d3f1df7d890bcc3992bf28ef (patch) | |
tree | a148a2eb523d84572b2a95d77db7cea0e331d48c /PKGBUILD | |
download | aur-nsncd-git.tar.gz |
init
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..7f060c672fb8 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,43 @@ +# Maintainer: Jiuyang Liu <liu@jiuyang.me> + +_pkgname=nsncd +pkgname=nsncd-git +pkgver=r89.82dd540 +pkgrel=1 +pkgdesc='nscd-compatible daemon that proxies lookups, without caching.' +arch=('x86_64') +url='https://github.com/twosigma/nsncd' +license=('MIT') +makedepends=('git' 'cargo') +options=('!lto') +source=("$_pkgname::git+$url.git") +b2sums=('SKIP') + +pkgver() { + cd "$_pkgname" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "$_pkgname" + cargo fetch --locked --target "$CARCH-unknown-linux-gnu" +} + +build() { + cd "$_pkgname" + cargo build --frozen --release --all-features +} + +package() { + cd "$_pkgname" + + # binary + install -vDm755 -t "$pkgdir/usr/bin" "target/release/$_pkgname" + + # license + install -vDm644 -t "$pkgdir/usr/share/licenses/$_pkgname" LICENSE + + # systemd + install -vDm644 $_pkgname.service "$pkgdir/usr/lib/systemd/system/$_pkgname.service" + sed -i "s:^ExecStart.*:ExecStart=/usr/bin/$_pkgname:" "$pkgdir/usr/lib/systemd/system/$_pkgname.service" +} |