lure-repo/bat/lure.sh

32 lines
1.3 KiB
Bash
Raw Normal View History

2022-11-19 23:06:38 -06:00
name='bat'
2022-11-20 00:39:12 -06:00
version=auto
2022-11-19 23:06:38 -06:00
release=1
desc='A cat(1) clone with syntax highlighting and Git integration'
homepage='https://github.com/sharkdp/bat'
architectures=('amd64')
2022-11-20 00:12:51 -06:00
maintainer='SinTan1729'
2022-11-19 23:06:38 -06:00
license=('APACHE-2.0' 'MIT')
provides=('bat')
2022-11-20 00:44:11 -06:00
conflicts=('bat')
2022-11-20 00:35:57 -06:00
git_repo="sharkdp/bat"
2022-11-19 23:06:38 -06:00
sources=()
checksums=()
version() {
2022-11-20 00:35:57 -06:00
printf "$(curl --silent "https://api.github.com/repos/${git_repo}/releases/latest" | grep -Eo '"tag_name": "v(.*)"' | sed -E 's/.*"([^"]+)".*/\1/')"
2022-11-19 23:06:38 -06:00
}
package() {
2022-11-20 00:39:12 -06:00
vers="$(curl --silent "https://api.github.com/repos/${git_repo}/releases/latest" | grep -Eo '"tag_name": "v(.*)"' | sed -E 's/.*"([^"]+)".*/\1/')"
echo Installing ${name} ${vers}
curl -L "https://github.com/${git_repo}/releases/download/${vers}/${name}-${vers}-x86_64-unknown-linux-musl.tar.gz" -o ${name}.tar.gz
2022-11-20 00:35:57 -06:00
tar xzvf "${name}.tar.gz" -C .
2022-11-20 00:39:12 -06:00
cd "./${name}-${vers}-x86_64-unknown-linux-musl"
2022-11-20 00:35:57 -06:00
install -Dm755 "./${name}" "${pkgdir}/usr/local/bin/${name}"
install -Dm644 "./${name}.1" "${pkgdir}/usr/local/share/man/man1/${name}.1"
install -Dm644 "./autocomplete/${name}.fish" "${pkgdir}/usr/share/fish/completions/${name}.fish"
install -Dm644 "./autocomplete/${name}.zsh" "${pkgdir}/usr/share/zsh/site-functions/_${name}"
install -Dm644 "./autocomplete/${name}.bash" "${pkgdir}/usr/share/bash-completion/completions/${name}"
2022-11-19 23:06:38 -06:00
}
2022-11-20 00:44:11 -06:00