termux-packages/packages/youtubedr/build.sh

49 lines
1.6 KiB
Bash
Raw Normal View History

2020-05-09 12:52:19 +02:00
TERMUX_PKG_HOMEPAGE=https://github.com/kkdai/youtube
TERMUX_PKG_DESCRIPTION="Download youtube video in Golang"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="Krishna kanhaiya @kcubeterm"
TERMUX_PKG_VERSION=2.7.10
TERMUX_PKG_REVISION=1
2020-05-09 12:52:19 +02:00
TERMUX_PKG_SRCURL=https://github.com/kkdai/youtube/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=04a4f0b745094884fb2902945ac3b1c966fbe4fbd67a027cb482d491662900f9
TERMUX_PKG_AUTO_UPDATE=true
2020-05-09 12:52:19 +02:00
termux_step_make() {
termux_setup_golang
2020-05-09 12:52:19 +02:00
cd "$TERMUX_PKG_SRCDIR"
export GOPATH="${TERMUX_PKG_BUILDDIR}"
mkdir -p "${GOPATH}/src/github.com/kkdai/"
cp -a "${TERMUX_PKG_SRCDIR}" "${GOPATH}/src/github.com/kkdai/youtube"
cd "${GOPATH}/src/github.com/kkdai/youtube/"
go get -d -v
2020-08-15 14:17:54 +02:00
cd cmd/youtubedr
go build .
2020-05-09 12:52:19 +02:00
}
termux_step_make_install() {
2020-08-15 14:17:54 +02:00
install -Dm700 -t "$TERMUX_PREFIX"/bin "$GOPATH"/src/github.com/kkdai/youtube/cmd/youtubedr/youtubedr
2020-05-09 12:52:19 +02:00
}
termux_step_create_debscripts() {
cat <<-EOF >./postinst
#!${TERMUX_PREFIX}/bin/sh
mkdir -p ${TERMUX_PREFIX}/share/bash-completion/completions
mkdir -p ${TERMUX_PREFIX}/share/zsh/site-functions
mkdir -p ${TERMUX_PREFIX}/share/fish/vendor_completions.d
youtubedr completion bash > ${TERMUX_PREFIX}/share/bash-completion/completions/youtubedr
youtubedr completion zsh > ${TERMUX_PREFIX}/share/zsh/site-functions/_youtubedr
youtubedr completion fish > ${TERMUX_PREFIX}/share/fish/vendor_completions.d/youtubedr.fish
EOF
cat <<-EOF >./prerm
#!${TERMUX_PREFIX}/bin/sh
rm -f ${TERMUX_PREFIX}/share/bash-completion/completions/youtubedr
rm -f ${TERMUX_PREFIX}/share/zsh/site-functions/_youtubedr
rm -f ${TERMUX_PREFIX}/share/fish/vendor_completions.d/youtubedr.fish
EOF
}