aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/duplicity.rb
blob: 6e56d3fa8eee5dc8c409041d8dbfa90c6bde7efb (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
require 'formula'

class Duplicity < Formula
  homepage 'http://www.nongnu.org/duplicity/'
  url 'http://code.launchpad.net/duplicity/0.6-series/0.6.23/+download/duplicity-0.6.23.tar.gz'
  sha1 '0b8664d55c24957b3b19e903c0d69673f2bfa166'

  depends_on :python
  depends_on 'librsync'
  depends_on 'gnupg'

  option :universal

  resource 'lockfile' do
    url 'https://pypi.python.org/packages/source/l/lockfile/lockfile-0.9.1.tar.gz'
    sha1 '9870cc7e7d4b23f0b6c39cf6ba597c87871ac6de'
  end

  resource 'paramiko' do
    url 'https://pypi.python.org/packages/source/p/paramiko/paramiko-1.12.1.tar.gz'
    sha1 '3809737533b3055b9822a86bee6bd1629144204d'
  end

  def install
    ENV.universal_binary if build.universal?

    ENV.prepend_create_path 'PYTHONPATH', libexec+'lib/python2.7/site-packages'
    install_args = [ "setup.py", "install", "--prefix=#{libexec}" ]
    resource('lockfile').stage { system "python", *install_args }
    resource('paramiko').stage { system "python", *install_args }

    system "python", "setup.py", "install", "--prefix=#{prefix}"

    bin.env_script_all_files(libexec+'bin', :PYTHONPATH => ENV['PYTHONPATH'])
  end

  test do
    system "duplicity", "--version"
  end
end