summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8da74f1f69f01da0f7fb3c6e7957787f7e1d05dc (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
# Maintainer: Evgeniy Filimonov <evgfilim1@gmail.com>
pkgname=('python-telegram-bot-git')
pkgver=8.1.1.r8.e8fac19
pkgrel=1
pkgdesc="A Python wrapper around the Telegram Bot API"
arch=('any')
url="https://github.com/${pkgname%-git}/${pkgname%-git}"
license=('LGPL3')
depends=('python-future>=0.16.0' 'python-certifi')
makedepends=('git' 'python-setuptools')
optdepends=('python-pysocks: SOCKS or HTTP proxy'
            'python-ujson: Ultra fast JSON parsing')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
changelog='CHANGES.rst'
source=("${pkgname}::git+${url}.git")
sha256sums=('SKIP')

prepare() {
    msg2 "Updating dependencies..."
    cd "$srcdir/$pkgname"
    git submodule update --init --recursive
    msg2 "Updating changelog..."
    cp ./CHANGES.rst ../../
}

pkgver() {
    cd "$srcdir/$pkgname"
    printf "%s.r%s.%s" "$(python -c 'import telegram; print(telegram.__version__)')" \
        "$(git rev-list --count $(git log --oneline | grep Bump | head -n1 | awk '{print $1}')..HEAD)" "$(git rev-parse --short HEAD)"
    # printf "%s" "$(git describe --long --tags | sed 's/^v//;s/\([^-]*-\)g/r\1/;s/-/./g')"
}

build() {
    cd "$srcdir/$pkgname"
    python setup.py build
}

package() {
    cd "$srcdir/$pkgname"
    python setup.py install --root="$pkgdir" --optimize=1

    install -Dm644 README.rst "${pkgdir}/usr/share/doc/${pkgname}/README.rst"
}