2013-10-22 14:35:54 +00:00
|
|
|
class Apib < Formula
|
2014-11-08 02:29:11 +00:00
|
|
|
homepage "https://github.com/apigee/apib"
|
|
|
|
url "https://github.com/apigee/apib/archive/APIB_1_0.tar.gz"
|
|
|
|
sha1 "d7a5a2accd6bda7efeca433141b5df44ccd7f0b0"
|
|
|
|
revision 1
|
|
|
|
|
2014-11-08 02:35:52 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
|
|
|
sha1 "ffdea23d6f3e9627d3d99ec931d29f1e93f7dd9f" => :yosemite
|
|
|
|
sha1 "d7443be34f3d7b9347c26bfdaae5c46eab41e3c8" => :mavericks
|
|
|
|
sha1 "0952c22383ab1f4da194d66b823dd513a3f30ac8" => :mountain_lion
|
|
|
|
end
|
|
|
|
|
2014-11-08 02:29:11 +00:00
|
|
|
depends_on :apr => :build
|
|
|
|
depends_on "openssl"
|
2013-10-22 14:35:54 +00:00
|
|
|
|
|
|
|
def install
|
2015-01-06 18:54:29 +00:00
|
|
|
# Upstream hardcodes finding apr in /usr/include. When CLT is not present
|
|
|
|
# we need to fix this so our apr requirement works.
|
|
|
|
# https://github.com/apigee/apib/issues/11
|
|
|
|
unless MacOS::CLT.installed?
|
|
|
|
inreplace "configure" do |s|
|
|
|
|
s.gsub! "/usr/include/apr-1.0", "#{Formula["apr"].opt_prefix}/libexec/include/apr-1"
|
|
|
|
s.gsub! "/usr/include/apr-1", "#{Formula["apr"].opt_prefix}/libexec/include/apr-1"
|
|
|
|
end
|
|
|
|
ENV.append "LDFLAGS", "-L#{Formula["apr-util"].opt_prefix}/libexec/lib"
|
|
|
|
ENV.append "LDFLAGS", "-L#{Formula["apr"].opt_prefix}/libexec/lib"
|
|
|
|
ENV.append "CFLAGS", "-I#{Formula["apr"].opt_prefix}/libexec/include/apr-1"
|
|
|
|
ENV.append "CFLAGS", "-I#{Formula["apr-util"].opt_prefix}/libexec/include/apr-1"
|
|
|
|
end
|
|
|
|
|
2013-10-22 14:35:54 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}"
|
|
|
|
system "make"
|
2014-11-08 02:29:11 +00:00
|
|
|
bin.install "apib", "apibmon"
|
2013-10-22 14:35:54 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2014-11-08 02:29:11 +00:00
|
|
|
system "#{bin}/apib", "-c 1", "-d 1", "https://www.google.com"
|
2013-10-22 14:35:54 +00:00
|
|
|
end
|
|
|
|
end
|