# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=lynx
pkgver=2.9.2
pkgrel=1
pkgdesc='A text browser for the World Wide Web'
url='https://lynx.invisible-island.net/'
arch=(x86_64)
license=(GPL-2.0-only)
depends=(brotli
         bzip2
         glibc
         libidn2
         ncurses
         openssl
         zlib)
backup=(etc/lynx.cfg)
options=(!lto)
_archive="$pkgname$pkgver"
source=("https://invisible-mirror.net/archives/lynx/tarballs/$_archive.tar.bz2"{,.asc})
sha256sums=('7374b89936d991669e101f4e97f2c9592036e1e8cdaa7bafc259a77ab6fb07ce'
            'SKIP')

build() {
	cd "$_archive"
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--with-ssl=/usr \
		--enable-externs \
		--enable-nls \
		--enable-ipv6 \
		--mandir=/usr/share/man
	make
}

package() {
	cd "$_archive"
	make DESTDIR="$pkgdir" install
	# FS#20404 - points to local help
	sed -i -e "s|^HELPFILE.*$|HELPFILE:file:///usr/share/doc/lynx/lynx_help/lynx_help_main.html|" "${pkgdir}/etc/lynx.cfg"
	install -d "$pkgdir/usr/share/doc/lynx"
	cp -rf lynx_help "$pkgdir/usr/share/doc/lynx"
}
