forked from keitheis/homebrew-dupes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lsof.rb
38 lines (32 loc) · 1.28 KB
/
lsof.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class Lsof < Formula
desc "Utility to list open files"
homepage "https://people.freebsd.org/~abe/"
url "ftp://sunsite.ualberta.ca/pub/Mirror/lsof/lsof_4.88.tar.bz2"
mirror "http://mirror.jaredwhiting.net/distfiles/lsof_4.88.tar.bz2"
sha256 "fe6f9b0e26b779ccd0ea5a0b6327c2b5c38d207a6db16f61ac01bd6c44e5c99b"
bottle do
cellar :any_skip_relocation
sha256 "166741406a0a1d6ac78b82274d56f1bb1d24c4d4cd2421919e48ce42566f90ca" => :el_capitan
sha256 "b8292349936eea9e0f24daf01818cba06ce5e689b4e97f026a431034c509e67d" => :yosemite
sha256 "92a1f687aa8a0df343b90771e16f6a11aa60968c034c9660318e38142533fb82" => :mavericks
end
def install
ENV["LSOF_INCLUDE"] = "#{MacOS.sdk_path}/usr/include"
system "tar", "xf", "lsof_#{version}_src.tar"
cd "lsof_#{version}_src" do
# Source hardcodes full header paths at /usr/include
inreplace %w[dialects/darwin/kmem/dlsof.h dialects/darwin/kmem/machine.h
dialects/darwin/libproc/machine.h],
"/usr/include", MacOS.sdk_path.to_s + "/usr/include"
mv "00README", "../README"
system "./Configure", "-n", "darwin"
system "make"
bin.install "lsof"
end
end
test do
(testpath/"test").open("w") do
system "#{bin}/lsof", testpath/"test"
end
end
end