summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0ff89fc32ed3234861ce13c1d013195e4a58eeba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# 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
}