SUMMARY="A lightweight Qt WebKit web browser."
DESCRIPTION="
QupZilla is a lightweight multiplatform web browser based on libqtwebkit.
It provides:
- A unified interface for bookmarks, history and RSS reading.
- A themeable interface.
- Integrated AdBlock.
- Speed Dial.
- Multiplatform support.
"
HOMEPAGE="http://www.qupzilla.com"

SRC_URI="git://github.com/QupZilla/qupzilla.git#4f3aba95ff4194c9b756d196f54d50ff30161f46"

REVISION="1"
LICENSE="GNU GPL v3"
COPYRIGHT="2010-2013 David Rosca"

ARCHITECTURES="x86"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	qupzilla${secondaryArchSuffix} = $portVersion
	app:qupzilla${secondaryArchSuffix} = $portVersion
	"

# TODO: update requirements to be more specific about which Qt 
# libraries are required.	
REQUIRES="
	haiku${secondaryArchSuffix} >= $haikuVersion
	qtcore${secondaryArchSuffix} >= 4.8.0
	"

BUILD_PREREQUIRES="
	cmd:qmake${secondaryArchSuffix}
	cmd:make
	cmd:g++${secondaryArchSuffix}
	"
        
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	openssl${secondaryArchSuffix}_devel
	qtcore${secondaryArchSuffix} >= 4.8.0
	qtcore${secondaryArchSuffix}_devel >= 4.8.0
	"
        
PATCHES="
	qupzilla-1.4.x.patchset
	"

BUILD()
{	
	qmake QUPZILLA_PREFIX=${appsDir}/QupZilla
	make $jobArgs
}

INSTALL()
{
	echo "Installing QupZilla..."
	
	mkdir -p ${appsDir}/QupZilla/
	mkdir -p ${appsDir}/QupZilla/lib/
		
	cd bin/
	
	cp qupzilla ${appsDir}/QupZilla/
	cp -R locale ${appsDir}/QupZilla/
	cp -R plugins ${appsDir}/QupZilla/
	cp -R themes ${appsDir}/QupZilla/
	cp libQupZilla.* ${appsDir}/QupZilla/lib/
	
	echo "Linking QupZilla..."
	addAppDeskbarSymlink ${appsDir}/QupZilla/qupzilla "QupZilla"
}
