class Libvirt < Formula desc "C virtualization API" homepage "https://www.libvirt.org" url "https://libvirt.org/sources/libvirt-1.2.17.tar.gz" sha256 "e07eaf20b0590fae05ba3b53ad4dac3e5fbd771437563cc78b692f23ddd02fad" bottle do sha256 "f00a980e424cd9d80a77146a87c7ef2318e7a0755fded91cfec85266a73ea357" => :yosemite sha256 "dc1ee845e07e499142916c6e32ac227aebe80d6de85155cbac1f02adeb0ed661" => :mavericks sha256 "b55171b654b61090dc8470bd3458de7013bed67849440bae7a785627eed17500" => :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