lure-repo/lf/lure.sh

40 lines
1.7 KiB
Bash
Raw Normal View History

2022-11-20 02:37:22 -06:00
name='lf'
version=VERSION
release=1
desc='A terminal file manager written in Go'
homepage='https://github.com/gokcehan/lf'
architectures=('amd64')
maintainer='SinTan1729'
license=('MIT')
provides=('lf')
conflicts=('lf')
2022-11-20 14:48:47 -06:00
git_repo='gokcehan/lf'
2022-11-20 02:37:22 -06:00
sources=()
checksums=()
version() {
2022-11-20 02:40:25 -06:00
printf "$(curl --silent "https://api.github.com/repos/${git_repo}/releases/latest" | grep -Eo '"tag_name": "(r.*)"' | sed -E 's/.*"([^"]+)".*/\1/')"
2022-11-20 02:37:22 -06:00
}
package() {
2022-11-21 23:57:28 -06:00
# Pull sources
echo Pulling ${name} ${version}
2022-11-22 00:52:56 -06:00
curl -L "https://github.com/${git_repo}/releases/latest/download/${name}-linux-${ARCH}.tar.gz" -o ${name}.tar.gz
2022-11-20 13:25:48 -06:00
curl -L "https://raw.githubusercontent.com/${git_repo}/master/${name}.1" -o ${name}.1
2022-11-20 15:03:42 -06:00
command -v fish &> /dev/null && curl -L "https://raw.githubusercontent.com/${git_repo}/master/etc/${name}.fish" -o ${name}.fish
command -v zsh &> /dev/null && curl -L "https://raw.githubusercontent.com/${git_repo}/master/etc/${name}.zsh" -o ${name}.zsh
command -v bash &> /dev/null && curl -L "https://raw.githubusercontent.com/${git_repo}/master/etc/${name}.bash" -o ${name}.bash
2022-11-21 23:57:28 -06:00
# Build package
echo Creating the package
tar -xzf "${name}.tar.gz" -C .
# Binary
2022-11-20 02:37:22 -06:00
install -Dm755 "./${name}" "${pkgdir}/usr/local/bin/${name}"
2022-11-21 23:57:28 -06:00
# Manpage
2022-11-20 13:25:48 -06:00
install -Dm644 "./${name}.1" "${pkgdir}/usr/local/share/man/man1/${name}.1"
2022-11-21 23:57:28 -06:00
# Autocomplete
2022-11-20 15:03:42 -06:00
command -v fish &> /dev/null && install -Dm644 "./${name}.fish" "${pkgdir}/usr/share/fish/completions/${name}.fish"
command -v zsh &> /dev/null && install -Dm644 "./${name}.zsh" "${pkgdir}/usr/share/zsh/site-functions/_${name}"
command -v bash &> /dev/null && install -Dm644 "./${name}.bash" "${pkgdir}/usr/share/bash-completion/completions/${name}"
2022-11-20 02:37:22 -06:00
}