homebrew-core/Formula/pwsafe.rb
2019-10-18 08:04:22 +02:00

46 lines
1.7 KiB
Ruby

class Pwsafe < Formula
desc "Generate passwords and manage encrypted password databases"
homepage "https://github.com/nsd20463/pwsafe"
url "https://src.fedoraproject.org/repo/pkgs/pwsafe/pwsafe-0.2.0.tar.gz/4bb36538a2772ecbf1a542bc7d4746c0/pwsafe-0.2.0.tar.gz"
sha256 "61e91dc5114fe014a49afabd574eda5ff49b36c81a6d492c03fcb10ba6af47b7"
revision 4
bottle do
cellar :any
sha256 "5f952aa85147c86d2f77f9054fe228484820388c3b1e92c39c12432a15ca0f54" => :catalina
sha256 "94c4b9684c2709c7cbd168609db33271ede431f1f72c348bb508e65a07bf8faa" => :mojave
sha256 "5d5a277678e752596a342712e46dd2e1ce015d6897ad7f74437509a39f47b5ce" => :high_sierra
sha256 "e5fd7f0c41f73c0bdf2f455b7ad659d27931afc1e78536e11a0553be0e8cade1" => :sierra
end
depends_on "openssl@1.1"
depends_on "readline"
# A password database for testing is provided upstream. How nice!
resource "test-pwsafe-db" do
url "https://raw.githubusercontent.com/nsd20463/pwsafe/208de3a94339df36b6e9cd8aeb7e0be0a67fd3d7/test.dat"
sha256 "7ecff955871e6e58e55e0794d21dfdea44a962ff5925c2cd0683875667fbcc79"
end
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--mandir=#{man}"
system "make", "install"
end
test do
test_db_passphrase = "abc"
test_account_name = "testing"
test_account_pass = "sg1rIWHL?WTOV=d#q~DmxiQq%_j-$f__U7EU"
resource("test-pwsafe-db").stage do
Utils.popen(
"#{bin}/pwsafe -f test.dat -p #{test_account_name}", "r+"
) do |pipe|
pipe.puts test_db_passphrase
assert_match(/^#{Regexp.escape(test_account_pass)}$/, pipe.read)
end
end
end
end