36 lines
995 B
Ruby
36 lines
995 B
Ruby
|
class Libtirpc < Formula
|
||
|
desc "Port of Sun's Transport-Independent RPC library to Linux"
|
||
|
homepage "https://sourceforge.net/projects/libtirpc/"
|
||
|
url "https://downloads.sourceforge.net/project/libtirpc/libtirpc/1.2.6/libtirpc-1.2.6.tar.bz2"
|
||
|
sha256 "4278e9a5181d5af9cd7885322fdecebc444f9a3da87c526e7d47f7a12a37d1cc"
|
||
|
license "BSD-3-Clause"
|
||
|
|
||
|
depends_on "krb5"
|
||
|
depends_on :linux
|
||
|
|
||
|
def install
|
||
|
system "./configure",
|
||
|
"--disable-dependency-tracking",
|
||
|
"--disable-silent-rules",
|
||
|
"--prefix=#{prefix}"
|
||
|
system "make", "install"
|
||
|
end
|
||
|
|
||
|
test do
|
||
|
(testpath/"test.c").write <<~EOS
|
||
|
#include <rpc/des_crypt.h>
|
||
|
#include <stdio.h>
|
||
|
int main () {
|
||
|
char key[] = "My8digitkey1234";
|
||
|
if (sizeof(key) != 16)
|
||
|
return 1;
|
||
|
des_setparity(key);
|
||
|
printf("%lu\\n", sizeof(key));
|
||
|
return 0;
|
||
|
}
|
||
|
EOS
|
||
|
system ENV.cc, "test.c", "-L#{lib}", "-I#{include}/tirpc", "-ltirpc", "-o", "test"
|
||
|
system "./test"
|
||
|
end
|
||
|
end
|