homebrew-core/Formula/ipfs.rb
2018-07-13 12:43:41 -07:00

52 lines
1.5 KiB
Ruby

class Ipfs < Formula
desc "Peer-to-peer hypermedia protocol"
homepage "https://ipfs.io/"
url "https://github.com/ipfs/go-ipfs.git",
:tag => "v0.4.16",
:revision => "92ac43afef339e3c3090777db27959e4492a173e"
head "https://github.com/ipfs/go-ipfs.git"
bottle do
cellar :any_skip_relocation
sha256 "67fd13a4bf202abc42692dc09bf4f78e62765a8ecd656f9f7e5667859ce3690f" => :high_sierra
sha256 "5ea9d8874ecf96b4875f0dd5ec35a482694a022601d184995a5fe8327f1eb318" => :sierra
sha256 "0b18ac320c64f802f6840cf51daa5e4d749091b9d349186f43948aeb3e59c5ea" => :el_capitan
end
depends_on "go" => :build
depends_on "godep" => :build
depends_on "gx"
depends_on "gx-go"
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/ipfs/go-ipfs").install buildpath.children
cd("src/github.com/ipfs/go-ipfs") { system "make", "install" }
bin.install "bin/ipfs"
end
plist_options :manual => "ipfs daemon"
def plist; <<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/ipfs</string>
<string>daemon</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
test do
system bin/"ipfs", "version"
end
end