SUMMARY="Standard commands to read man pages"
DESCRIPTION="Standard commands to read man pages."
HOMEPAGE="http://primates.ximian.com/~flucifredi/man/"
COPYRIGHT="1989-2012 Free Software Foundation, Inc."
LICENSE="GNU GPL v2"
REVISION="6"
SOURCE_URI="http://ftp.vim.org/ibiblio/apps/doctools/man/man-1.6g.tar.gz
	http://primates.ximian.com/~flucifredi/man/man-1.6g.tar.gz"
CHECKSUM_SHA256="ccdcb8c3f4e0080923d7e818f0e4a202db26c46415eaef361387c20995b8959f"
PATCHES="man-1.6g.patchset"
ADDITIONAL_FILES="fix_man_settings_paths.sh"

# disabled: superseded by mandoc
ARCHITECTURES="!all"

GLOBAL_WRITABLE_FILES="
	settings/man.conf keep-old
	"
POST_INSTALL_SCRIPTS="
	$relativePostInstallDir/fix_man_settings_paths.sh
	"

PROVIDES="
	man = $portVersion compat >= 1.6
	cmd:apropos = $portVersion compat >= 1.6
	cmd:makewhatis = $portVersion compat >= 1.6
	cmd:man = $portVersion compat >= 1.6
	cmd:man2dvi = $portVersion compat >= 1.6
	cmd:man2html = $portVersion compat >= 1.6
	cmd:whatis = $portVersion compat >= 1.6
	"
REQUIRES="
	haiku
	cmd:awk
	cmd:bzip2
	cmd:cat
	cmd:cmp
	cmd:eqn
	cmd:groff
	cmd:gunzip
	cmd:less
	cmd:nroff
	cmd:refer
	cmd:tbl
	cmd:zcat
	"

BUILD_REQUIRES="
	cmd:awk
	cmd:bzip2
	cmd:cat
	cmd:cmp
	cmd:eqn
	cmd:groff
	cmd:gunzip
	cmd:less
	cmd:nroff
	cmd:pic
	cmd:refer
	cmd:tbl
	cmd:zcat
	"
BUILD_PREREQUIRES="
	haiku_devel
	cmd:gcc
	cmd:ld
	cmd:make
	cmd:sed
	"

BUILD()
{
	awk=$portPackageLinksDir/cmd~awk/bin/awk \
	bzip2=$portPackageLinksDir/cmd~bzip2/bin/bzip2 \
	cat=$portPackageLinksDir/cmd~cat/bin/cat \
	cmp=$portPackageLinksDir/cmd~cmp/bin/cmp \
	eqn=$portPackageLinksDir/cmd~eqn/bin/eqn \
	groff=$portPackageLinksDir/cmd~groff/bin/groff \
	gunzip=$portPackageLinksDir/cmd~gunzip/bin/gunzip \
	nroff=$portPackageLinksDir/cmd~nroff/bin/nroff \
	less=$portPackageLinksDir/cmd~less/bin/less \
	pic=$portPackageLinksDir/cmd~pic/bin/pic \
	refer=$portPackageLinksDir/cmd~refer/bin/refer \
	tbl=$portPackageLinksDir/cmd~tbl/bin/tbl \
	zcat=$portPackageLinksDir/cmd~zcat/bin/zcat \
	LIBS=-lbe ./configure -prefix=$prefix \
		-bindir=$binDir \
		-sbindir=$sbinDir \
		-confdir=$sysconfDir \
		-mandir=$manDir
		# no autotools configure
	make $jobArgs
}

INSTALL()
{
	make install
	mkdir -p $postInstallDir
	cp -f $portDir/additional-files/fix_man_settings_paths.sh $postInstallDir
}
