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

DESCRIPTION="A web content scanner, that launches a dictionary based attack against
a web server to discover hidden files and dirs"
HOMEPAGE="http://dirb.sourceforge.net/"
SRC_URI="mirror://sourceforge/dirb/${PN}203.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
S="${WORKDIR}/${PN}"

src_compile() {
sed -i "s/strncpy(options.mfile, \"wordlists\/common.txt\"/strncpy(options.mfile,\ \"\/usr\/share\/dirb\/common.txt\"/g" ${S}/src/dirb.c || die "sed failed"

sed -i "s/wordlists\//\/usr\/share\/dirb\//g" ${S}/src/dirb.c || die "sed failed"
    econf
    emake || die
}
src_install() {
     emake DESTDIR="${D}" install || die
  
dodir /usr/share/dirb/
  insinto /usr/share/dirb/
doins ${S}/wordlists/*

dodir /usr/share/dirb/others/
  insinto /usr/share/dirb/others/
doins ${S}/wordlists/others/*


dodir /usr/share/dirb/stress/
  insinto /usr/share/dirb/stress/
doins ${S}/wordlists/stress/*

dodir /usr/share/dirb/vulns/
  insinto /usr/share/dirb/vulns/
doins ${S}/wordlists/vulns/*

   }