# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Vesa Kaihlavirta <vesa@archlinux.org>
# Contributor: Roman Cheplyaka <roma@ro-che.info>

pkgname=libedit
_pkgver=20221030-3.1
pkgver=${_pkgver/-/_}
pkgrel=1
pkgdesc='Command line editor library providing generic line editing, history, and tokenization functions'
url='https://thrysoee.dk/editline/'
arch=('x86_64')
license=('BSD')
depends=('glibc' 'ncurses' 'libncursesw.so')
provides=('libedit.so')
source=(${url}/${pkgname}-${_pkgver}.tar.gz)
sha256sums=('f0925a5adf4b1bf116ee19766b7daa766917aec198747943b1c4edf67a4be2bb')
b2sums=('f4a9784cfc2a30af2778f0e05b6e45ca489555c3009ba050ea19134670ad71fdd099425dee0526dcbb6a1a84f51bd8014ce2540be0535465cb59ab998753833c')

build() {
  cd ${pkgname}-${_pkgver}
  ./configure --prefix=/usr
  make V=1
}

package() {
  cd ${pkgname}-${_pkgver}
  make DESTDIR="${pkgdir}" install

  rm "${pkgdir}"/usr/share/man/man3/history.3 # conflicts with readline
  install -Dm 644 "${pkgdir}"/usr/share/man/man3/editline.3 "${pkgdir}"/usr/share/man/man3/el.3

  install -Dm 644 ChangeLog -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim:set sw=2 sts=-1 et:
