pkgname=curl
pkgver=8.15.0
pkgdesc='command line tool and library for transferring data with URLs'
arch=('x86_64')
homepage='https://curl.se/'
license=('MIT')
sources=("${pkgname}-${pkgver}.tar.xz")
urls=("https://curl.se/download/${sources[0]}")
md5sums=("b8872bb6cc5d18d03bea8ff5090b2b81")

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

src_build() {
  ./configure --prefix=/usr    \
            --disable-static \
            --with-openssl   \
            --with-ca-path=/etc/ssl/certs &&
  make
}

src_check() {
  :
}

src_install() {
  make DESTDIR="${pkgdir}" install &&

  rm -rf docs/examples/.deps &&

  find docs \( -name Makefile\* -o  \
               -name \*.1       -o  \
               -name \*.3       -o  \
               -name CMakeLists.txt \) -delete &&

  install -dm755 ${pkgdir}/usr/share/doc/${pkgname}-${pkgver}
  cp -v -R docs -T ${pkgdir}/usr/share/doc/curl-${pkgver}
}
