homebrew-core/Formula/aqbanking.rb

78 lines
2.6 KiB
Ruby

class Aqbanking < Formula
desc "Generic online banking interface"
homepage "https://www.aquamaniac.de/sites/aqbanking/"
url "https://www.aquamaniac.de/rdm/attachments/download/366/aqbanking-6.2.9.tar.gz"
sha256 "80eebf586f13823e05a2feeafce318a620900b0490d6a018a91d3318cbe866d2"
license "GPL-2.0-or-later"
livecheck do
url "https://www.aquamaniac.de/rdm/projects/aqbanking/files"
regex(/href=.*?aqbanking[._-](\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 arm64_big_sur: "2fba93154a8edc402f8750354a849e52f2f9a3fa7332abbc650fbaed5793162c"
sha256 big_sur: "ed474ba7d192475de6a01c40c3ca49ae918f37f629ab7f9cf1896de8324dc183"
sha256 catalina: "944fd8c6eecb6b7aa81161e70e0b6d96a41f712563f2e18341086d2c50cef6df"
sha256 mojave: "f10639855d892b343fc6f9530dbfebe2774b5f9c86ca63acb0886629c55dd1b7"
end
head do
url "https://git.aquamaniac.de/git/aqbanking.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
depends_on "gettext"
depends_on "gmp"
depends_on "gwenhywfar"
depends_on "ktoblzcheck"
depends_on "libxml2"
depends_on "libxmlsec1"
depends_on "libxslt"
depends_on "pkg-config" # aqbanking-config needs pkg-config for execution
def install
ENV.deparallelize
inreplace "aqbanking-config.in.in", "@PKG_CONFIG@", "pkg-config"
system "autoreconf", "-fiv" if build.head?
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--prefix=#{prefix}",
"--enable-cli"
system "make", "install"
end
test do
ENV["TZ"] = "UTC"
context = "balance.ctx"
(testpath/context).write <<~EOS
accountInfoList {
accountInfo {
char bankCode="110000000"
char accountNumber="000123456789"
char iban="US44110000000000123456789"
char bic="BYLADEM1001"
char currency="USD"
balanceList {
balance {
char date="20221212"
char value="-11096%2F100%3AUSD"
char type="booked"
} #balance
} #balanceList
} #accountInfo
} #accountInfoList
EOS
match = "110000000 000123456789 12.12.2022 -110.96 US44110000000000123456789 BYLADEM1001"
out = shell_output("#{bin}/aqbanking-cli -D .aqbanking listbal "\
"-T '$(bankcode) $(accountnumber) $(dateAsString) "\
"$(valueAsString) $(iban) $(bic)' < #{context}")
assert_match match, out.gsub(/\s+/, " ")
end
end