diff options
| author | Baptiste Fontaine | 2015-04-11 12:55:32 +0200 |
|---|---|---|
| committer | Xu Cheng | 2015-04-12 02:17:43 +0800 |
| commit | ad2bbb9be3de76a8951e844d5583736a6f52fb2d (patch) | |
| tree | 37e2cc3b9f7d239b4e9df356da033d18443b79d1 /Library | |
| parent | 64f442476ca66ab3a2cae28bc768a10ca82585e4 (diff) | |
| download | homebrew-ad2bbb9be3de76a8951e844d5583736a6f52fb2d.tar.bz2 | |
rinetd: modernize, test added
Closes #38549.
Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/rinetd.rb | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/Library/Formula/rinetd.rb b/Library/Formula/rinetd.rb index e995d86e7..3c33b47bb 100644 --- a/Library/Formula/rinetd.rb +++ b/Library/Formula/rinetd.rb @@ -1,31 +1,39 @@ -require 'formula' - class Rinetd < Formula - homepage 'http://www.boutell.com/rinetd/' - url 'http://www.boutell.com/rinetd/http/rinetd.tar.gz' - version '0.62' - sha1 '2498fa03c2ef50bf924ffd0a034d5de5e3258f21' + homepage "http://www.boutell.com/rinetd/" + url "http://www.boutell.com/rinetd/http/rinetd.tar.gz" + version "0.62" + sha256 "0c68d27c5bd4b16ce4f58a6db514dd6ff37b2604a88b02c1dfcdc00fc1059898" def install - inreplace 'rinetd.c' do |s| + inreplace "rinetd.c" do |s| s.gsub! "/etc/rinetd.conf", "#{etc}/rinetd.conf" s.gsub! "/var/run/rinetd.pid", "#{var}/rinetd.pid" end - system "make" - bin.install "rinetd" - man8.install "rinetd.8" - conf = etc+"rinetd.conf" - conf.write(conf_file) unless conf.exist? + inreplace "Makefile" do |s| + s.gsub! "/usr/sbin", sbin + s.gsub! "/usr/man", man + end + + sbin.mkpath + man8.mkpath + + system "make", "install" + + conf = etc/"rinetd.conf" + unless conf.exist? + conf.write <<-EOS.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 + EOS + end end - 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 + test do + system "#{sbin}/rinetd", "-h" end end |
