summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cdf27ec1de5c3842cbfa0a33ceda13e5cea7001b (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
# Maintainer: Jingbei Li <i@jingbei.li>
_pkgname=pinyin-completion
pkgname=$_pkgname-git
pkgver=58.544c6da
pkgrel=1
pkgdesc="complete path name based upon the pinyin acronym of Chinese characters"
arch=('any')
url="https://github.com/petronny/pinyin-completion"
license=('GPL3')
depends=('python')
makedepends=('git')
source=("git+https://github.com/petronny/pinyin-completion"
        "pinyin-completion.install")
sha256sums=('SKIP'
            'f6dbcc8fc15c6de71897281f1d64f05df7dfd1e5ec3b1a70bd46a4f3078f9f13')
install='pinyin-completion.install'

pkgver() {
    cd $_pkgname
    echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
    cd "$srcdir/$_pkgname/tools"
    python table-generator.py > ../pinyin_completion/pinyin_initial.py
}

package() {
    cd $_pkgname

    mkdir -p "$pkgdir/usr/share/$_pkgname/"
    cp -r shell "$pkgdir/usr/share/$_pkgname/"
    cp -r tools "$pkgdir/usr/share/$_pkgname/"

    python setup.py install --root=$pkgdir/ --optimize=1
}