summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a8dfccddaa2b093d6d7a8cb6e5129d5277f0ad5b (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
# Maintainer: Lari Tikkanen <lartza@wippies.com>

pkgname=youtube-dl-git
_gitname="youtube-dl"
pkgver=2020.03.24.r16.00eb865b3
pkgrel=1
pkgdesc="A small command-line program to download videos from YouTube.com and a few more sites (git version)"
arch=('any')
url="http://ytdl-org.github.io/youtube-dl/"
license=('custom')
depends=('python' 'python-setuptools')
makedepends=('git' 'pandoc')
optdepends=('ffmpeg: for video post-processing'
            'rtmpdump: for rtmp streams support'
            'atomicparsley: for embedding thumbnails into m4a files'
            'phantomjs: for openload support')
provides=("youtube-dl")
conflicts=("youtube-dl")
source=('git+https://github.com/ytdl-org/youtube-dl.git')
md5sums=('SKIP')

pkgver() {
  cd $_gitname
  printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}

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

build() {
  cd $_gitname
  make pypi-files zsh-completion
}

package() {
  cd $_gitname
  python setup.py install --root="${pkgdir}/" --optimize=1
  mv "${pkgdir}/usr/share/bash-completion/completions/youtube-dl.bash-completion" \
     "${pkgdir}/usr/share/bash-completion/completions/youtube-dl"
  install -Dm644 youtube-dl.zsh "${pkgdir}/usr/share/zsh/site-functions/_youtube-dl"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}