libcap-ng 0.8 (new formula) (#64708)

master
Dawid Dziurla 2020-12-20 19:11:45 +01:00 committed by GitHub
parent d39fba7bec
commit 61ea587ca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 0 deletions

View File

@ -9,6 +9,7 @@ on:
- "Formula/ladspa-sdk.rb"
- "Formula/libbsd.rb"
- "Formula/libcap.rb"
- "Formula/libcap-ng.rb"
- "Formula/libdrm.rb"
- "Formula/libfuse.rb"
- "Formula/libmnl.rb"

41
Formula/libcap-ng.rb Normal file
View File

@ -0,0 +1,41 @@
class LibcapNg < Formula
desc "Library for Linux that makes using posix capabilities easy"
homepage "https://people.redhat.com/sgrubb/libcap-ng"
url "https://github.com/stevegrubb/libcap-ng/archive/v0.8.tar.gz"
sha256 "836ea8188ae7c658cdf003e62a241509dd542f3dec5bc40c603f53a5aadaa93f"
license "LGPL-2.1-or-later"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "python@3.9" => :build
depends_on "swig" => :build
depends_on :linux
uses_from_macos "m4" => :build
def install
system "./autogen.sh"
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--with-python3"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <stdio.h>
#include <cap-ng.h>
int main(int argc, char *argv[])
{
if(capng_have_permitted_capabilities() > -1)
printf("ok");
}
EOS
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lcap-ng", "-o", "test"
assert_equal "ok", `./test`
end
end