class Znc < Formula desc "Advanced IRC bouncer" homepage "https://wiki.znc.in/ZNC" url "https://znc.in/releases/archive/znc-1.6.5.tar.gz" sha256 "2f0225d49c53a01f8d94feea4619a6fe92857792bb3401a4eb1edd65f0342aca" bottle do sha256 "c1d6ddcd9078631bcd94484f3796e95f32bf9e7b8d0886d9e2802b955b624cbf" => :sierra sha256 "fe47b2288ee78acd11b5d4dc5a4a43a255153a211775875975f458cfc370c7a9" => :el_capitan sha256 "61a0afcfcb021a7005d59f6d0a352fe27f05a6b2617eadb4482172d673666a67" => :yosemite end head do url "https://github.com/znc/znc.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build end option "with-debug", "Compile ZNC with debug support" option "with-icu4c", "Build with icu4c for charset support" option "with-python3", "Build with mod_python support, allowing Python ZNC modules" deprecated_option "enable-debug" => "with-debug" depends_on "pkg-config" => :build depends_on "openssl" depends_on "icu4c" => :optional depends_on :python3 => :optional needs :cxx11 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 args = ["--prefix=#{prefix}"] args << "--enable-debug" if build.with? "debug" args << "--enable-python" if build.with? "python3" system "./autogen.sh" if build.head? system "./configure", *args system "make", "install" end plist_options :manual => "znc --foreground" def plist; <<-EOS.undent 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 File.exist?(".znc/znc.pem") end end