class Bitlbee < Formula desc "IRC to other chat networks gateway" homepage "https://www.bitlbee.org/" revision 1 head "https://github.com/bitlbee/bitlbee.git" stable do url "https://get.bitlbee.org/src/bitlbee-3.5.1.tar.gz" sha256 "9636d7fd89ebb3756c13a9a3387736ca6d56ccf66ec0580d512f07b21db0fa69" # Fixes a couple of bugs/potential crashes. patch do url "https://github.com/bitlbee/bitlbee/commit/17a58dfa.patch?full_index=1" sha256 "3a5729fd68bedabd1df717124e1950897eaee9feaf8237f6d67746e73df6cc6b" end patch do url "https://github.com/bitlbee/bitlbee/commit/eb73d05e.patch?full_index=1" sha256 "a54bdc82ff2959992e081586f5dd478a1719cd5037ebb0bfa54db6013853e0a5" end end bottle do sha256 "fb83f16110761697d99f8c19fc71b0698909afe952c8528257ebce7d2f36a59d" => :catalina sha256 "d098e0cc8717fd8bdac6b0e4fc358d7414193a16df4e14dfe7ee41699afc1c23" => :mojave sha256 "9a0f8d1791dfbfcbd63c833b756be5552db2c6bf961a852ad1973691eef644d4" => :high_sierra sha256 "4649e401630a5b1ed750d1a9a1806b90e3d57bb6f65133755b77ebf254d58dec" => :sierra end depends_on "pkg-config" => :build depends_on "gettext" depends_on "glib" depends_on "gnutls" depends_on "libgcrypt" def install args = %W[ --prefix=#{prefix} --plugindir=#{HOMEBREW_PREFIX}/lib/bitlbee/ --debug=0 --ssl=gnutls --etcdir=#{etc}/bitlbee --pidfile=#{var}/bitlbee/run/bitlbee.pid --config=#{var}/bitlbee/lib/ --ipsocket=#{var}/bitlbee/run/bitlbee.sock ] system "./configure", *args # This build depends on make running first. system "make" system "make", "install" # Install the dev headers too system "make", "install-dev" # This build has an extra step. system "make", "install-etc" end def post_install (var/"bitlbee/run").mkpath (var/"bitlbee/lib").mkpath end plist_options :manual => "bitlbee -D" def plist; <<~EOS Label #{plist_name} OnDemand ProgramArguments #{opt_sbin}/bitlbee ServiceDescription bitlbee irc-im proxy Sockets Listener SockFamily IPv4 SockProtocol TCP SockNodeName 127.0.0.1 SockServiceName 6667 SockType stream inetdCompatibility Wait EOS end test do assert_match version.to_s, shell_output("#{sbin}/bitlbee -V", 1) end end