78 lines
2.6 KiB
Ruby
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/368/aqbanking-6.2.10.tar.gz"
|
|
sha256 "78435ff3211353e24791e2f96943c82949c48aef3704f5b57d09f08a4abcab8d"
|
|
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: "69e8133dedb8b9225e7af46b5142bce212abb4de9880d7010ba5742d663e5aa6"
|
|
sha256 big_sur: "fc7526646a6176477a19123059888ee449a142cde7adc77ced46b0731f6383c8"
|
|
sha256 catalina: "080a19210e6a9ac819de72da01b1ef96929420a6b5545f1a480829f169595836"
|
|
sha256 mojave: "6b3c49ab2cbe735e9f4cdcb0bc347150908a6f5399a0fa43ea93b80353b11f33"
|
|
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
|