summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8fbddc12381ffd532698e42dc4d2623cb5e8c985 (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
47
48
49
50
51
# Maintainer  : flu
# Contributor : Frederic Bezies <fredbezies at gmail dot com>
# Contributor : baskerville <nihilhill at gmail dot com>
# Contributor : Smola
# Contributor : yan12125

_name=youtube-dl
_branch=master

pkgname=$_name-git
pkgver=2016.03.26.e68d3a0
pkgrel=1

pkgdesc='A small command-line program to download videos from YouTube.com and a few more sites - git version'
url="http://rg3.github.io/youtube-dl"
arch=('any')
license=('custom')

depends=('python' 'python-setuptools')
makedepends=('git' 'pandoc')
optdepends=('ffmpeg: for video post-processing')

provides=("$_name")
conflicts=("$_name")

pkgver() { 
  DATE=$(date +%Y.%m.%d)
  HASH=$(git ls-remote -h https://github.com/rg3/$_name $_branch | cut -c1-7)
  echo $DATE.$HASH
}

source=("$pkgname-$(pkgver).zip::https://github.com/rg3/$_name/archive/$_branch.zip")
sha512sums=(SKIP)

prepare() {
  cd $_name-$_branch
  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
}

package() {
 cd $_name-$_branch

 make bash-completion zsh-completion fish-completion README.txt youtube-dl.1
 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 -D -m644 youtube-dl.zsh "$pkgdir"/usr/share/zsh/site-functions/_youtube-dl
 install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
}