# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Dave Reisner <dreisner@archlinux.org>
# Contributor: Angel Velasquez <angvp@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: ice-man <icemanf@gmail.com>

pkgname=libssh2
pkgver=1.11.1
pkgrel=1
pkgdesc="A library implementing the SSH2 protocol as defined by Internet Drafts"
url="https://www.libssh2.org/"
arch=('x86_64' 'aarch64')
license=('BSD')
depends=('openssl' 'zlib')
provides=('libssh2.so')
validpgpkeys=('27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2'   # Daniel Stenberg
              '914C533DF9B2ADA2204F586D78E11C6B279D5C91')  # Daniel Stenberg (old key)
source=("https://www.libssh2.org/download/$pkgname-$pkgver.tar.gz"{,.asc})
b2sums=('a44073d59eeeed57626063067d498f28d64f66febf5cdbd830cf1fa0ffd33e39f4bca57289abef175d4f0413952e1dbc57847aa4fe1d9c0140d8789b7b925528'
        'SKIP')

build() {
  cd "$pkgname-$pkgver"

  ./configure --prefix=/usr --disable-docker-tests
  make
}

check() {
  make -C "$pkgname-$pkgver" check
}

package() {
  cd "$pkgname-$pkgver"

  make DESTDIR="$pkgdir" install
  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
