diff options
| author | David Creemer | 2014-08-20 22:26:57 -0700 |
|---|---|---|
| committer | Mike McQuaid | 2014-08-24 16:38:24 +0100 |
| commit | bdc39f05a7d580fa23b34ad26a2a49f5fe5a0e7a (patch) | |
| tree | d1126f2e9d3e257f7f6f431c4fedc3d52ded2ad5 | |
| parent | 7810b9c75426f30f636649273bf4fc0b5aa8b16a (diff) | |
| download | homebrew-bdc39f05a7d580fa23b34ad26a2a49f5fe5a0e7a.tar.bz2 | |
onepass 0.2.1 (new formula)
| -rw-r--r-- | Library/Formula/onepass.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Library/Formula/onepass.rb b/Library/Formula/onepass.rb new file mode 100644 index 000000000..f894f197e --- /dev/null +++ b/Library/Formula/onepass.rb @@ -0,0 +1,39 @@ +require "formula" + +class Onepass < Formula + homepage "https://github.com/georgebrock/1pass" + url "https://github.com/georgebrock/1pass/archive/0.2.1.tar.gz" + sha1 "47adac676208d83e9c9eca089894165868147547" + head "https://github.com/georgebrock/1pass.git" + + depends_on :python if MacOS.version <= :snow_leopard + depends_on "swig" => :build + + resource "M2Crypto" do + url "https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.22.3.tar.gz" + sha1 "c5e39d928aff7a47e6d82624210a7a31b8220a50" + end + + resource "fuzzywuzzy" do + url "https://pypi.python.org/packages/source/f/fuzzywuzzy/fuzzywuzzy-0.2.tar.gz" + sha1 "ef080ced775dee1669150ebe4bd93c69f51af16f" + end + + def install + ENV.prepend_create_path "PYTHONPATH", "#{libexec}/lib/python2.7/site-packages" + + install_args = [ "setup.py", "install", "--prefix=#{libexec}" ] + resource("M2Crypto").stage { system "python", *install_args } + resource("fuzzywuzzy").stage { system "python", *install_args } + + system "python", "setup.py", "install", "--prefix=#{libexec}" + bin.install Dir[libexec/"bin/*"] + (share+"tests").install Dir["tests/data/*"] + bin.env_script_all_files(libexec+"bin", :PYTHONPATH => ENV["PYTHONPATH"]) + end + + test do + assert_equal "123456", `echo "badger" | #{bin}/1pass --no-prompt --path #{share}/tests/1Password.Agilekeychain onetosix`.strip + assert_equal 0, $?.exitstatus + end +end |
