aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorAnders F Bjorklund2011-01-19 17:04:14 +0100
committerJack Nagel2012-09-02 17:02:59 -0500
commit306cb31c5366fdc8b08438e11114c6220dcc3178 (patch)
treea55e04188bd6f90e21ce4616460c762e3405b058 /Library/Formula
parentb420ba34d18a25baa5861d30309627b16819b0bd (diff)
downloadhomebrew-306cb31c5366fdc8b08438e11114c6220dcc3178.tar.bz2
zeroinstall-injector 1.11
Closes #12442. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/zeroinstall-injector.rb54
1 files changed, 54 insertions, 0 deletions
diff --git a/Library/Formula/zeroinstall-injector.rb b/Library/Formula/zeroinstall-injector.rb
new file mode 100644
index 000000000..f39d71946
--- /dev/null
+++ b/Library/Formula/zeroinstall-injector.rb
@@ -0,0 +1,54 @@
+require 'formula'
+
+class GnupgInstalled < Requirement
+ 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
+
+ def satisfied?
+ which 'gpg' or which 'gpg2'
+ end
+
+ def fatal?
+ false
+ end
+end
+
+class ZeroinstallInjector < Formula
+ homepage 'http://0install.net/injector.html'
+ url 'http://downloads.sourceforge.net/project/zero-install/injector/1.11/zeroinstall-injector-1.11.tar.bz2'
+ sha256 'a1a9e79b32dcdbc095dbe4901a9c4115d2949b530f6a16aed1c58579d18c9c95'
+
+ head 'http://repo.or.cz/r/zeroinstall.git'
+
+ option 'without-gui', "Build without the gui (requires GTK+)"
+
+ depends_on GnupgInstalled.new
+ depends_on 'pygobject' if build.include? 'without-gui'
+ depends_on 'pygtk' unless build.include? 'without-gui'
+ depends_on 'gettext' if build.head?
+
+ def install
+ inreplace 'setup.py', "man/man1", "share/man/man1"
+ system "make", "translations" if build.head?
+ system "python", "setup.py", "install", "--prefix=#{prefix}"
+ end
+
+ def caveats; <<-EOS.undent
+ For non-Homebrew Python, you need to amend your PYTHONPATH like so:
+ export PYTHONPATH=#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages:$PYTHONPATH
+ EOS
+ end
+
+ def which_python
+ "python" + `python -c 'import sys;print(sys.version[:3])'`.strip
+ end
+end