Date: Saturday, July 23, 2022 @ 06:51:05 Author: svenstaro Revision: 1255475
upgpkg: sd 0.7.6-2: Install shell completions & man page (FS#75307) Modified: sd/trunk/PKGBUILD ----------+ PKGBUILD | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2022-07-23 06:49:08 UTC (rev 1255474) +++ PKGBUILD 2022-07-23 06:51:05 UTC (rev 1255475) @@ -1,19 +1,20 @@ -# Maintainer: Sven-Hendrik Haase <svenst...@gmail.com> +# Maintainer: Sven-Hendrik Haase <svenst...@archlinux.org> # Contributor: Wesley Moore <w...@wezm.net> pkgname=sd pkgver=0.7.6 -pkgrel=1 +pkgrel=2 pkgdesc='Intuitive find & replace' arch=('x86_64') url="https://github.com/chmln/sd" license=('MIT') depends=('gcc-libs') -makedepends=('rust' 'cargo' 'git') +makedepends=('rust') source=("$pkgname-$pkgver.tar.gz::https://github.com/chmln/sd/archive/v${pkgver}.tar.gz") sha256sums=('faf33a97797b95097c08ebb7c2451ac9835907254d89863b10ab5e0813b5fe5f') build() { cd "$pkgname-$pkgver" + cargo build --release --locked } @@ -25,4 +26,18 @@ package() { install -Dm755 "$pkgname-$pkgver/target/release/$pkgname" "$pkgdir/usr/bin/$pkgname" install -Dm644 "$pkgname-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + + cd $pkgname-$pkgver/target/release/build + + # Find and package the man page (because cargo --out-dir is too new) + find . -name sd.1 -type f -exec install -Dm644 {} "$pkgdir/usr/share/man/man1/sd.1" \; + + # Find and package the bash completion file + find . -name sd.bash -type f -exec install -Dm644 {} "$pkgdir/usr/share/bash-completion/completions/sd" \; + + # Find and package the zsh completion file (not in zsh-completions yet) + find . -name _sd -type f -exec install -Dm644 {} "$pkgdir/usr/share/zsh/site-functions/_sd" \; + + # Find and package the fish completion file + find . -name sd.fish -type f -exec install -Dm644 {} "$pkgdir/usr/share/fish/vendor_completions.d/sd.fish" \; }