homebrew-core/Formula/apr-util.rb
2016-09-19 15:07:34 -04:00

60 lines
2.1 KiB
Ruby

class AprUtil < Formula
desc "Companion library to apr, the Apache Portable Runtime library"
homepage "https://apr.apache.org/"
url "https://www.apache.org/dyn/closer.cgi?path=apr/apr-util-1.5.4.tar.bz2"
sha256 "a6cf327189ca0df2fb9d5633d7326c460fe2b61684745fd7963e79a6dd0dc82e"
revision 4
bottle do
sha256 "0e82b536d5f697be09ffb1c5bb6f155d811f1a9a2567eea6d1a21dcd86359c16" => :sierra
sha256 "e0fe4c2939676b5568cb8ff5f4c299a0fc82ac5d1e76a522a32511d3f3d9cdbf" => :el_capitan
sha256 "a677dd9c3b8a10412c41b85513d2c906ac00f3a7c4196aeb092da064df851600" => :yosemite
end
keg_only :provided_by_osx, "Apple's CLT package contains apr."
option :universal
depends_on "apr"
depends_on "openssl"
depends_on "postgresql" => :optional
depends_on "mysql" => :optional
depends_on "freetds" => :optional
depends_on "unixodbc" => :optional
depends_on "sqlite" => :optional
depends_on "homebrew/dupes/openldap" => :optional
def install
ENV.universal_binary if build.universal?
# Stick it in libexec otherwise it pollutes lib with a .exp file.
args = %W[
--prefix=#{libexec}
--with-apr=#{Formula["apr"].opt_prefix}
--with-openssl=#{Formula["openssl"].opt_prefix}
]
args << "--with-pgsql=#{Formula["postgresql"].opt_prefix}" if build.with? "postgresql"
args << "--with-mysql=#{Formula["mysql"].opt_prefix}" if build.with? "mysql"
args << "--with-freetds=#{Formula["freetds"].opt_prefix}" if build.with? "freetds"
args << "--with-odbc=#{Formula["unixodbc"].opt_prefix}" if build.with? "unixodbc"
if build.with? "openldap"
args << "--with-ldap"
args << "--with-ldap-lib=#{Formula["openldap"].opt_lib}"
args << "--with-ldap-include=#{Formula["openldap"].opt_include}"
end
system "./configure", *args
system "make"
system "make", "install"
bin.install_symlink Dir["#{libexec}/bin/*"]
# No need for this to point to the versioned path.
inreplace libexec/"bin/apu-1-config", libexec, opt_libexec
end
test do
assert_match opt_libexec.to_s, shell_output("#{bin}/apu-1-config --prefix")
end
end