libseccomp (new formula)
parent
23aeb449e4
commit
599a5cc5f3
|
@ -0,0 +1,38 @@
|
|||
class Libseccomp < Formula
|
||||
desc "Interface to the Linux Kernel's syscall filtering mechanism"
|
||||
homepage "https://github.com/seccomp/libseccomp"
|
||||
url "https://github.com/seccomp/libseccomp/releases/download/v2.4.2/libseccomp-2.4.2.tar.gz"
|
||||
sha256 "b54f27b53884caacc932e75e6b44304ac83586e2abe7a83eca6daecc5440585b"
|
||||
license "LGPL-2.1-only"
|
||||
|
||||
depends_on "autoconf" => :build
|
||||
depends_on "automake" => :build
|
||||
depends_on "libtool" => :build
|
||||
depends_on :linux
|
||||
|
||||
def install
|
||||
system "./configure", "--disable-debug",
|
||||
"--disable-dependency-tracking",
|
||||
"--disable-silent-rules",
|
||||
"--prefix=#{prefix}"
|
||||
system "make", "install"
|
||||
end
|
||||
|
||||
test do
|
||||
ver_major, ver_minor, = version.to_s.split(".")
|
||||
|
||||
(testpath/"test.c").write <<~EOS
|
||||
#include <seccomp.h>
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if(SCMP_VER_MAJOR != #{ver_major})
|
||||
return 1;
|
||||
if(SCMP_VER_MINOR != #{ver_minor})
|
||||
return 1;
|
||||
}
|
||||
EOS
|
||||
|
||||
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lseccomp", "-o", "test"
|
||||
system "./test"
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue