From dff0f8d57a0a0b10740f6ead93f96c828bba521c Mon Sep 17 00:00:00 2001 From: jtimberman Date: Sun, 28 Mar 2010 01:29:13 -0600 Subject: Formula for runit Signed-off-by: Adam Vandenberg --- Library/Formula/runit.rb | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Library/Formula/runit.rb (limited to 'Library/Formula') diff --git a/Library/Formula/runit.rb b/Library/Formula/runit.rb new file mode 100644 index 000000000..2dbf04254 --- /dev/null +++ b/Library/Formula/runit.rb @@ -0,0 +1,43 @@ +require 'formula' + +class Runit src/conf-ld" + inreplace 'src/Makefile', / -static/, '' + + inreplace 'src/sv.c', "char *varservice =\"/service/\";", "char *varservice =\"#{var}/service/\";" + system "package/compile" + + # The commands are compiled and copied into the 'command' directory and + # names added to package/commands. Read the file for the commands and + # install them in homebrew. + rcmds = File.open("package/commands").read + rcmds.each do |r| + bin.install("command/#{r.chomp}") + man8.install("man/#{r.chomp}.8") + end + (var + "service").mkpath + end + + def man8; man+'man8' end + + def caveats + <<-END_CAVEATS +This formula does not install runit as a replacement for init. +The service directory is #{var}/service instead of /service. +To have runit ready to run services, start runsvdir: + + $ runsvdir -P #{var} + +Depending on the services managed by runit, this may need to start as root. + END_CAVEATS + end +end -- cgit v1.2.3