pkgname=libgcrypt
pkgver=1.11.2
pkgdesc="General purpose cryptographic library based on the code from GnuPG"
arch=(x86_64)
homepage="https://www.gnupg.org"
license=(
    'BSD-3-Clause'
    'BSD-3-Clause OR GPL-2.0-only'
    'GPL-2.0-or-later'
    'LGPL-2.0-or-later'
    'LGPL-2.1-or-later'
    'X11'
    'LicenseRef-scancode-public-domain'
    'LicenseRef-OCB1'
)
depends=('libgpg-error' 'glibc')
sources=("${pkgname}-${pkgver}.tar.bz2")
urls=("https://www.gnupg.org/ftp/gcrypt/${pkgname}/${sources[0]}")
md5sums=("84ce2ad07794b987fe6341b63cf5f537")

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
}

src_build() {
  ./configure --prefix=/usr \
              --disable-static
  make
}

src_check() {
  make check
}

src_install() {
  make DESTDIR="${pkgdir}" install
  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 {COPYING.LIB,LICENSES} "${pkgdir}/usr/share/licenses/${pkgname}/"
}
