55 lines
2.3 KiB
Ruby
55 lines
2.3 KiB
Ruby
class TomcatNative < Formula
|
|
desc "Lets Tomcat use some native resources for performance"
|
|
homepage "https://tomcat.apache.org/native-doc/"
|
|
url "https://www.apache.org/dyn/closer.cgi?path=tomcat/tomcat-connectors/native/1.2.6/source/tomcat-native-1.2.6-src.tar.gz"
|
|
mirror "https://archive.apache.org/dist/tomcat/tomcat-connectors/native/1.2.6/source/tomcat-native-1.2.6-src.tar.gz"
|
|
sha256 "be2de404be7153af45073296a3c750171a7cfaaab027ff5acfdc910123f96730"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "401c6616d6b54a6e8c48d8b5912e6c1318ca4c3cf1b6591d7ce194d08342a174" => :el_capitan
|
|
sha256 "35d04439f2c24d11de5126770e0fffcd322a78590b06c932942e517f2b75e636" => :yosemite
|
|
sha256 "b1702d3088e2ed8454d71408ccae9bfc2458e4bfb40cf8b1156df2f2a21cd105" => :mavericks
|
|
end
|
|
|
|
option "with-apr", "Include APR support via Homebrew"
|
|
|
|
depends_on "libtool" => :build
|
|
depends_on "tomcat" => :recommended
|
|
depends_on :java => "1.7+"
|
|
depends_on "openssl"
|
|
depends_on "apr" => :optional
|
|
|
|
def install
|
|
cd "native" do
|
|
if build.with? "apr"
|
|
apr_path = Formula["apr"].opt_prefix
|
|
else
|
|
apr_path = "#{MacOS.sdk_path}/usr"
|
|
end
|
|
system "./configure", "--prefix=#{prefix}",
|
|
"--with-apr=#{apr_path}",
|
|
"--with-java-home=#{ENV["JAVA_HOME"]}",
|
|
"--with-ssl=#{Formula["openssl"].opt_prefix}"
|
|
|
|
# fixes occasional compiling issue: glibtool: compile: specify a tag with `--tag'
|
|
args = ["LIBTOOL=glibtool --tag=CC"]
|
|
# fixes a broken link in mountain lion's apr-1-config (it should be /XcodeDefault.xctoolchain/):
|
|
# usr/local/opt/libtool/bin/glibtool: line 1125: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc: No such file or directory
|
|
args << "CC=#{ENV.cc}" if MacOS.version >= :mountain_lion
|
|
system "make", *args
|
|
system "make", "install"
|
|
end
|
|
end
|
|
|
|
def caveats; <<-EOS.undent
|
|
In order for tomcat's APR lifecycle listener to find this library, you'll
|
|
need to add it to java.library.path. This can be done by adding this line
|
|
to $CATALINA_HOME/bin/setenv.sh
|
|
|
|
CATALINA_OPTS=\"$CATALINA_OPTS -Djava.library.path=#{lib}\"
|
|
|
|
If $CATALINA_HOME/bin/setenv.sh doesn't exist, create it and make it executable.
|
|
EOS
|
|
end
|
|
end
|