2010-06-13 17:03:24 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Rinetd < Formula
|
2010-06-13 17:03:24 +00:00
|
|
|
url 'http://www.boutell.com/rinetd/http/rinetd.tar.gz'
|
|
|
|
homepage 'http://www.boutell.com/rinetd/'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '2498fa03c2ef50bf924ffd0a034d5de5e3258f21'
|
2010-06-13 17:03:24 +00:00
|
|
|
version '0.62'
|
|
|
|
|
|
|
|
def install
|
2010-04-07 05:58:35 +00:00
|
|
|
inreplace 'rinetd.c' do |s|
|
|
|
|
s.gsub! "/etc/rinetd.conf", "#{etc}/rinetd.conf"
|
|
|
|
s.gsub! "/var/run/rinetd.pid", "#{var}/rinetd.pid"
|
2010-06-13 17:03:24 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
system "make"
|
|
|
|
bin.install "rinetd"
|
2010-04-07 05:58:35 +00:00
|
|
|
man8.install "rinetd.8"
|
2010-06-13 17:03:24 +00:00
|
|
|
conf = etc+"rinetd.conf"
|
2010-09-30 18:45:51 +00:00
|
|
|
conf.write(conf_file) unless conf.exist?
|
2010-06-13 17:03:24 +00:00
|
|
|
end
|
|
|
|
|
2010-09-30 18:45:51 +00:00
|
|
|
def conf_file; <<-EOF.undent
|
|
|
|
# forwarding rules go here
|
|
|
|
#
|
|
|
|
# you may specify allow and deny rules after a specific forwarding rule
|
|
|
|
# to apply to only that forwarding rule
|
|
|
|
#
|
|
|
|
# bindadress bindport connectaddress connectport
|
|
|
|
EOF
|
|
|
|
end
|
|
|
|
end
|