-
Notifications
You must be signed in to change notification settings - Fork 0
/
ltfs.rb
104 lines (87 loc) · 3.36 KB
/
ltfs.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Documentation: https://docs.brew.sh/Formula-Cookbook.html
# http://www.rubydoc.info/github/Homebrew/brew/master/Formula
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class OsxfuseRequirement < Requirement
fatal true
satisfy(build_env: false) { self.class.binary_osxfuse_installed? || self.class.binary_macfuse_installed? }
def self.binary_osxfuse_installed?
File.exist?("/usr/local/include/osxfuse/fuse.h") &&
!File.symlink?("/usr/local/include/osxfuse")
end
def self.binary_macfuse_installed?
File.exist?("/usr/local/include/fuse.h")
end
env do
ENV.append_path "PKG_CONFIG_PATH",
"/usr/local/lib/pkgconfig:#{HOMEBREW_PREFIX}/lib/pkgconfig:"\
"#{HOMEBREW_PREFIX}/opt/[email protected]/lib/pkgconfig"
ENV.append_path "BORG_OPENSSL_PREFIX", "#{HOMEBREW_PREFIX}/opt/[email protected]/"
if self.class.binary_osxfuse_installed?
unless HOMEBREW_PREFIX.to_s == "/usr/local"
ENV.append_path "HOMEBREW_LIBRARY_PATHS", "/usr/local/lib"
ENV.append_path "HOMEBREW_INCLUDE_PATHS", "/usr/local/include/osxfuse"
end
elsif self.class.binary_macfuse_installed?
unless HOMEBREW_PREFIX.to_s == "/usr/local"
ENV.append_path "HOMEBREW_LIBRARY_PATHS", "/usr/local/lib"
ENV.append_path "HOMEBREW_INCLUDE_PATHS", "/usr/local/include"
end
end
end
def message
"macfuse or osxfuse is required to build ltfs. Please run `brew install --cask macfuse` or `brew install --cask osxfuse` first."
end
end
class Ltfs < Formula
desc 'Reference implementation of the LTFS format Spec for stand alone tape drive'
homepage 'https://github.com/LinearTapeFileSystem/ltfs'
url 'https://github.com/LinearTapeFileSystem/ltfs/archive/v2.4.4.0-10470.tar.gz'
sha256 '840989bb50e4cd752473fa3b2f69bb2b844a7c89b8a7f55a4560fa8672709792'
head do
url 'https://github.com/LinearTapeFileSystem/ltfs.git'
end
depends_on 'autoconf' => :build
depends_on 'automake' => :build
depends_on 'libtool' => :build
depends_on 'pkg-config' => :build
depends_on 'gnu-sed' => :build
depends_on 'ossp-uuid'
depends_on 'libxml2'
depends_on 'icu4c'
env :std
on_macos do
depends_on OsxfuseRequirement
end
on_linux do
depends_on "libfuse"
end
def install
if OS.mac?
ENV.deparallelize
ENV['CC'] = 'gcc'
ENV['LDFLAGS'] = '-framework CoreFoundation -framework IOKit'
system './autogen.sh'
system './configure', "--prefix=#{prefix}", '--disable-snmp', '--enable-buggy-ifs'
system 'make'
system 'make', 'install'
elsif OS.linux?
ENV.deparallelize
system './autogen.sh'
system './configure', "--prefix=#{prefix}", '--disable-snmp', '--enable-buggy-ifs'
system 'make'
system 'make', 'install'
end
end
test do
# `test do` will create, run in and delete a temporary directory.
#
# This test will fail and we won't accept that! For Homebrew/homebrew-core
# this will need to be a test that verifies the functionality of the
# software. Run the test with `brew test ltfs`. Options passed
# to `brew install` such as `--HEAD` also need to be provided to `brew test`.
#
# The installed folder is not in the path, so use the entire path to any
# executables being tested: `system '#{bin}/program', 'do', 'something'`.
system 'false'
end
end