# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

DESCRIPTION="HoTTProxy WAP Proxy"
HOMEPAGE="http://www.hotproxy.org"
MY_P=${P/hottproxy/HoTTProxy-Source}
SRC_URI="http://www.hottproxy.org/downloads/${MY_P}.tar.gz"

LICENSE="HoTTProxy"
SLOT="0"
KEYWORDS="~amd64 ~i386"
IUSE=""

DEPEND="${RDEPEND}"
RDEPEND=">=dev-lang/perl-5.8.0
	dev-perl/HTTP-Proxy
	dev-perl/libwww-perl
	dev-perl/Date-Calc
	perl-core/MIME-Base64
	perl-core/Digest-MD5"

src_unpack() {
	mkdir ${P}
	cd ${P}
	tar -zxf ${DISTDIR}/${A}
	patch -p0 < ${FILESDIR}/use-get.patch
}

src_install() {
	dodir /opt/${P}
	dodir /opt/${P}/cookies
	insinto /opt/${P}
	doins HoTTProxy.pl
	doins HoTTProxy_Admin.pl
	doins HoTTProxy_Add-In_Filters.pl
	
	doins HoTTProxy.conf
	doins HoTTProxy_Admin.conf
	doins www

	insinto /opt/${P}/HoTTProxy
	doins HoTTProxy/UI.pm

	insinto /opt/${P}/www
	doins www/*

	dodoc InstallationGuide.pdf
	dodoc License.txt
	dodoc ReleaseNotes_0.24.0.0.txt
	dodoc UpgradeGuide_0.24.0.0.txt
	
	newinitd ${FILESDIR}/hottproxy.rc hottproxy
}