aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/pius.rb
blob: 6e0d16f9e557be4b175f177f8a00876542a750c3 (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
require 'formula'
class GnupgInstalled < Requirement
  fatal true

  satisfy { which('gpg') || which('gpg2') }

  def message; <<-EOS.undent
    Gnupg is required to use these tools.

    You can install Gnupg or Gnupg2 with Homebrew:
      brew install gnupg
      brew install gnupg2

    Or you can use one of several different
    prepackaged installers that are available.
    EOS
  end
end

class Pius < Formula
  homepage 'http://www.phildev.net/pius/'
  url 'http://downloads.sourceforge.net/project/pgpius/pius/2.0.10/pius-2.0.10.tar.bz2'
  sha1 '47dadf604cb1eac7ad2ee6594745b0ecc4af4ede'

  depends_on GnupgInstalled

  def install
    # Replace hardcoded gpg path: https://sourceforge.net/p/pgpius/bugs/12/
    inreplace 'pius', '/usr/bin/gpg', HOMEBREW_PREFIX/'bin/gpg'
    bin.install 'pius'
    bin.install 'pius-keyring-mgr'
    bin.install 'pius-party-worksheet'
  end
end