class Libvirt < Formula desc "C virtualization API" homepage "https://www.libvirt.org" url "https://libvirt.org/sources/libvirt-1.2.19.tar.gz" sha256 "282c141f03331d640020c15f81464b27400e0ee307ef4c5190393b021caedd6e" bottle do sha256 "2d6d0c6bb7819fc701f94810765986121abd2122779aa299b94d0e9959844912" => :el_capitan sha256 "38f538af231f2e0bd8d35aa2549aaec97956c7c9a42fb7e2a74b0f35f0ade66a" => :yosemite sha256 "bdc4dc38dbcab9d158f1643a904c02e66e97cb231904b8d4b7068d61f0f77097" => :mavericks sha256 "5d29c5088c2a50dfda788421ffe46b63c4ba0a7e4fd4f4bdf4f5e20909ef4492" => :mountain_lion end option "without-libvirtd", "Build only the virsh client and development libraries" depends_on "pkg-config" => :build depends_on "gnutls" depends_on "libgcrypt" depends_on "yajl" if MacOS.version <= :leopard # Definitely needed on Leopard, but not on Snow Leopard. depends_on "readline" depends_on "libxml2" end fails_with :llvm do build 2326 cause "Undefined symbols when linking" end def install args = ["--prefix=#{prefix}", "--localstatedir=#{var}", "--mandir=#{man}", "--sysconfdir=#{etc}", "--with-esx", "--with-init-script=none", "--with-remote", "--with-test", "--with-vbox", "--with-vmware", "--with-yajl", "--without-qemu"] args << "--without-libvirtd" if build.without? "libvirtd" system "./configure", *args # Compilation of docs doesn't get done if we jump straight to "make install" system "make" system "make", "install" # Update the SASL config file with the Homebrew prefix inreplace "#{etc}/sasl2/libvirt.conf" do |s| s.gsub! "/etc/", "#{HOMEBREW_PREFIX}/etc/" end # If the libvirt daemon is built, update its config file to reflect # the Homebrew prefix if build.with? "libvirtd" inreplace "#{etc}/libvirt/libvirtd.conf" do |s| s.gsub! "/etc/", "#{HOMEBREW_PREFIX}/etc/" s.gsub! "/var/", "#{HOMEBREW_PREFIX}/var/" end end end end