summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d12630771cad65512baba352030e0b5ae39bfe7c (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
52
53
54
# Contributor: Alexandre Jesus <adbjesus@gmail.com>
# Maintainer: Stefan Husmann <stefan-husmann@t-online.de>

pkgbase=soccer-cli-git
pkgname=('python2-soccer-cli-git' 'python-soccer-cli-git')
epoch=1
pkgver=20170929_r267.990bdfd
pkgrel=1
pkgdesc="Soccer for Hackers - a CLI for all the football scores."
arch=('any')
url="https://github.com/architv/soccer-cli"
license=('MIT')
makedepends=('git' 'python' 'python2')
provides=("${_pkgname}")
source=('git+https://github.com/architv/soccer-cli.git')
md5sums=('SKIP')
install="${pkgbase}.install"

pkgver() {
  cd ${pkgbase%-git}

  # Get the version number.
  printf "%s_r%s.%s" "$(git log -1 --format="%cd" --date=short|tr -d - )" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd ${pkgbase%-git}

  sed -i -e 's/requests==2/requests>=2/' setup.py
  cd ..
  cp -r ${pkgbase%-git} ${pkgbase%-git}2
  cp -r ${pkgbase%-git} ${pkgbase%-git}3
}

package_python2-soccer-cli-git() {
  depends=('python2-click' 'python2-requests')
  cd ${pkgbase%-git}2

  install -D -m644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE

  python2 setup.py install --root="$pkgdir/" --optimize=1
  mv "$pkgdir"/usr/bin/soccer "$pkgdir"/usr/bin/soccer2
}

package_python-soccer-cli-git() {
  depends=('python-click' 'python-requests')
  cd ${pkgbase%-git}3

  install -D -m644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE

  python setup.py install --root="$pkgdir/" --optimize=1
  mv "$pkgdir"/usr/bin/soccer "$pkgdir"/usr/bin/soccer3
}