diff options
| author | Jack Nagel | 2013-07-22 22:39:33 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-07-22 22:39:33 -0500 |
| commit | f09b45f3b99ad6e934b3724868fc73dcd252046c (patch) | |
| tree | 2c7161179a39d027ee7f3eb95e36f3c378746e47 /Library/Formula | |
| parent | 736bb81772bbfd1127080a86606bd525185f53ca (diff) | |
| download | homebrew-f09b45f3b99ad6e934b3724868fc73dcd252046c.tar.bz2 | |
zabbix: clean up inline ternaries
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/zabbix.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Library/Formula/zabbix.rb b/Library/Formula/zabbix.rb index a3df86bc6..ef6fecb26 100644 --- a/Library/Formula/zabbix.rb +++ b/Library/Formula/zabbix.rb @@ -8,8 +8,9 @@ class Zabbix < Formula option 'with-mysql', 'Use Zabbix Server with MySQL library instead PostgreSQL.' option 'agent-only', 'Install only the Zabbix Agent without Server and Proxy.' - unless build.include?('agent-only') - depends_on (build.include?('with-mysql') ? :mysql : :postgresql) + unless build.include? 'agent-only' + depends_on :mysql => :optional + depends_on :postgresql unless build.with? 'mysql' depends_on 'fping' depends_on 'libssh2' end @@ -26,29 +27,28 @@ class Zabbix < Formula --enable-agent } - unless build.include?('agent-only') - db_adapter = if build.include?('with-mysql') - "--with-mysql=#{brewed_or_shipped('mysql_config')}" - else - "--with-postgresql=#{brewed_or_shipped('pg_config')}" - end + unless build.include? 'agent-only' args += %W{ --enable-server --enable-proxy - #{db_adapter} --enable-ipv6 --with-net-snmp --with-libcurl --with-ssh2 } + if build.with? 'mysql' + args << "--with-mysql=#{brewed_or_shipped('mysql_config')}" + else + args << "--with-postgresql=#{brewed_or_shipped('pg_config')}" + end end system "./configure", *args system "make install" - unless build.include?('agent-only') - (share/'zabbix').install 'frontends/php', - "database/#{build.include?('with-mysql') ? :mysql : :postgresql}" + unless build.include? 'agent-only' + db = build.with?('mysql') ? 'mysql' : 'postgresql' + (share/'zabbix').install 'frontends/php', "database/#{db}" end end |
