class WildflyAs < Formula desc "Managed application runtime for building applications" homepage "http://wildfly.org/" url "https://download.jboss.org/wildfly/10.1.0.Final/wildfly-10.1.0.Final.tar.gz" sha256 "80781609be387045273f974662dadf7f64ad43ee93395871429bc6b7786ec8bc" bottle :unneeded depends_on :java => "1.8+" def install rm_f Dir["bin/*.bat"] rm_f Dir["bin/*.ps1"] libexec.install Dir["*"] mkdir_p libexec/"standalone/log" end def caveats; <<-EOS.undent The home of WildFly Application Server #{version} is: #{opt_libexec} You may want to add the following to your .bash_profile: export JBOSS_HOME=#{opt_libexec} export PATH=${PATH}:${JBOSS_HOME}/bin EOS end plist_options :manual => "#{HOMEBREW_PREFIX}/opt/wildfly-as/libexec/bin/standalone.sh --server-config=standalone.xml" def plist; <<-EOS.undent Label #{plist_name} KeepAlive SuccessfulExit Crashed ProgramArguments #{opt_libexec}/bin/standalone.sh --server-config=standalone.xml EnvironmentVariables JBOSS_HOME #{opt_libexec} WILDFLY_HOME #{opt_libexec} EOS end test do ENV["JBOSS_HOME"] = opt_libexec system "#{opt_libexec}/bin/standalone.sh --version | grep #{version}" end end