aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/rinetd.rb48
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