# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=libedit
pkgver=20240517_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-3-Clause)
depends=(
  glibc
  ncurses
  libncursesw.so
)
source=(${url}/${pkgname}-${_pkgver}.tar.gz)
sha256sums=('3a489097bb4115495f3bd85ae782852b7097c556d9500088d74b6fa38dbd12ff')
b2sums=('6326a428204c020864b47db938973a13afb3580f9bb4e7b4d3cb861743c75e1cee99b569cb2baad3e1c7d6dc6986af5282492b5dd9f421a8243bf1d583a87e15')

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

package() {
  provides=(libedit.so)

  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:
