homebrew-core/Formula/iproute2.rb

40 lines
1.3 KiB
Ruby

class Iproute2 < Formula
desc "Linux routing utilities"
homepage "https://wiki.linuxfoundation.org/networking/iproute2"
url "https://mirrors.edge.kernel.org/pub/linux/utils/net/iproute2/iproute2-6.0.0.tar.xz"
sha256 "523139e9e72aec996374fa2de74be4c53d2dd05589488934d21ff97bae19580a"
license "GPL-2.0-only"
head "https://git.kernel.org/pub/scm/network/iproute2/iproute2.git", branch: "main"
livecheck do
url "https://mirrors.edge.kernel.org/pub/linux/utils/net/iproute2/"
regex(/href=.*?iproute2[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any_skip_relocation, x86_64_linux: "19280d9c38068803b63d8303a882be7a70e94341cfcc13b9646a9ba095646cef"
end
depends_on "bison" => :build
depends_on "flex" => :build
depends_on :linux
def install
system "make"
system "make", "install",
"PREFIX=#{prefix}",
"SBINDIR=#{sbin}",
"CONFDIR=#{etc}/iproute2",
"NETNS_RUN_DIR=#{var}/run/netns",
"NETNS_ETC_DIR=#{etc}/netns",
"ARPDDIR=#{var}/lib/arpd",
"KERNEL_INCLUDE=#{include}",
"DBM_INCLUDE=#{include}"
end
test do
output = shell_output("#{sbin}/ip addr").strip
assert_match "link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00", output
end
end