class ShibbolethSp < Formula desc "Shibboleth 2 Service Provider daemon" homepage "https://wiki.shibboleth.net/confluence/display/SHIB2" url "https://shibboleth.net/downloads/service-provider/3.0.2/shibboleth-sp-3.0.2.tar.bz2" sha256 "7aab399aeaf39145c60e1713dbc29a65f618e9eca84505f5ed03cee63e3f31a3" revision 4 bottle do sha256 "d594a58a8f28666a09dafa0fd3a9f204d069e14a8b89235d7eacc16019f7b2d3" => :mojave sha256 "f3c5a41017aefec816c7c00f74eca77712d5e3e9e6491dc8cf5c94ef22568e4a" => :high_sierra sha256 "c98845a91f1be9a54e2c9ee1f464c68ad2989340fd6fd934b851dda696658262" => :sierra end depends_on "apr" => :build depends_on "apr-util" => :build depends_on "pkg-config" => :build depends_on "boost" depends_on "httpd" if MacOS.version >= :high_sierra depends_on "log4shib" depends_on :macos => :yosemite depends_on "opensaml" depends_on "openssl" depends_on "unixodbc" depends_on "xerces-c" depends_on "xml-security-c" depends_on "xml-tooling-c" def install ENV.O2 # Os breaks the build ENV.cxx11 args = %W[ --disable-debug --disable-dependency-tracking --disable-silent-rules --prefix=#{prefix} --localstatedir=#{var} --sysconfdir=#{etc} --with-xmltooling=#{Formula["xml-tooling-c"].opt_prefix} --with-saml=#{Formula["opensaml"].opt_prefix} --enable-apache-24 DYLD_LIBRARY_PATH=#{lib} ] if MacOS.version >= :high_sierra args << "--with-apxs24=#{Formula["httpd"].opt_bin}/apxs" end system "./configure", *args system "make", "install" end def post_install (var/"run/shibboleth/").mkpath (var/"cache/shibboleth").mkpath end plist_options :startup => true, :manual => "shibd" def plist; <<~EOS Label #{plist_name} ProgramArguments #{opt_sbin}/shibd -F -f -p #{var}/run/shibboleth/shibd.pid RunAtLoad KeepAlive EOS end test do system sbin/"shibd", "-t" end end