Files

46 lines
1.5 KiB
Ruby

class Tdb < Formula
bottle do
root_url "https://homebrew.hyprnet/bottles"
sha256 cellar: :any, arm64_sequoia: "73ab9ee5b4a954338efb2cded87651f64984a2ea27b898f4b4f584a8fa3776ea"
sha256 cellar: :any, arm64_tahoe: "263f2b310f2be1f0aeb5b98357dc28c88fbb6a46d116def650e7a30c05f3608e"
sha256 cellar: :any_skip_relocation, x86_64_linux: "b07d10b7909161e804d6d707d300249a23bb86f9aee2cdf313cf92be772a1f47"
end
desc "Trivial DataBase, by the Samba project"
homepage "https://tdb.samba.org/"
url "https://www.samba.org/ftp/tdb/tdb-1.4.15.tar.gz"
sha256 "fba09d8df1f1b9072aeae8e78b2bd43c5afef20b2f6deefa633aa14a377a8dd2"
license all_of: [
"LGPL-3.0-or-later",
"GPL-3.0-or-later", # tools/
]
livecheck do
url "https://www.samba.org/ftp/tdb/"
regex(/href=.*?tdb[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
uses_from_macos "python" => :build
conflicts_with "jena", because: "both install `tdbbackup`, `tdbdump` binaries"
def install
system "./configure", "--bundled-libraries=NONE",
"--disable-python",
"--disable-rpath",
"--prefix=#{prefix}"
system "make", "install"
end
test do
testdb = "test-db.tdb"
# database creation
pipe_output("#{bin}/tdbtool", "create #{testdb}\ninsert foo bar\n", 0)
assert_path_exists testpath/testdb
assert_match "Database integrity is OK and has 1 records.", pipe_output("#{bin}/tdbtool #{testdb}", "check\n")
assert_match "key 3 bytes: foo", pipe_output("#{bin}/tdbtool #{testdb}", "keys\n")
end
end