SUMMARY="An HTML5 compliant parsing library" 
DESCRIPTION="
Hubbub is an HTML5 compliant parsing library, written in C. It was developed \
as part of the NetSurf project and is available for use by other software \
under the MIT licence.
The HTML5 specification defines a parsing algorithm, based on the behaviour \
of mainstream browsers, which provides instructions for how to parse all \
markup, both valid and invalid. As a result, Hubbub parses web content well.
If you are looking for an HTML5 parser in Python or Ruby, you may wish to \
look at html5lib.
"
HOMEPAGE="http://www.netsurf-browser.org/projects/hubbub/"
LICENSE="MIT"
COPYRIGHT="2007-2014 J-M Bell"
SOURCE_URI="http://download.netsurf-browser.org/libs/releases/libhubbub-$portVersion-src.tar.gz"
CHECKSUM_SHA256="dbf3b55bf2531d2a8e70f370a9b396cc78bfd5a092f87beb10b05c04fd7cdaa7"
REVISION="1"
ARCHITECTURES="x86_gcc2 x86 x86_64"

PROVIDES="
	hubbub = $portVersion
	lib:libhubbub = $portVersion compat >= 0
	"
REQUIRES="
	haiku
	"
BUILD_REQUIRES="
	devel:libparserutils
	devel:libjson_c
	devel:libiconv
	"
BUILD_PREREQUIRES="
	haiku_devel
	netsurf_buildsystem >= 0.3.0
	cmd:gcc
	cmd:make
	cmd:perl
	cmd:pkg_config
	"

PATCHES="libhubbub-$portVersion.patchset"

SOURCE_DIR="libhubbub-$portVersion"

BUILD()
{
	make PREFIX=$prefix NSSHARED=/system/data/netsurf-buildsystem
	make PREFIX=$prefix NSSHARED=/system/data/netsurf-buildsystem \
		COMPONENT_TYPE=lib-shared
}

INSTALL()
{
	make install PREFIX=$prefix NSSHARED=/system/data/netsurf-buildsystem \
		INCLUDEDIR=$relativeIncludeDir
	make install PREFIX=$prefix NSSHARED=/system/data/netsurf-buildsystem \
		INCLUDEDIR=$relativeIncludeDir COMPONENT_TYPE=lib-shared

	prepareInstalledDevelLib libhubbub
	fixPkgconfig
	packageEntries devel $developDir
}

TEST()
{
	make PREFIX=$prefix NSSHARED=/system/data/netsurf-buildsystem \
		LDFLAGS="-liconv -lparserutils" test
}

# ----- devel package -------------------------------------------------------

PROVIDES_devel="
	hubbub_devel = $portVersion
	devel:libhubbub = $portVersion compat >= 0
"
REQUIRES_devel="
	hubbub$secondaryArchSuffix == $portVersion base
	"
