homebrew-core/Formula/pwsafe.rb
2019-01-13 12:22:56 +01:00

45 lines
1.6 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 3
bottle do
cellar :any
sha256 "026ad06d35f0ae8b1a6e2699d02803e45df2aa05289d7ec2beb839ec5e6c232f" => :mojave
sha256 "a737903a6af98cf1de3bef38bc2e168d0d2fdc0beb1a708b872776b4298d1100" => :high_sierra
sha256 "a0c772ed64270de75bba371d2c4292f898127c08e68adc4edd6bfc35cf769854" => :sierra
end
depends_on "openssl"
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