homebrew-core/Formula/util-linux.rb
2019-05-13 21:10:34 +02:00

50 lines
1.9 KiB
Ruby

class UtilLinux < Formula
desc "Collection of Linux utilities"
homepage "https://github.com/karelzak/util-linux"
url "https://www.kernel.org/pub/linux/utils/util-linux/v2.33/util-linux-2.33.2.tar.xz"
sha256 "631be8eac6cf6230ba478de211941d526808dba3cd436380793334496013ce97"
revision 1
bottle do
cellar :any
sha256 "4378cde04082e8ae81a32a02c329989f10a7b582354d248e81f5958d4a5cf150" => :mojave
sha256 "618e77696340f47cda39e0f80dfdc9ddaf18462ee11b536139689c8dc1381b5c" => :high_sierra
sha256 "569009c8d2f16d8ebaae5f56a8e6cf528e593f4c9e0ad3f32cf244fb6ddc8e65" => :sierra
end
keg_only "macOS provides the uuid.h header"
def install
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--disable-ipcs", # does not build on macOS
"--disable-ipcrm", # does not build on macOS
"--disable-wall", # already comes with macOS
"--enable-libuuid", # conflicts with ossp-uuid
"--disable-libsmartcols" # macOS already ships 'column'
system "make", "install"
# Remove binaries already shipped by macOS
%w[cal col colcrt colrm getopt hexdump logger nologin look mesg more renice rev ul whereis].each do |prog|
rm_f bin/prog
rm_f sbin/prog
rm_f man1/"#{prog}.1"
rm_f man8/"#{prog}.8"
rm_f share/"bash-completion/completions/#{prog}"
end
# install completions only for installed programs
Pathname.glob("bash-completion/*") do |prog|
if (bin/prog.basename).exist? || (sbin/prog.basename).exist?
bash_completion.install prog
end
end
end
test do
out = shell_output("#{bin}/namei -lx /usr").split("\n")
assert_equal ["f: /usr", "Drwxr-xr-x root wheel /", "drwxr-xr-x root wheel usr"], out
end
end