homebrew-core/Formula/certbot.rb

177 lines
8.4 KiB
Ruby

class Certbot < Formula
include Language::Python::Virtualenv
desc "Tool to obtain certs from Let's Encrypt and autoenable HTTPS"
homepage "https://certbot.eff.org/"
url "https://files.pythonhosted.org/packages/83/18/0abe4ff4591f650a3a1604904019390f11b691f29863c16e725495e9b57a/certbot-1.31.0.tar.gz"
sha256 "29af531d33aaa87c8104864cd31ac2af541f0ec973a7252d7f7f5b15e10479db"
license "Apache-2.0"
head "https://github.com/certbot/certbot.git", branch: "master"
bottle do
sha256 cellar: :any, arm64_monterey: "ff97823d721b6974ca6eb49de76516df6c5b4c65eb7e2c5d3feb7ee084cc574e"
sha256 cellar: :any, arm64_big_sur: "b4b8564d58344ec165577e2e09baae5cf81ed9c383e40b93a641b60c0320954a"
sha256 cellar: :any, monterey: "b1a2329969931c11a4bd6086189b0c63210065477ea69d89b031058ad207e432"
sha256 cellar: :any, big_sur: "0e71b501a3981bfc21093f967b576dd294f63eb81d05b66b296a5e4215ae6288"
sha256 cellar: :any, catalina: "3a2289bc823532bc9af2b56ca65e56c6dfec99e711ff1a43e7621eec4fcaabd0"
sha256 cellar: :any_skip_relocation, x86_64_linux: "9207a1a55310748dd3cc15fb9e2673a77b50ac4121eed0262984d2bdb13227a3"
end
depends_on "rust" => :build # for cryptography
depends_on "augeas"
depends_on "dialog"
depends_on "openssl@1.1"
depends_on "python@3.10"
depends_on "six"
uses_from_macos "libffi"
on_linux do
depends_on "pkg-config" => :build
end
resource "acme" do
url "https://files.pythonhosted.org/packages/4f/39/8c405198abd6556fc3024323a8b59663d7c1093ea2f8518b0e84bd78cdd3/acme-1.31.0.tar.gz"
sha256 "f5e13262fa1101c38dd865378ac8b4639f819120eb66c5538fc6c09b7576fc53"
end
resource "certbot-apache" do
url "https://files.pythonhosted.org/packages/ef/f5/f532d3b971674b41b14cbea77513c180c2635b947b4b9379773faf101f72/certbot-apache-1.31.0.tar.gz"
sha256 "b4736a29233068022b217034acdbf53198a43d19a8ca00a0928771f2b107276b"
end
resource "certbot-nginx" do
url "https://files.pythonhosted.org/packages/46/96/9fe310ba6b4e2ded1845812546a85cf48990f6bad1a4f5ea2fef09708a6e/certbot-nginx-1.31.0.tar.gz"
sha256 "8f109c5e14061bcffba8c4c6c7341c8bc814756c00461e32136e556abe638510"
end
resource "certifi" do
url "https://files.pythonhosted.org/packages/cb/a4/7de7cd59e429bd0ee6521ba58a75adaec136d32f91a761b28a11d8088d44/certifi-2022.9.24.tar.gz"
sha256 "0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14"
end
resource "cffi" do
url "https://files.pythonhosted.org/packages/2b/a8/050ab4f0c3d4c1b8aaa805f70e26e84d0e27004907c5b8ecc1d31815f92a/cffi-1.15.1.tar.gz"
sha256 "d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9"
end
resource "charset-normalizer" do
url "https://files.pythonhosted.org/packages/a1/34/44964211e5410b051e4b8d2869c470ae8a68ae274953b1c7de6d98bbcf94/charset-normalizer-2.1.1.tar.gz"
sha256 "5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845"
end
resource "ConfigArgParse" do
url "https://files.pythonhosted.org/packages/16/05/385451bc8d20a3aa1d8934b32bd65847c100849ebba397dbf6c74566b237/ConfigArgParse-1.5.3.tar.gz"
sha256 "1b0b3cbf664ab59dada57123c81eff3d9737e0d11d8cf79e3d6eb10823f1739f"
end
resource "configobj" do
url "https://files.pythonhosted.org/packages/64/61/079eb60459c44929e684fa7d9e2fdca403f67d64dd9dbac27296be2e0fab/configobj-5.0.6.tar.gz"
sha256 "a2f5650770e1c87fb335af19a9b7eb73fc05ccf22144eb68db7d00cd2bcb0902"
end
resource "cryptography" do
url "https://files.pythonhosted.org/packages/6d/0c/5e67831007ba6cd7e52c4095f053cf45c357739b0a7c46a45ddd50049019/cryptography-38.0.1.tar.gz"
sha256 "1db3d807a14931fa317f96435695d9ec386be7b84b618cc61cfa5d08b0ae33d7"
end
resource "distro" do
url "https://files.pythonhosted.org/packages/b5/7e/ddfbd640ac9a82e60718558a3de7d5988a7d4648385cf00318f60a8b073a/distro-1.7.0.tar.gz"
sha256 "151aeccf60c216402932b52e40ee477a939f8d58898927378a02abbe852c1c39"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/8b/e1/43beb3d38dba6cb420cefa297822eac205a277ab43e5ba5d5c46faf96438/idna-3.4.tar.gz"
sha256 "814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"
end
resource "josepy" do
url "https://files.pythonhosted.org/packages/f4/be/5c1d9decbd5e9cf97dccd40d13c5657bef936d87da03c9d7aeb67c1b5126/josepy-1.13.0.tar.gz"
sha256 "8931daf38f8a4c85274a0e8b7cb25addfd8d1f28f9fb8fbed053dd51aec75dc9"
end
resource "parsedatetime" do
url "https://files.pythonhosted.org/packages/a8/20/cb587f6672dbe585d101f590c3871d16e7aec5a576a1694997a3777312ac/parsedatetime-2.6.tar.gz"
sha256 "4cb368fbb18a0b7231f4d76119165451c8d2e35951455dfee97c62a87b04d455"
end
resource "pycparser" do
url "https://files.pythonhosted.org/packages/5e/0b/95d387f5f4433cb0f53ff7ad859bd2c6051051cebbb564f139a999ab46de/pycparser-2.21.tar.gz"
sha256 "e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"
end
resource "pyOpenSSL" do
url "https://files.pythonhosted.org/packages/e7/2f/c6d89edac75482f11e231b644e365d31d5479b7b727734e6a8f3d00decd5/pyOpenSSL-22.1.0.tar.gz"
sha256 "7a83b7b272dd595222d672f5ce29aa030f1fb837630ef229f62e72e395ce8968"
end
resource "pyparsing" do
url "https://files.pythonhosted.org/packages/71/22/207523d16464c40a0310d2d4d8926daffa00ac1f5b1576170a32db749636/pyparsing-3.0.9.tar.gz"
sha256 "2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"
end
resource "pyRFC3339" do
url "https://files.pythonhosted.org/packages/00/52/75ea0ae249ba885c9429e421b4f94bc154df68484847f1ac164287d978d7/pyRFC3339-1.1.tar.gz"
sha256 "81b8cbe1519cdb79bed04910dd6fa4e181faf8c88dff1e1b987b5f7ab23a5b1a"
end
resource "python-augeas" do
url "https://files.pythonhosted.org/packages/af/cc/5064a3c25721cd863e6982b87f10fdd91d8bcc62b6f7f36f5231f20d6376/python-augeas-1.1.0.tar.gz"
sha256 "5194a49e86b40ffc57055f73d833f87e39dce6fce934683e7d0d5bbb8eff3b8c"
end
resource "pytz" do
url "https://files.pythonhosted.org/packages/31/da/2d48d3499b59c7f3c5d5e1c79fcee5537c320c8ab7b7a0cd2db578bc34b3/pytz-2022.4.tar.gz"
sha256 "48ce799d83b6f8aab2020e369b627446696619e79645419610b9facd909b3174"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/a5/61/a867851fd5ab77277495a8709ddda0861b28163c4613b011bc00228cc724/requests-2.28.1.tar.gz"
sha256 "7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"
end
resource "requests-toolbelt" do
url "https://files.pythonhosted.org/packages/28/30/7bf7e5071081f761766d46820e52f4b16c8a08fef02d2eb4682ca7534310/requests-toolbelt-0.9.1.tar.gz"
sha256 "968089d4584ad4ad7c171454f0a5c6dac23971e9472521ea3b6d49d610aa6fc0"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/b2/56/d87d6d3c4121c0bcec116919350ca05dc3afd2eeb7dc88d07e8083f8ea94/urllib3-1.26.12.tar.gz"
sha256 "3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"
end
resource "zope.component" do
url "https://files.pythonhosted.org/packages/c5/c0/64931e1e8f2bfde9d8bc01670de2d2a395efcf8f49d3a9daa21cf3ffee2b/zope.component-5.0.1.tar.gz"
sha256 "32cbe426ba8fa7b62ce5b211f80f0718a0c749cc7ff09e3f4b43a57f7ccdf5e5"
end
resource "zope.event" do
url "https://files.pythonhosted.org/packages/30/00/94ed30bfec18edbabfcbd503fcf7482c5031b0fbbc9bc361f046cb79781c/zope.event-4.5.0.tar.gz"
sha256 "5e76517f5b9b119acf37ca8819781db6c16ea433f7e2062c4afc2b6fbedb1330"
end
resource "zope.hookable" do
url "https://files.pythonhosted.org/packages/40/d5/5ed6b312a3a1d66d8e740af301b1cbbf50860d31bc430bd15163de4a50cf/zope.hookable-5.2.tar.gz"
sha256 "4c3018bcf2b39cf5cccf40826f799b4b8c140056db780f96cb0ca332a243bd29"
end
resource "zope.interface" do
url "https://files.pythonhosted.org/packages/ae/58/e0877f58daa69126a5fb325d6df92b20b77431cd281e189c5ec42b722f58/zope.interface-5.4.0.tar.gz"
sha256 "5dba5f530fec3f0988d83b78cc591b58c0b6eb8431a85edd1569a0539a8a5a0e"
end
def install
virtualenv_install_with_resources
bin.install_symlink libexec/"bin/certbot"
pkgshare.install buildpath/"examples"
end
test do
assert_match version.to_s, pipe_output("#{bin}/certbot --version 2>&1")
# This throws a bad exit code but we can check it actually is failing
# for the right reasons by asserting. --version never fails even if
# resources are missing or outdated/too new/etc.
assert_match "Either run as root", shell_output("#{bin}/certbot 2>&1", 1)
end
end