82 lines
2.5 KiB
Ruby
82 lines
2.5 KiB
Ruby
class GnupgAT22 < Formula
|
|
desc "GNU Pretty Good Privacy (PGP) package"
|
|
homepage "https://gnupg.org/"
|
|
url "https://gnupg.org/ftp/gcrypt/gnupg/gnupg-2.2.33.tar.bz2"
|
|
sha256 "8688836e8c043d70410bb64d72de6ae15176e09ecede8d24528b4380c000e4e3"
|
|
license "GPL-3.0-or-later"
|
|
|
|
livecheck do
|
|
url "https://gnupg.org/ftp/gcrypt/gnupg/"
|
|
regex(/href=.*?gnupg[._-]v?(2\.2(?:\.\d+)+)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 arm64_monterey: "193e4612713a0de535453b92899af7012350949ba7301142214f760b2bcc629f"
|
|
sha256 arm64_big_sur: "a332f83ae06ccc1f35e7a8fe789d0383c53051fded5de256a6c13bd70cad40f5"
|
|
sha256 monterey: "00f279869098bbb0108fbaf393a41425e8f3b66eecbf1de9213a0985b029dbbe"
|
|
sha256 big_sur: "8653fe8ff954e29b889d4233cca0e1f0af85953f6bbd08d5033ce55028253d1f"
|
|
sha256 catalina: "ede400a68d5928aa9f6b12ab235507d987eb8cee85f793613e6924fd2bb80be5"
|
|
sha256 x86_64_linux: "13b639273b24acd4dbeb48fb2048548f9889195a8c20aaae2da8420eedbe6889"
|
|
end
|
|
|
|
keg_only :versioned_formula
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "gettext"
|
|
depends_on "gnutls"
|
|
depends_on "libassuan"
|
|
depends_on "libgcrypt"
|
|
depends_on "libgpg-error"
|
|
depends_on "libksba"
|
|
depends_on "libusb"
|
|
depends_on "npth"
|
|
depends_on "pinentry"
|
|
|
|
uses_from_macos "sqlite" => :build
|
|
|
|
on_linux do
|
|
depends_on "libidn"
|
|
end
|
|
|
|
def install
|
|
system "./configure", "--disable-dependency-tracking",
|
|
"--disable-silent-rules",
|
|
"--prefix=#{prefix}",
|
|
"--sbindir=#{bin}",
|
|
"--sysconfdir=#{etc}",
|
|
"--enable-all-tests",
|
|
"--enable-symcryptrun",
|
|
"--with-pinentry-pgm=#{Formula["pinentry"].opt_bin}/pinentry"
|
|
system "make"
|
|
system "make", "check"
|
|
system "make", "install"
|
|
end
|
|
|
|
def post_install
|
|
(var/"run").mkpath
|
|
quiet_system "killall", "gpg-agent"
|
|
end
|
|
|
|
test do
|
|
(testpath/"batch.gpg").write <<~EOS
|
|
Key-Type: RSA
|
|
Key-Length: 2048
|
|
Subkey-Type: RSA
|
|
Subkey-Length: 2048
|
|
Name-Real: Testing
|
|
Name-Email: testing@foo.bar
|
|
Expire-Date: 1d
|
|
%no-protection
|
|
%commit
|
|
EOS
|
|
begin
|
|
system bin/"gpg", "--batch", "--gen-key", "batch.gpg"
|
|
(testpath/"test.txt").write "Hello World!"
|
|
system bin/"gpg", "--detach-sign", "test.txt"
|
|
system bin/"gpg", "--verify", "test.txt.sig"
|
|
ensure
|
|
system bin/"gpgconf", "--kill", "gpg-agent"
|
|
end
|
|
end
|
|
end
|