class Automysqlbackup < Formula desc "Automate MySQL backups" homepage "https://sourceforge.net/projects/automysqlbackup/" url "https://downloads.sourceforge.net/project/automysqlbackup/AutoMySQLBackup/AutoMySQLBackup%20VER%203.0/automysqlbackup-v3.0_rc6.tar.gz" version "3.0-rc6" sha256 "889e064d086b077e213da11e937ea7242a289f9217652b9051c157830dc23cc0" bottle :unneeded def install inreplace "automysqlbackup" do |s| s.gsub! "/etc", etc s.gsub! "/var", var end inreplace "automysqlbackup.conf", "/var", var conf_path = (etc/"automysqlbackup") conf_path.install "automysqlbackup.conf" unless (conf_path/"automysqlbackup.conf").exist? sbin.install "automysqlbackup" end def caveats; <<-EOS.undent You will have to edit #{etc}/automysqlbackup/automysqlbackup.conf to set AutoMySQLBackup up to find your database and backup directory. The included plist file will run AutoMySQLBackup every day at 04:00. EOS end plist_options :manual => "automysqlbackup" def plist; <<-EOS.undent Label #{plist_name} OnDemand RunAtLoad StartCalendarInterval Hour 04 Minute 00 ProgramArguments #{sbin}/automysqlbackup WorkingDirectory #{HOMEBREW_PREFIX} EOS end test do system "#{sbin}/automysqlbackup", "--help" end end