archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / sd / trunk / PKGBUILD
blobd92394c4cec1ccf1045464f4fc839df7125214c2
1 # Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
2 # Contributor: Wesley Moore <wes@wezm.net>
3 pkgname=sd
4 pkgver=0.7.6
5 pkgrel=2
6 pkgdesc='Intuitive find & replace'
7 arch=('x86_64')
8 url="https://github.com/chmln/sd"
9 license=('MIT')
10 depends=('gcc-libs')
11 makedepends=('rust')
12 source=("$pkgname-$pkgver.tar.gz::https://github.com/chmln/sd/archive/v${pkgver}.tar.gz")
13 sha256sums=('faf33a97797b95097c08ebb7c2451ac9835907254d89863b10ab5e0813b5fe5f')
15 build() {
16   cd "$pkgname-$pkgver"
18   cargo build --release --locked
21 check() {
22   cd "$pkgname-$pkgver"
23   cargo test --release --locked
26 package() {
27   install -Dm755 "$pkgname-$pkgver/target/release/$pkgname" "$pkgdir/usr/bin/$pkgname"
28   install -Dm644 "$pkgname-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
30   cd $pkgname-$pkgver/target/release/build
32   # Find and package the man page (because cargo --out-dir is too new)
33   find . -name sd.1 -type f -exec install -Dm644 {} "$pkgdir/usr/share/man/man1/sd.1" \;
35   # Find and package the bash completion file
36   find . -name sd.bash -type f -exec install -Dm644 {} "$pkgdir/usr/share/bash-completion/completions/sd" \;
38   # Find and package the zsh completion file (not in zsh-completions yet)
39   find . -name _sd -type f -exec install -Dm644 {} "$pkgdir/usr/share/zsh/site-functions/_sd" \;
41   # Find and package the fish completion file
42   find . -name sd.fish -type f -exec install -Dm644 {} "$pkgdir/usr/share/fish/vendor_completions.d/sd.fish" \;