2013-10-21 17:28:40 +00:00
require 'formula'
class TomcatNative < Formula
homepage 'http://tomcat.apache.org/native-doc/'
2014-04-15 17:48:46 +00:00
url 'http://www.apache.org/dyn/closer.cgi?path=tomcat/tomcat-connectors/native/1.1.30/source/tomcat-native-1.1.30-src.tar.gz'
sha1 '07fca7c3e7b8301fc80b0e3c317e642a3616142a'
2013-10-21 17:28:40 +00:00
depends_on :libtool = > :build
depends_on 'tomcat' = > :recommended
2014-03-30 02:24:27 +00:00
depends_on 'openssl'
2013-10-21 17:28:40 +00:00
def install
2014-03-30 02:24:27 +00:00
cd " jni/native " do
system " ./configure " , " --prefix= #{ prefix } " ,
" --with-apr= #{ MacOS . sdk_path } /usr " ,
" --with-java-home= #{ ` /usr/libexec/java_home ` } " ,
" --with-ssl= #{ Formula [ " openssl " ] . prefix } "
2014-02-26 05:43:09 +00:00
2013-10-21 17:28:40 +00:00
# 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
2014-02-26 05:43:09 +00:00
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
2013-11-09 22:08:08 +00:00
2014-02-26 05:43:09 +00:00
CATALINA_OPTS = \ " $CATALINA_OPTS -Djava.library.path= #{ lib } \"
2013-11-09 22:08:08 +00:00
If $CATALINA_HOME / bin / setenv . sh doesn ' t exist , create it and make it executable .
2013-10-21 17:28:40 +00:00
EOS
end
end