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
|
|
|
|
revision 1
|
2016-02-23 12:29:50 +00:00
|
|
|
sha256 "1e64c023404ad78dd260d4c1cca0f080d3ef3903cf61452e698809b32821370f" => :el_capitan
|
2015-09-15 08:53:12 +00:00
|
|
|
sha256 "50233a52a6021e47b50a0280263984fda75bfe8811a384f31fc1975e579646a1" => :yosemite
|
|
|
|
sha256 "c12651d38a4145136c2d8441c0a1a77e4f4da14697ff9983482b4ce95a728683" => :mavericks
|
|
|
|
sha256 "9d3780503b8d9416435f4e8bfd85673e9caf4745657bfaba889ba7000c7e1bb0" => :mountain_lion
|
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",
|
|
|
|
: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",
|
|
|
|
: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",
|
|
|
|
: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",
|
|
|
|
: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
|