2010-07-06 10:05:40 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Pincaster < Formula
|
2010-07-06 10:05:40 +00:00
|
|
|
url 'http://download.pureftpd.org/pincaster/releases/pincaster-0.5.tar.gz'
|
2010-11-10 18:16:28 +00:00
|
|
|
homepage 'https://github.com/jedisct1/Pincaster'
|
2010-07-06 10:05:40 +00:00
|
|
|
md5 'd2cba33470c1d23d381a2003b3986efe'
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "./configure", "--prefix=#{prefix}"
|
|
|
|
system "make install"
|
|
|
|
|
|
|
|
inreplace "pincaster.conf" do |s|
|
|
|
|
s.gsub! "/var/db/pincaster/pincaster.db", "#{var}/db/pincaster/pincaster.db"
|
|
|
|
s.gsub! "# LogFileName /tmp/pincaster.log", "LogFileName #{var}/log/pincaster.log"
|
|
|
|
end
|
|
|
|
|
|
|
|
etc.install "pincaster.conf"
|
|
|
|
(var+"db/pincaster/").mkpath
|
2011-12-31 05:56:52 +00:00
|
|
|
plist_path.write startup_plist
|
|
|
|
plist_path.chmod 0644
|
2010-07-06 10:05:40 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats
|
|
|
|
<<-EOS.undent
|
|
|
|
Automatically load on login with:
|
2011-12-31 05:56:52 +00:00
|
|
|
launchctl load -w #{plist_path}
|
2010-07-06 10:05:40 +00:00
|
|
|
|
|
|
|
To start pincaster manually:
|
|
|
|
pincaster #{etc}/pincaster.conf
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
def startup_plist
|
|
|
|
return <<-EOPLIST
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
|
|
<plist version="1.0">
|
|
|
|
<dict>
|
|
|
|
<key>KeepAlive</key>
|
|
|
|
<true/>
|
|
|
|
<key>Label</key>
|
2011-12-31 05:56:52 +00:00
|
|
|
<string>#{plist_name}</string>
|
2010-07-06 10:05:40 +00:00
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
2011-12-31 22:13:31 +00:00
|
|
|
<string>#{HOMEBREW_PREFIX}/bin/pincaster</string>
|
2010-07-06 10:05:40 +00:00
|
|
|
<string>#{etc}/pincaster.conf</string>
|
|
|
|
</array>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
<key>UserName</key>
|
|
|
|
<string>#{`whoami`.chomp}</string>
|
|
|
|
<key>WorkingDirectory</key>
|
|
|
|
<string>#{var}</string>
|
|
|
|
<key>StandardErrorPath</key>
|
|
|
|
<string>#{var}/log/pincaster.log</string>
|
|
|
|
<key>StandardOutPath</key>
|
|
|
|
<string>#{var}/log/pincaster.log</string>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOPLIST
|
|
|
|
end
|
|
|
|
end
|