homebrew-core/Formula/apr-util.rb
2018-01-18 09:57:03 +00: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.6.1.tar.bz2"
sha256 "d3e12f7b6ad12687572a3a39475545a072608f4ba03a6ce8a3778f607dd0035b"
revision 1
bottle do
sha256 "1bdf0cda4f0015318994a162971505f9807cb0589a4b0cbc7828531e19b6f739" => :high_sierra
sha256 "75c244c3a34abab343f0db7652aeb2c2ba472e7ad91f13af5524d17bba3001f2" => :sierra
sha256 "bae285ada445a2b5cc8b43cb8c61a75e177056c6176d0622f6f87b1b17a8502f" => :el_capitan
end
keg_only :provided_by_macos, "Apple's CLT package contains apr"
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 "openldap" => :optional
def install
# 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}
--with-crypto
]
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/*"]
rm Dir[libexec/"lib/*.la"]
rm Dir[libexec/"lib/apr-util-1/*.la"]
# 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