-
Notifications
You must be signed in to change notification settings - Fork 8
/
siegfried.rb
37 lines (29 loc) · 1.3 KB
/
siegfried.rb
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
34
35
36
37
require "language/go"
require "yaml"
class Siegfried < Formula
desc "Fast PRONOM-based file identification tool"
homepage "http://www.itforarchivists.com/siegfried"
url "https://github.com/richardlehane/siegfried/archive/v1.4.5.tar.gz"
sha256 "7d32f523e2697f32fc3e9e8d61d3174e26edb86280ef26bbc1d09a930382c8c7"
head "https://github.com/richardlehane/siegfried.git", :branch => "develop"
depends_on "go" => :build
def install
# Avoid installing signature files into the user's home directory;
# install them into share instead.
inreplace "config/brew.go", "/usr/share/siegfried", share/"siegfried"
mkdir_p buildpath/"src/github.com/richardlehane"
ln_s buildpath, buildpath/"src/github.com/richardlehane/siegfried"
ENV["GOPATH"] = buildpath
system "go", "build", "-tags", "brew",
"github.com/richardlehane/siegfried/cmd/sf"
system "go", "build", "-tags", "brew",
"github.com/richardlehane/siegfried/cmd/roy"
bin.install "sf", "roy"
(share/"siegfried").install Dir["src/github.com/richardlehane/siegfried/cmd/roy/data/*"]
end
test do
results = YAML.load_documents `"#{bin}/sf" "#{test_fixtures("test.jpg")}"`
assert_equal version.to_s, results[0]["siegfried"]
assert_equal "fmt/43", results[1]["matches"][0]["puid"]
end
end