summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1bfb447a032950b9f16e88dd0e9706da64331a50 (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
# Maintainer: tuberry

_srcname=dict-cedict
_txtname=cedict_1_0_ts_utf-8_mdbg.txt
pkgname=dict-cedict-git
pkgver=20201121.r6.1a76c1e
pkgrel=1
pkgdesc="A port of CC-CEDICT database for dictd et al."
arch=('any')
url="https://www.mdbg.net/chinese/dictionary?page=cc-cedict"
license=('CCPL')
optdepends=('dictd: dict client and server')
makedepends=('dictd' 'git' 'python' 'curl')
provides=('dict-cedict')
conflicts=('dict-cedict')
install=${pkgname}.install
source=("${_txtname}.gz::https://www.mdbg.net/chinese/export/cedict/${_txtname}.gz"
        "git+https://github.com/tuberry/${_srcname}")
sha512sums=('SKIP'
            'SKIP')

pkgver()
{
    cd ${_srcname}
    printf "%s.r%s.%s" \
        "$( curl ${url} 2>&1 | grep Latest | grep -Eo '[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}' | tr -d '-' )" \
        "$( git rev-list --count HEAD )" \
        "$( git rev-parse --short HEAD )"
}

prepare()
{
    cd ${_srcname}
    ln -sf ${srcdir}/${_txtname} ${_txtname}
}

build()
{
    cd ${_srcname}
    make
}

package()
{
    cd ${_srcname}
    make DESTDIR=${pkgdir} install
}