2014-09-19 15:52:44 +00:00
|
|
|
require "language/go"
|
|
|
|
|
|
|
|
class Aptly < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Swiss army knife for Debian repository management"
|
2015-03-12 22:35:47 +00:00
|
|
|
homepage "https://www.aptly.info/"
|
2016-06-20 18:08:00 +00:00
|
|
|
url "https://github.com/smira/aptly/archive/v0.9.7.tar.gz"
|
|
|
|
sha256 "364d7b294747512c7e7a27f1b4c1d3f1e3f8b502944be142f9ab48a58ebe9a69"
|
2014-09-19 15:52:44 +00:00
|
|
|
head "https://github.com/smira/aptly.git"
|
|
|
|
|
2014-10-28 16:52:18 +00:00
|
|
|
bottle do
|
2015-09-15 08:53:12 +00:00
|
|
|
cellar :any_skip_relocation
|
2016-09-27 00:43:55 +00:00
|
|
|
sha256 "83d120b4f5f3b48b47a6100cc4abc284b4f43b5feb5344abdfc0230e9452cec8" => :sierra
|
2016-06-20 18:22:49 +00:00
|
|
|
sha256 "76d08ae0643257baf4f6af5a60022251306f56bbafd24004f6ca415ebbaa2134" => :el_capitan
|
|
|
|
sha256 "559e5c4c7fc0435597615fc6cd01a987ad66abe0ba7e49ff0284b1df46894374" => :yosemite
|
|
|
|
sha256 "d53b704d71fd7f06425c48345b190125889ea5a8768d2b2a538c41d1b8c0e542" => :mavericks
|
2014-10-28 16:52:18 +00:00
|
|
|
end
|
|
|
|
|
2014-09-19 15:52:44 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
go_resource "github.com/daviddengcn/go-colortext" do
|
2016-06-20 18:08:00 +00:00
|
|
|
url "https://github.com/daviddengcn/go-colortext.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "511bcaf42ccd42c38aba7427b6673277bf19e2a1"
|
2015-09-14 04:13:48 +00:00
|
|
|
end
|
|
|
|
|
2016-06-20 18:08:00 +00:00
|
|
|
go_resource "github.com/hashicorp/go-version" do
|
|
|
|
url "https://github.com/hashicorp/go-version.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "0181db47023708a38c2d20d2fe25a5fa034d5743"
|
2015-09-14 04:13:48 +00:00
|
|
|
end
|
|
|
|
|
2016-06-20 18:08:00 +00:00
|
|
|
go_resource "github.com/mattn/gover" do
|
|
|
|
url "https://github.com/mattn/gover.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "715629d6b57a2104c5221dc72514cfddc992e1de"
|
2015-09-14 04:13:48 +00:00
|
|
|
end
|
|
|
|
|
2016-06-20 18:08:00 +00:00
|
|
|
go_resource "github.com/mattn/gom" do
|
|
|
|
url "https://github.com/mattn/gom.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "393e714d663c35e121a47fec32964c44a630219b"
|
2015-09-14 04:13:48 +00:00
|
|
|
end
|
|
|
|
|
2014-09-19 15:52:44 +00:00
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
2016-06-20 18:08:00 +00:00
|
|
|
ENV.prepend_create_path "PATH", buildpath/"bin"
|
|
|
|
|
|
|
|
(buildpath/"src/github.com/smira").mkpath
|
|
|
|
ln_s buildpath, buildpath/"src/github.com/smira/aptly"
|
2014-09-19 15:52:44 +00:00
|
|
|
|
|
|
|
Language::Go.stage_deps resources, buildpath/"src"
|
|
|
|
|
2016-06-20 18:08:00 +00:00
|
|
|
cd("src/github.com/mattn/gom") { system "go", "install" }
|
|
|
|
|
|
|
|
system "gom", "-production", "install"
|
|
|
|
system "gom", "build", "-o", bin/"aptly"
|
2014-09-19 15:52:44 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2016-06-20 18:08:00 +00:00
|
|
|
assert_match "aptly version:", shell_output("#{bin}/aptly version")
|
2014-09-19 15:52:44 +00:00
|
|
|
(testpath/".aptly.conf").write("{}")
|
2016-06-20 18:08:00 +00:00
|
|
|
result = shell_output("#{bin}/aptly -config='#{testpath}/.aptly.conf' mirror list")
|
2015-09-14 04:13:48 +00:00
|
|
|
assert_match "No mirrors found, create one with", result
|
2014-09-19 15:52:44 +00:00
|
|
|
end
|
|
|
|
end
|