aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/onetime.rb
blob: c6fdff14c30322f1d526a09bec12de7b6d3845fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require "formula"

class Onetime < Formula
  homepage "http://red-bean.com/onetime/"
  url "http://red-bean.com/onetime/onetime-1.81.tar.gz"
  sha1 "db8f84963ed7b5831fdf4c19b4494cf7bfd5b753"

  bottle do
    cellar :any
    sha1 "efecf649c941cde0917e4660db0ba460f2193554" => :mavericks
    sha1 "ec09cda341e360b493e28cf05b2ef847caafd90d" => :mountain_lion
    sha1 "b243466379b50a72945aaa124405a5e350dc9203" => :lion
  end

  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
    system "dd", "if=/dev/random", "of=pad_data.txt", "bs=1024", "count=1"
    (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"
  end
end