require "formula" class Zbackup < Formula desc "Globally-deduplicating backup tool (based on ideas in rsync)" homepage "http://zbackup.org" url "https://github.com/zbackup/zbackup/archive/1.4.1.tar.gz" sha1 "6fc5c7f4bb23ce52bd4e14cb9b07c77662e1703c" depends_on "cmake" => :build depends_on "openssl" depends_on "protobuf" depends_on "xz" # get liblzma compression algorithm library from XZutils depends_on "lzo" # These fixes are upstream and can be removed in the next released version. patch do url "https://github.com/zbackup/zbackup/commit/7e6adda6b1df9c7b955fc06be28fe6ed7d8125a2.diff" sha1 "eb03aad6e9c543914a7332b02f277bb76103e1f2" end patch do url "https://github.com/zbackup/zbackup/commit/f4ff7bd8ec63b924a49acbf3a4f9cf194148ce18.diff" sha1 "4d8c584e7f35ca2994dc751b8398b0b091119316" end def install system "cmake", ".", *std_cmake_args system "make", "install" end test do system "#{bin}/zbackup", "--non-encrypted", "init", "." system "echo test | #{bin}/zbackup --non-encrypted backup backups/test.bak" end end