2014-07-03 23:26:16 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
class Onetime < Formula
|
|
|
|
homepage "http://red-bean.com/onetime/"
|
|
|
|
url "http://red-bean.com/onetime/onetime-1.81.tar.gz"
|
|
|
|
sha1 "db8f84963ed7b5831fdf4c19b4494cf7bfd5b753"
|
|
|
|
|
2014-07-04 17:10:38 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
|
|
|
sha1 "efecf649c941cde0917e4660db0ba460f2193554" => :mavericks
|
|
|
|
sha1 "ec09cda341e360b493e28cf05b2ef847caafd90d" => :mountain_lion
|
|
|
|
sha1 "b243466379b50a72945aaa124405a5e350dc9203" => :lion
|
|
|
|
end
|
|
|
|
|
2014-07-03 23:26:16 +00:00
|
|
|
devel do
|
|
|
|
url "https://github.com/kfogel/OneTime/archive/2.0-beta2.tar.gz"
|
|
|
|
version "2.0.02"
|
|
|
|
sha1 "2dbfe3f6479aed6c9e76337dd27b063ff73967fa"
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
# inreplace required for now due to upstream issue:
|
|
|
|
# https://github.com/kfogel/OneTime/issues/11
|
|
|
|
inreplace "Makefile", "$(DESTDIR)/usr/bin/", "$(DESTDIR)#{bin}"
|
|
|
|
mkdir bin
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2014-07-04 17:53:07 +00:00
|
|
|
system "dd", "if=/dev/random", "of=pad_data.txt", "bs=1024", "count=1"
|
2014-07-04 17:34:03 +00:00
|
|
|
(testpath+'input.txt').write "INPUT"
|
|
|
|
system "#{bin}/onetime", "-e", "--pad=pad_data.txt", "--no-trace",
|
|
|
|
"--config=.", "input.txt"
|
|
|
|
system "#{bin}/onetime", "-d", "--pad=pad_data.txt", "--no-trace",
|
|
|
|
"--config=.", "input.txt.onetime"
|
2014-07-03 23:26:16 +00:00
|
|
|
end
|
|
|
|
end
|