summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 19b739ca621d8366a90b923c050a3829f59bdd93 (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: BrLi <brli at chakralinux dot org>

# The check function contains several remote site api checks, may fail due to too many try or site down.
# Feel free to `--nocheck` and comment out checkdepends=() line to skip it.
# If cannot pass the check due to python package error, try to force the pkgver of depends as shown in requirements-test.txt

pkgname=zdict
pkgver=5.0.1
pkgrel=1
pkgdesc="CLI dictionary framework mainly focus on any kind of online dictionary"
arch=('any')
url="https://github.com/zdict/zdict"
license=('GPL3')
depends=('python-beautifulsoup4' 'python-peewee' 'python-requests')
makedepends=('python-setuptools')
checkdepends=('python-pytest' 'python-pytest-cov' 'python-pytest-flake8' 'python-pyjokes')
_completion_commit=8698dc733b3174f5aac319234fec60dfa380a87e
source=("https://pypi.io/packages/source/z/zdict/$pkgname-$pkgver.tar.gz"
        git+https://github.com/zdict/zdict.sh.git#commit=$_completion_commit)
sha256sums=('ff50d42a2033383d99ce2ab96364d669925b89cab7e8dc78c5fdd31b57104aca'
            'SKIP')

build() {
  cd "$pkgname-$pkgver"
  python setup.py build
}

check() {
  cd "$pkgname-$pkgver/build"
  py.test
}

package() {
  cd "$pkgname-$pkgver"
  python setup.py install --root="$pkgdir" --optimize=1 --skip-build

  # Install shell completion
  # Bash
  install -Dm644 "$srcdir/zdict.sh/zdict.bash-completion" "$pkgdir/usr/share/bash-completion/completions/zdict"
  # Zsh
  install -Dm644 "$srcdir/zdict.sh/zdict.plugin.zsh" "$pkgdir/usr/share/zsh/plugins/zdict/zdict.plugin.zsh"
  install -Dm644 "$srcdir/zdict.sh/_zdict" "$pkgdir/usr/share/zsh/site-functions/_zdict"
  # Fish
  install -Dm644 "$srcdir/zdict.sh/zdict.fish" "$pkgdir/usr/share/fish/completions/zdict.fish"
}