aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/clipsafe.rb
blob: 81e6af409a58def6d2286ce015832e9dab736280 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
require "formula"

class Clipsafe < Formula
  homepage "http://waxandwane.org/clipsafe.html"
  url "http://waxandwane.org/download/clipsafe-1.1.tar.gz"
  sha1 "5e940a3f89821bfb3315ff9b1be4256db27e5f6a"

  depends_on :macos => :mountain_lion

  resource "Crypt::Twofish" do
    url "http://search.cpan.org/CPAN/authors/id/A/AM/AMS/Crypt-Twofish-2.17.tar.gz"
    mirror "http://search.mcpan.org/CPAN/authors/id/A/AM/AMS/Crypt-Twofish-2.17.tar.gz"
    sha1 "f2659d7b9e7d7daadb3b2414174bd6ec8ac68eda"
  end

  resource "Digest::SHA" do
    url "http://search.cpan.org/CPAN/authors/id/M/MS/MSHELOR/Digest-SHA-5.85.tar.gz"
    mirror "http://search.mcpan.org/CPAN/authors/id/M/MS/MSHELOR/Digest-SHA-5.85.tar.gz"
    sha1 "a603cfba95afcd0266c9482c0c93e84241fe0ce0"
  end

  resource "DateTime" do
    url "http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/DateTime-1.03.tar.gz"
    mirror "http://search.mcpan.org/CPAN/authors/id/D/DR/DROLSKY/DateTime-1.03.tar.gz"
    sha1 "23cad043140988ea95ad8dcb3095cc5aded0464e"
  end

  def install
    ENV.prepend_create_path "PERL5LIB", libexec+"lib/perl5"

    resource("Crypt::Twofish").stage do
      system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}"
      system "make"
      system "make", "install"
    end

    resource("Digest::SHA").stage do
      system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}"
      system "make"
      system "make", "install"
    end

    resource("DateTime").stage do
      system "perl", "Build.PL", "--install_base=#{libexec}"
      system "./Build"
      system "./Build", "install"
    end

    bin.install "clipsafe"
    bin.env_script_all_files(libexec+"bin", :PERL5LIB => ENV["PERL5LIB"])
  end

  test do
    ENV["TERM"] = "dumb"
    system "#{bin}/clipsafe", "--help"
  end
end