# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ INSTALL_PATH="/usr/share/peerguardian/" DESCRIPTION="A lightweight IP blocker to stop rogue connections" HOMEPAGE="http://methlabs.org/" SRC_URI="http://umn.dl.sourceforge.net/sourceforge/peerguardian/pglinux-1.5beta.tar.gz http://unc.dl.sourceforge.net/sourceforge/peerguardian/pglinux-1.5beta.tar.gz http://kent.dl.sourceforge.net/sourceforge/peerguardian/pglinux-1.5beta.tar.gz" DEPEND=">=net-firewall/iptables-1.2.11-r3" LICENCE="?" KEYWORDS="~x86" IUSE="" pkg_setup() { if [ ! -f /usr/share/peerguardian/PG.conf ]; then ewarn "Package isn't installed" else ewarn "Checking status of Peerguardian" if /etc/init.d/peerguardian status | grep -q "stopped"; then echo "....Stopped" else echo "....Started, Stopping" /etc/init.d/peerguardian stop fi fi } src_unpack() { unpack ${A} } src_compile() { cd ${WORKDIR} cd ${PN}-${PV}beta einfo "Patching files to newer versions" patch -p0 < ${FILESDIR}/pglinux-gentoo.patch emake || die "Error: emake failed!" } src_install() { cd ${WORKDIR}/pglinux-1.5beta dodir ${INSTALL_PATH} cp ${FILESDIR}/pgupdate ./ cp ${FILESDIR}/peerguardianrc ./ into /usr dobin pgupdate dobin peerguardnf dobin pgtext insinto /etc/init.d newins peerguardianrc peerguardian insinto ${INSTALL_PATH} doins PG.conf dodoc AUTHORS ChangeLog } pkg_postinst() { chmod +rx /etc/init.d/peerguardian einfo "" einfo " This is a Gentoo adapted version of Peerguardian" einfo " Full credit goes to the guys at methlabs for making such a brilliant system" einfo "" ewarn " Please run the command 'pgupdate' to update to the latest blocklist" ewarn "" ewarn " REMEMBER TO ADD PEERGUARDIAN TO BOOT!" ewarn "" ewarn " rc-update add peerguardian default" ewarn "" }