class Fuseki < Formula desc "SPARQL server" homepage "https://jena.apache.org/documentation/fuseki2/" url "https://archive.apache.org/dist/jena/binaries/apache-jena-fuseki-3.13.1.tar.gz" sha256 "fe3003941ded224edeab9e9dc3221b46b3cfa2743d1b0218210dcacde2010b05" bottle :unneeded def install prefix.install "bin" %w[fuseki-server fuseki].each do |exe| libexec.install exe (bin/exe).write_env_script(libexec/exe, :FUSEKI_BASE => var/"fuseki", :FUSEKI_HOME => libexec, :FUSEKI_LOGS => var/"log/fuseki", :FUSEKI_RUN => var/"run") end # Non-symlinked binaries and application files libexec.install "fuseki-server.jar", "fuseki.war", "webapp" end def post_install # Create a location for dataset and log files, # in case we're being used in LaunchAgent mode (var/"fuseki").mkpath (var/"log/fuseki").mkpath end plist_options :manual => "fuseki start" def plist; <<~EOS Label #{plist_name} RunAtLoad KeepAlive ProgramArguments #{opt_bin}/fuseki-server EOS end test do system "#{bin}/fuseki-server", "--version" end end