From 5d5760a4cbd5a4ff48daf3208c6957198ab4d5ce Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 28 Apr 2012 16:31:03 -0500 Subject: cvs2svn: use a requirement for python with gdbm Signed-off-by: Jack Nagel --- Library/Formula/cvs2svn.rb | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'Library/Formula/cvs2svn.rb') diff --git a/Library/Formula/cvs2svn.rb b/Library/Formula/cvs2svn.rb index e698828bb..6538a80b6 100644 --- a/Library/Formula/cvs2svn.rb +++ b/Library/Formula/cvs2svn.rb @@ -1,19 +1,33 @@ require 'formula' +class PythonWithGdbm < Requirement + def message; <<-EOS.undent + The Python being used does not include gdbm support, + but it is required to build this formula: + + #{`which python`.chomp} + + Homebrew's Python includes gdbm support. + EOS + end + + def satisfied? + quiet_system "python", "-c", "import gdbm" + end + + def fatal? + true + end +end + class Cvs2svn < Formula url 'http://trac.macports.org/export/70472/distfiles/cvs2svn/cvs2svn-2.3.0.tar.gz' homepage 'http://cvs2svn.tigris.org/' md5 '6c412baec974f3ff64b9145944682a15' - def install - unless quiet_system "/usr/bin/env", "python", "-c", "import gdbm" - onoe "The Python being used doesn't have gdbm support:" - puts `which python` - puts "The Homebrew-built Python does include gdbm support, which" - puts "is required for this formula." - exit 1 - end + depends_on PythonWithGdbm.new + def install system "python", "setup.py", "install", "--prefix=#{prefix}" system "make man" man1.install gzip('cvs2svn.1', 'cvs2git.1', 'cvs2bzr.1') -- cgit v1.2.3