#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

#pkgbase=libssh
#pkgname=(libssh libssh-docs)
pkgname=libssh
pkgver=0.10.4
pkgrel=03
pkgdesc='Library for accessing ssh client services through C libraries'
url='https://www.libssh.org/'
arch=(x86_64)
depends=(zlib openssl)
makedepends=(cmake cmocka doxygen python openssh)
provides=(libssh.so)
source=("https://www.libssh.org/files/${pkgver%.*}/$pkgname-$pkgver.tar.xz"{,.asc})

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DWITH_GSSAPI=OFF \
    -DUNIT_TESTING=ON
  cmake --build build
  cmake --build build --target docs
}

check() {
  cmake --build build --target test
}

#package_libssh() {
package() {
  DESTDIR="$pkgdir" cmake --install build
}

#package_libssh-docs() {
#  pkgdesc='Documentation for libssh'
#  depends=()
#  provides=()
#
#  mkdir -p "$pkgdir"/usr/share/doc/libssh
#  cp -r build/doc/html "$pkgdir"/usr/share/doc/libssh
##  cp -r build/doc/man "$pkgdir"/usr/share
##  rm "$pkgdir"/usr/share/man/man3/{bug,deprecated}.*
#}

#---- license gpg-key sha256sums ----

license=(LGPL)

validpgpkeys=(8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D) # Andreas Schneider <asn@cryptomilk.org>

sha256sums=(07392c54ab61476288d1c1f0a7c557b50211797ad00c34c3af2bbc4dbc4bd97d # libssh-0.10.4.tar.xz
	de8780dc83273f33ad78f595fbcff107273b17c7387e9c133cd992cb8f94ba80) # libssh-0.10.4.tar.xz.asc
 
 
#  0f4853ef5936953fa6dae0a7a9a8d1b0bf3275908521e6e94819a20018a66ed1  libssh-0.10.4-03-x86_64.pkg.tar.xz

