# The paths below depend on PREFIX, so they can't be static CONFIGURE
# arguments. terminfo is looked up in the package's own copy first.
configure() {
	configure_args ./configure --prefix="$PREFIX" --sysconfdir=/etc \
		--mandir="$PREFIX/share/man" \
		--with-pkg-config-libdir="$PREFIX/lib/pkgconfig" \
		--with-terminfo-dirs="$PREFIX/share/terminfo:/etc/terminfo:/usr/share/terminfo"
}

# Only the wide-character library is built: link the usual names to it.
package() {
	make install DESTDIR="$DESTDIR"
	cd "$DESTDIR$PREFIX/lib"
	for l in ncurses curses tinfo; do
		ln -s libncursesw.so lib$l.so
	done
	ln -s ncursesw.pc pkgconfig/ncurses.pc
}
