40 lines
1.3 KiB
Ruby
40 lines
1.3 KiB
Ruby
class Libtasn1 < Formula
|
|
desc "ASN.1 structure parser library"
|
|
homepage "https://www.gnu.org/software/libtasn1/"
|
|
url "https://ftp.gnu.org/gnu/libtasn1/libtasn1-4.12.tar.gz"
|
|
mirror "https://ftpmirror.gnu.org/libtasn1/libtasn1-4.12.tar.gz"
|
|
sha256 "6753da2e621257f33f5b051cc114d417e5206a0818fe0b1ecfd6153f70934753"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "1ffba72aee8d79b0c97a2bb72f0dfab5b4d20052b01411be2b6815dbe485a375" => :sierra
|
|
sha256 "90338dad72d15a370b546d28e4df67cce93dee33c5a442dfbc48f29654460e65" => :el_capitan
|
|
sha256 "ddb2c3a87fad85b37b6a749d283d7f2adc8af9145c0a9d3c3c665624e6d95be5" => :yosemite
|
|
end
|
|
|
|
def install
|
|
system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking",
|
|
"--disable-silent-rules"
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
(testpath/"pkix.asn").write <<-EOS.undent
|
|
PKIX1 { }
|
|
DEFINITIONS IMPLICIT TAGS ::=
|
|
BEGIN
|
|
Dss-Sig-Value ::= SEQUENCE {
|
|
r INTEGER,
|
|
s INTEGER
|
|
}
|
|
END
|
|
EOS
|
|
(testpath/"assign.asn1").write <<-EOS.undent
|
|
dp PKIX1.Dss-Sig-Value
|
|
r 42
|
|
s 47
|
|
EOS
|
|
system "#{bin}/asn1Coding", "pkix.asn", "assign.asn1"
|
|
assert_match /Decoding: SUCCESS/, shell_output("#{bin}/asn1Decoding pkix.asn assign.out PKIX1.Dss-Sig-Value 2>&1")
|
|
end
|
|
end
|