class ShibbolethSp < Formula desc "Shibboleth 2 Service Provider daemon" homepage "https://wiki.shibboleth.net/confluence/display/SHIB2" url "https://shibboleth.net/downloads/service-provider/2.6.0/shibboleth-sp-2.6.0.tar.gz" sha256 "7f23b8a28e66ae1b0fe525ca1f8b84c4566a071367f5d9a1bd71bd6b29e4d985" bottle do rebuild 2 sha256 "38b259cc8b2d73e2c457891b7be04a733e972b74a92e6e02eaf5ddd477e6b836" => :high_sierra sha256 "c8d1aa1d414752ec1f379e5eabd1ce452a567b7110b154eb8fb5ac66ed26d381" => :sierra sha256 "14369604b2773cceba09e37a94e46f92c6eed7aab1c6d143de3a0af754584ccf" => :el_capitan end depends_on :macos => :yosemite depends_on "curl" => "with-openssl" depends_on "httpd" if MacOS.version >= :high_sierra depends_on "opensaml" depends_on "xml-tooling-c" depends_on "xerces-c" depends_on "xml-security-c" depends_on "log4shib" depends_on "boost" depends_on "unixodbc" depends_on "apr-util" => :build depends_on "apr" => :build needs :cxx11 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 caveats mod = build.with?("apache-22") ? "mod_shib_22.so" : "mod_shib_24.so" <<-EOS.undent You must manually edit httpd.conf to include LoadModule mod_shib #{lib}/shibboleth/#{mod} You must also manually configure #{etc}/shibboleth/shibboleth2.xml as per your own requirements. For more information please see https://wiki.shibboleth.net/confluence/display/EDS10/3.1+Configuring+the+Service+Provider EOS end plist_options :startup => true, :manual => "shibd" def plist; <<-EOS.undent Label #{plist_name} ProgramArguments #{opt_sbin}/shibd -F -f -p #{prefix}/var/run/shibboleth/shibd.pid RunAtLoad KeepAlive EOS end def post_install (var/"run/shibboleth/").mkpath (var/"cache/shibboleth").mkpath end test do system "#{opt_sbin}/shibd", "-t" end end