aboutsummaryrefslogtreecommitdiff
path: root/kontext.rb
blob: efc91183b24d0e5450b3cf5c3d60621bcf71a1e6 (plain) (blame)
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
class Kontext < Formula
  desc "Per shell Kubernetes contexts"
  homepage "https://git.segundo.io/Kubernetes/kontext/about/"
  url "https://git.segundo.io/Kubernetes/kontext/snapshot/kontext-1.0.0.tar.gz"
  sha256 "6e93389144c55dbafa08502e7c6a77775d4d4b9c769b8de5a9296c7947ef3bbf"
  license :cannot_represent
  head " https://git.segundo.io/Kubernetes/kontext", branch: "master"

  depends_on "gnu-getopt"
  depends_on "kubernetes-cli"
  depends_on "autoconf" => :build
  depends_on "automake" => :build

  def install
    system "aclocal"
    system "autoconf"
    system "automake", "--add-missing"
    system "./configure", "--prefix=#{prefix}"
    system "make", "install"
  end

  def caveats
    <<~EOS
      You must add the following alias to your shell:
        alias kontext='source kontext'
    EOS
  end

  test do
    assert_match "kontext is not being sourced", shell_output("#{bin}/kontext --help 2>&1", 1)
    assert_match "found in the kontext(1) man page", shell_output("bash -c 'source #{bin}/kontext --help 2>&1'", 1)
  end
end