# $Id: Portfile,v 1.2 2005/09/20 20:08:13 toby Exp $
PortSystem        1.0
name              arpwatch
version           2.1a11
categories        net
maintainers       julien.touche@touche.fr.st
description       monitor arp & rarp requests
long_description  Arpwatch monitors ethernet activity and maintains a \
                  database of ethernet/ip address pairings. It also \
                  reports certain changes via email.
homepage          http://online.securityfocus.com/tools/142
master_sites      http://www.Awfulhak.org/arpwatch/ ftp://ftp.ee.lbl.gov/
platforms         darwin openbsd
checksums         md5 9ecd00db892737431b0e524f3e52e19e
configure.args    --quiet --mandir=${prefix}/share/man
build.env         ARPDIR=${prefix}/var/arpwatch
destroot.target   install install-man

platform darwin 7 { 
	configure.env       CFLAGS="-DBIND_8_COMPAT=1" 
}
platform darwin 8 { 
	configure.env       CFLAGS="-DBIND_8_COMPAT=1" 
}

variant darwin {
        pre-configure {
                file copy -force /usr/share/libtool/config.guess ${worksrcpath}/  
                file copy -force /usr/share/libtool/config.sub ${worksrcpath}/  
        }
}

post-configure {
    reinplace "s|-o bin -g bin||g" \
                  "${workdir}/${worksrcdir}/Makefile"
}

post-destroot {
	file mkdir ${destroot}${prefix}/share/examples/${name}-${version}

	xinstall ${build.dir}/ethercodes.dat \
		 ${destroot}${prefix}/share/examples/${name}-${version}
	xinstall ${build.dir}/d.awk \
		 ${destroot}${prefix}/share/examples/${name}-${version}
	xinstall ${build.dir}/e.awk \
		 ${destroot}${prefix}/share/examples/${name}-${version}
	xinstall ${build.dir}/p.awk \
		 ${destroot}${prefix}/share/examples/${name}-${version}
	xinstall ${build.dir}/arp2ethers \
		 ${destroot}${prefix}/share/examples/${name}-${version}
}
