SUMMARY="A virtual layer that helps you improve privacy and anonymity"
DESCRIPTION="Tor is a network of virtual tunnels that allows people and groups to improve \
their privacy and security on the Internet. It also enables software \
developers to create new communication tools with built-in privacy features. \
Tor provides the foundation for a range of applications that allow \
organizations and individuals to share information over public networks \
without compromising their privacy."
HOMEPAGE="https://www.torproject.org"
SOURCE_URI="https://www.torproject.org/dist/tor-0.2.5.10.tar.gz"
CHECKSUM_SHA256="b3dd02a5dcd2ffe14d9a37956f92779d4427edf7905c0bba9b1e3901b9c5a83b"

REVISION="1"

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

PROVIDES="
	tor = $portVersion
	cmd:tor$secondaryArchSuffix
	cmd:tor_gencert$secondaryArchSuffix
	cmd:tor_resolve$secondaryArchSuffix
	cmd:torify$secondaryArchSuffix
	"
REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	lib:libevent$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	lib:libssl$secondaryArchSuffix
	lib:libcrypto$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	devel:libevent$secondaryArchSuffix
	devel:libssl$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize
	cmd:make
	"
	
LICENSE="BSD (3-clause)"
COPYRIGHT="
	2001-2004, Roger Dingledine
	2004-2006, Roger Dingledine, Nick Mathewson
	2007-2014, The Tor Project, Inc.
	"

USER_SETTINGS_FILES="
	settings/tor directory
	"
	
GLOBAL_WRITABLE_FILES="
	settings/tor/torrc.sample auto-merge
	"

BUILD()
{
	libtoolize --force --copy --install
	aclocal
	autoconf
	automake --add-missing
	runConfigure ./configure
	make	
}

INSTALL()
{
	make install	
}
