2009-12-20 00:19:58 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Libnet < Formula
|
2010-11-10 18:16:28 +00:00
|
|
|
homepage 'https://github.com/sam-github/libnet'
|
2012-04-21 03:02:41 +00:00
|
|
|
url 'http://sourceforge.net/projects/libnet-dev/files/libnet-1.1.6.tar.gz'
|
|
|
|
sha1 'dffff71c325584fdcf99b80567b60f8ad985e34c'
|
2012-02-28 15:39:22 +00:00
|
|
|
|
2012-08-10 16:28:22 +00:00
|
|
|
# MacPorts does an autoreconf to get raw sockets working
|
2012-08-21 21:05:54 +00:00
|
|
|
depends_on :automake
|
2012-08-10 16:28:22 +00:00
|
|
|
depends_on :autoconf
|
|
|
|
depends_on :libtool
|
|
|
|
|
|
|
|
# Fix raw sockets support
|
|
|
|
def patches
|
|
|
|
{:p0 =>
|
|
|
|
"https://trac.macports.org/export/95336/trunk/dports/net/libnet11/files/patch-configure.in.diff"
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2009-12-20 00:19:58 +00:00
|
|
|
def install
|
2013-01-11 21:34:58 +00:00
|
|
|
# Compatibility with Automake 1.13 and newer.
|
|
|
|
# Reported upstream:
|
|
|
|
# https://github.com/sam-github/libnet/issues/28
|
|
|
|
mv 'configure.in', 'configure.ac'
|
|
|
|
inreplace 'configure.ac', 'AM_CONFIG_HEADER', 'AC_CONFIG_HEADERS'
|
|
|
|
(buildpath/'m4').mkpath
|
|
|
|
|
2012-08-10 16:28:22 +00:00
|
|
|
system "autoreconf --force --install"
|
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}"
|
|
|
|
inreplace "src/libnet_link_bpf.c", "#include <net/bpf.h>", "" # Per MacPorts
|
2009-12-20 00:19:58 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|