diff options
| author | Matthew Hall | 2013-11-13 15:56:09 -0800 | 
|---|---|---|
| committer | Mike McQuaid | 2014-08-21 14:45:27 +0100 | 
| commit | 4c7083468c4264fe6f44e9527d7b37efbd15c5fb (patch) | |
| tree | d291405fb59e8ef9c263cd03e10798af0e5eb708 | |
| parent | d3482d18ede88790f51c66ab440eb441ae98c41b (diff) | |
| download | homebrew-4c7083468c4264fe6f44e9527d7b37efbd15c5fb.tar.bz2 | |
net-snmp: add optional python bindings.
- Rebased megahall's PR #24279 on homebrew/master
- Modified to use `which python` as requested there
| -rw-r--r-- | Library/Formula/net-snmp.rb | 34 | 
1 files changed, 23 insertions, 11 deletions
| 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 | 
