aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/timelimit.rb29
1 files changed, 19 insertions, 10 deletions
diff --git a/Library/Formula/timelimit.rb b/Library/Formula/timelimit.rb
index cd975a711..f3f4dd9df 100644
--- a/Library/Formula/timelimit.rb
+++ b/Library/Formula/timelimit.rb
@@ -1,15 +1,24 @@
-require 'formula'
-
class Timelimit < Formula
- homepage 'http://devel.ringlet.net/sysutils/timelimit/'
- url 'http://devel.ringlet.net/sysutils/timelimit/timelimit-1.8.tar.gz'
- sha1 '0bc20606db0f587f3927f747680c9522b2d4c5af'
+ homepage "http://devel.ringlet.net/sysutils/timelimit/"
+ url "http://devel.ringlet.net/sysutils/timelimit/timelimit-1.8.tar.gz"
+ sha256 "026e72b345f8407ebaa002036fd785b2136b2dfc4f8854f14536196ee3079996"
def install
- system "make", "LOCALBASE=#{prefix}",
- "MANDIR=#{man}/man",
- "all"
- bin.install "timelimit"
- man1.install "timelimit.1.gz"
+ # don't install for a specific user
+ inreplace "Makefile", "-o ${BINOWN} -g ${BINGRP}", ""
+ inreplace "Makefile", "-o ${MANOWN} -g ${MANGRP}", ""
+
+ args = %W[LOCALBASE=#{prefix} MANDIR=#{man}/man]
+
+ check_args = args + ["check"]
+ install_args = args + ["install"]
+
+ system "make", *check_args
+ system "make", *install_args
+ end
+
+ test do
+ assert_equal "timelimit: sending warning signal 15",
+ shell_output("#{bin}/timelimit -p -t 1 sleep 5 2>&1", 143).chomp
end
end