aboutsummaryrefslogtreecommitdiff
path: root/repo/telegram-bot-api/PKGBUILD
blob: ac653aade0930cbc53118ea3c2a4474ea0ec4482 (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
# Maintainer: KunoiSayami <[email protected]>

pkgname=telegram-bot-api
pkgver=8.0
pkgrel=1
pkgdesc='The Telegram Bot API provides an HTTP API for creating Telegram Bots.'
arch=('any')
url=https://github.com/tdlib/telegram-bot-api/
source=(git+https://github.com/tdlib/telegram-bot-api.git#commit=53e15345b04fcea73b415897f10d7543005044ce)
license=('BSL-1.0')
md5sums=('SKIP')
makedepends=('gperf' 'cmake' 'gcc' 'git')
depends=('openssl' 'zlib')
provides=('telegram-bot-api')

prepare() {
    cd "$srcdir/$pkgname/"
    git submodule update --init
}

build() {
    cd "$srcdir/$pkgname"

    if [ ! -d build ]; then
        mkdir build/
    fi
    cd build/

    cmake -DCMAKE_BUILD_TYPE=Release ..

    cmake --build . --parallel $(nproc)
}

package() {
    cd "$srcdir/$pkgname"

    install -dm755 "$pkgdir"/usr/share/"$pkgname"/
    install -dm755 "$pkgdir"/usr/share/license/"$pkgname"
    install -dm755 "$pkgdir"/usr/bin

    install -m755 build/"$pkgname" "$pkgdir"/usr/share/"$pkgname"/

    install -Dm644 LICENSE_1_0.txt "$pkgdir"/usr/share/license/"$pkgname"/

    ln -s /usr/share/"$pkgname"/"$pkgname" "$pkgdir"/usr/bin/"$pkgname"
}