homebrew-core/Formula/libnfnetlink.rb

39 lines
1.1 KiB
Ruby

class Libnfnetlink < Formula
desc "Low-level library for netfilter related communication"
homepage "https://www.netfilter.org/projects/libnfnetlink"
url "https://www.netfilter.org/projects/libnfnetlink/files/libnfnetlink-1.0.2.tar.bz2"
sha256 "b064c7c3d426efb4786e60a8e6859b82ee2f2c5e49ffeea640cfe4fe33cbc376"
license "LGPL-2.1-or-later"
livecheck do
url "https://www.netfilter.org/projects/libnfnetlink/downloads.html"
regex(/href=.*?libnfnetlink[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any_skip_relocation, x86_64_linux: "302c0c8f5d1b84aa7482b918d2b70a9c88eb0e794163342317b208feff242993"
end
depends_on :linux
def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <libnfnetlink/libnfnetlink.h>
int main() {
int i = NFNL_BUFFSIZE;
}
EOS
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lnfnetlink", "-o", "test"
end
end