From 4c7083468c4264fe6f44e9527d7b37efbd15c5fb Mon Sep 17 00:00:00 2001 From: Matthew Hall Date: Wed, 13 Nov 2013 15:56:09 -0800 Subject: net-snmp: add optional python bindings. - Rebased megahall's PR #24279 on homebrew/master - Modified to use `which python` as requested there --- Library/Formula/net-snmp.rb | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/net-snmp.rb b/Library/Formula/net-snmp.rb index b8c555701..ff81df47d 100644 --- a/Library/Formula/net-snmp.rb +++ b/Library/Formula/net-snmp.rb @@ -11,18 +11,30 @@ class NetSnmp < Formula sha1 "5e46232a2508a3cb6543f0438569090f78e4a20e" end + depends_on :python => :optional + def install - system "./configure", "--disable-debugging", - "--prefix=#{prefix}", - "--enable-ipv6", - "--with-defaults", - "--with-persistent-directory=#{var}/db/net-snmp", - "--with-logfile=#{var}/log/snmpd.log", - "--with-mib-modules=host ucd-snmp/diskio", - "--without-rpm", - "--without-kmem-usage", - "--disable-embedded-perl", - "--without-perl-modules" + args = [ + "--disable-debugging", + "--prefix=#{prefix}", + "--enable-ipv6", + "--with-defaults", + "--with-persistent-directory=#{var}/db/net-snmp", + "--with-logfile=#{var}/log/snmpd.log", + "--with-mib-modules=host ucd-snmp/diskio", + "--without-rpm", + "--without-kmem-usage", + "--disable-embedded-perl", + "--without-perl-modules", + ] + + if build.with? "python" + args << "--with-python-modules" + # the net-snmp configure script finds the wrong python + ENV['PYTHONPROG'] = `which python` + end + + system "./configure", *args system "make" system "make install" end -- cgit v1.2.3