class Znc < Formula desc "Advanced IRC bouncer" homepage "https://wiki.znc.in/ZNC" url "https://znc.in/releases/archive/znc-1.7.4.tar.gz" sha256 "b1a32921a8e6d79ee6c5900c8d07293026966db7c05aaac48984231befc49b71" bottle do sha256 "fb0f39471e6ff4f4a421e29a11374046f047e209187944d9451761238bc05300" => :mojave sha256 "65bd2fa1bf794eada4cfcafe86b410d23c5d22cbc5a0bf731dfa5e8ef0118ba1" => :high_sierra sha256 "b977dcff0d2d873a463e49b9807ef19203a854a5a67feb398cd168b75a702952" => :sierra end head do url "https://github.com/znc/znc.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build end depends_on "pkg-config" => :build depends_on "icu4c" depends_on "openssl" depends_on "python" def install ENV.cxx11 # These need to be set in CXXFLAGS, because ZNC will embed them in its # znc-buildmod script; ZNC's configure script won't add the appropriate # flags itself if they're set in superenv and not in the environment. ENV.append "CXXFLAGS", "-std=c++11" ENV.append "CXXFLAGS", "-stdlib=libc++" if ENV.compiler == :clang system "./autogen.sh" if build.head? system "./configure", "--prefix=#{prefix}", "--enable-python" system "make", "install" end plist_options :manual => "znc --foreground" def plist; <<~EOS Label #{plist_name} ProgramArguments #{opt_bin}/znc --foreground StandardErrorPath #{var}/log/znc.log StandardOutPath #{var}/log/znc.log RunAtLoad StartInterval 300 EOS end test do mkdir ".znc" system bin/"znc", "--makepem" assert_predicate testpath/".znc/znc.pem", :exist? end end