Skip to content

Instantly share code, notes, and snippets.

@giffels
Last active May 7, 2024 16:49
Show Gist options
  • Save giffels/fae3db681bde05024ac8b0cf35569eee to your computer and use it in GitHub Desktop.
Save giffels/fae3db681bde05024ac8b0cf35569eee to your computer and use it in GitHub Desktop.
VOMS Client Brew Formular
class GlobusToolkit < Formula
desc "Toolkit used for building grids"
homepage "https://www.globus.org/toolkit/"
# Note: Stable distributions have an even minor version number (e.g. 5.0.3)
url "https://downloads.globus.org/toolkit/gt6/stable/installers/src/globus_toolkit-6.0.1531931206.tar.gz"
sha256 "ef7b127174016627e1e161a99a95a4558b1c47fc0d368c4c3e84320924f14081"
revision 1
depends_on "pkg-config" => :build
depends_on "gcc" => :build
depends_on "libtool"
depends_on "openssl@1.1"
uses_from_macos "zlib"
def install
ENV.deparallelize
ENV["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version
ENV["CC"] = "/opt/homebrew/bin/gcc-13"
ENV["LIBS"] = "-framework Security"
man.mkpath
system "./configure", "--prefix=#{libexec}",
"--sysconfdir=#{etc}",
"--mandir=#{man}",
"--disable-dependency-tracking"
"--enable-myproxy"
system "make"
system "make", "install"
bins = Dir["#{libexec}/bin/*"].select { |f| File.executable? f }
bin.write_exec_script bins
end
test do
system "#{bin}/globusrun", "-help"
end
end
class GopassJsonapi < Formula
desc "Gopass Browser Bindings"
homepage "https://github.com/gopasspw/gopass-jsonapi"
url "https://github.com/gopasspw/gopass-jsonapi/archive/v1.11.1.tar.gz"
sha256 "3c1666cdbf78a73736b089c3188c06724de53a96e43cb1d82fedd7e9543c120f"
license "MIT"
depends_on "go" => :build
depends_on "gopass"
def install
ENV["GOBIN"] = bin
system "go", "install", "-ldflags", "-s -w -X main.version=#{version}", "./..."
end
def caveats
"You need to run gopass-jsonapi configure for each browser you want to use with gopass."
end
test do
require "open3"
(testpath/"batch.gpg").write <<~EOS
Key-Type: RSA
Key-Length: 2048
Subkey-Type: RSA
Subkey-Length: 2048
Name-Real: Testing
Name-Email: testing@foo.bar
Expire-Date: 1d
%no-protection
%commit
EOS
begin
system Formula["gnupg"].opt_bin/"gpg", "--batch", "--gen-key", "batch.gpg"
system Formula["gopass"].opt_bin/"gopass", "init", "--path", testpath, "noop", "testing@foo.bar"
system Formula["gopass"].opt_bin/"gopass", "generate", "Email/other@foo.bar", "15"
ensure
system Formula["gnupg"].opt_bin/"gpgconf", "--kill", "gpg-agent"
system Formula["gnupg"].opt_bin/"gpgconf", "--homedir", "keyrings/live",
"--kill", "gpg-agent"
end
assert_match version.to_s, shell_output("#{bin}/gopass-jsonapi --version")
msg='{"type": "query", "query": "foo.bar"}'
out, _err, _status = Open3.capture3("#{bin}/gopass-jsonapi listen", stdin_data: [msg.length].pack("L<")+msg)
assert_match %r{Email/other@foo.bar}, out
end
end
class Igtf < Formula
desc "IGTF Trust Anchor Distribution"
homepage 'http://www.igtf.net/'
url 'https://dist.eugridpma.info/distribution/igtf/current/igtf-policy-installation-bundle-1.128.tar.gz'
sha256 '1385e2206b4088cbad94264e2c252ad431f075f88a427cdee4ed523df95b9ab7'
version '1.128'
def install
system "./configure", "--prefix=#{prefix}/etc/grid-security/certificates",
"--with-profile=classic",
"--with-profile=slcs",
"--with-profile=mics"
system "make", "install"
end
end
class Voms < Formula
desc "Virtual organization membership service"
homepage "https://github.com/italiangrid/voms"
url "https://codeload.github.com/giffels/voms-clients/tar.gz/v3.0.7b"
sha256 "6c35665090d2d343e494b319a1e4fb6a7e0646d493ba6489c669aba07a98d336"
depends_on "java"
depends_on "maven" => :build
depends_on "openssl"
def install
system "mvn", "package", "-Dmaven.repo.local=$(pwd)/m2repo/", "-Dmaven.javadoc.skip=true"
system "tar", "-xf", "target/voms-clients.tar.gz"
share.install "voms-clients/share/java"
man5.install Dir["voms-clients/share/man/man5/*.5"]
man1.install Dir["voms-clients/share/man/man1/*.1"]
bin.install Dir["voms-clients/bin/*"]
end
test do
system "#{bin}/voms-proxy-info", "--version"
end
end
class Voms2 < Formula
desc "Virtual organization membership service"
homepage "https://github.com/italiangrid/voms"
url "https://github.com/italiangrid/voms/archive/v2.1.0-rc4.tar.gz"
sha256 "013e4a8cf952fe518a0faa2174fb5d59c843133c94e6915a8e23b2055dd5742f"
revision 1
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "gsoap"
depends_on "openssl"
def install
ENV.append "CPPFLAGS", "-D_DARWIN_C_SOURCE"
system "./autogen.sh"
system "./configure", "--prefix=#{prefix}", "--sysconfdir=#{etc}", "-disable-static", "--disable-parser-gen", "--with-gsoap-wsdl2h=#{Formula["gsoap"].opt_bin}/wsdl2h", "--with-clients=yes", "--with-server=no"
system "make", "install"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment