makedeb


youtube-dl 2021.12.17-1


A command-line program to download videos from YouTube.com and a few more sites

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for youtube-dl.

# Maintainer: SZanko, szanko at protonmail dot com
# Contributor: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contriubtor: Daniel M. Capella <polyzen@archlinux.org>
# Contributor: Eric BĂ©langer <eric@archlinux.org>

pkgname=youtube-dl
pkgver=2021.12.17
pkgrel=1
pkgdesc="A command-line program to download videos from YouTube.com and a few more sites"
arch=('any')
url="https://ytdl-org.github.io/youtube-dl/"
license=('custom')
depends=('python3')
makedepends=('python3-setuptools')
optdepends=('ffmpeg: for video post-processing'
            'rtmpdump: for rtmp streams support'
            'atomicparsley: for embedding thumbnails into m4a files'
            'python3-pycryptodome: for hlsnative downloader')
#source=("https://github.com/ytdl-org/${pkgname}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.gz"{,.sig})
source=("https://github.com/ytdl-org/${pkgname}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('9f3b99c8b778455165b4525f21505e86c7ff565f3ac319e19733d810194135df')
#            'SKIP')
#validpgpkeys=('ED7F5BF46B3BBED81C87368E2C393E0F18A9236D') # Sergey M. <dstftw@gmail.com>

prepare() {
  cd ${pkgname}
  sed -i 's|etc/bash_completion.d|share/bash-completion/completions|' setup.py
  sed -i 's|etc/fish/completions|share/fish/vendor_completions.d|' setup.py
}

build() {
  cd ${pkgname}
  python3 setup.py build
}

package() {
  cd ${pkgname}
  export PYTHONHASHSEED=0
  python3 setup.py install --root="${pkgdir}/" --optimize=1 --skip-build --install-layout=deb
  mv "${pkgdir}/usr/share/bash-completion/completions/${pkgname}.bash-completion" \
      "${pkgdir}/usr/share/bash-completion/completions/${pkgname}"
  install -Dm644 ${pkgname}.zsh "${pkgdir}/usr/share/zsh/site-functions/_${pkgname}"
  mv LICENSE copyright
  install -Dm644 -t "${pkgdir}/usr/share/doc/${pkgname}" copyright
}