1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

finance/ktoblzcheck: Update to 1.57

Update bankdata to include Dutch and Swiss bank codes and SEPA data for
offline building.
This commit is contained in:
Jason E. Hale 2024-01-12 13:53:29 -05:00
parent 3fc187a01f
commit 9ae632ebd5
5 changed files with 67 additions and 105 deletions

View File

@ -1,6 +1,5 @@
PORTNAME= ktoblzcheck
PORTVERSION= 1.53
PORTREVISION= 9
PORTVERSION= 1.57
CATEGORIES= finance german
MASTER_SITES= SF/${PORTNAME} \
LOCAL/jhale/${PORTNAME}:bankdata
@ -14,16 +13,19 @@ WWW= https://ktoblzcheck.sourceforge.net/
LICENSE= LGPL21+
LICENSE_FILE= ${WRKSRC}/COPYING
USES= cmake pathfix python:build
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}openpyxl>0:textproc/py-openpyxl@${PY_FLAVOR}
LIB_DEPENDS= libcurl.so:ftp/curl
USES= cmake localbase pathfix python:build sqlite
USE_LDCONFIG= yes
CMAKE_ON= INSTALL_RAW_BANKDATA_FILE
CMAKE_OFF= ENABLE_BANKDATA_DOWNLOAD
CMAKE_OFF= ENABLE_BANKDATA_DOWNLOAD \
INSTALL_RAW_BANKDATA_FILE
PLIST_SUB= BANKDATA_DATE=${BANKDATA_DATE}
PORTDOCS= README.md
BANKDATA_DATE= 20231204
BANKDATA_DATE= 20240108
OPTIONS_DEFINE= DOCS DOXYGEN
OPTIONS_SUB= yes
@ -35,10 +37,12 @@ DOXYGEN_CMAKE_BOOL_OFF= CMAKE_DISABLE_FIND_PACKAGE_Doxygen
TEST_TARGET= test
post-patch:
@${REINPLACE_CMD} -e 's|$${CMAKE_INSTALL_DATADIR}\/man|$${CMAKE_INSTALL_MANDIR}|' ${WRKSRC}/doc/CMakeLists.txt
@(cd ${WRKSRC}/src/bankdata && ${RM} bankdata_*.txt blz_*.txt)
@${CP} ${WRKDIR}/${PORTNAME}-bankdata-${BANKDATA_DATE}/blz_${BANKDATA_DATE}.txt ${WRKSRC}/src/bankdata
@${TOUCH} ${WRKSRC}/src/bankdata/bankdata_${BANKDATA_DATE}.txt
@${CP} ${WRKDIR}/${PORTNAME}-bankdata-${BANKDATA_DATE}/ch_data.txt ${WRKSRC}/src/bankdata
@${CP} ${WRKDIR}/${PORTNAME}-bankdata-${BANKDATA_DATE}/nl_data.xlsx ${WRKSRC}/src/bankdata
@${CP} ${WRKDIR}/${PORTNAME}-bankdata-${BANKDATA_DATE}/sepa_${BANKDATA_DATE}.txt ${WRKSRC}/src/bankdata/sepa
@${REINPLACE_CMD} -e 's|%%BANKDATA_DATE%%|'"$$(date -j -f "%Y%m%d" "+%d.%m.%Y" ${BANKDATA_DATE})"'|' \
${WRKSRC}/src/bankdata/CMakeLists.txt
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}

View File

@ -1,5 +1,5 @@
TIMESTAMP = 1703801052
SHA256 (ktoblzcheck-1.53.tar.gz) = 18b9118556fe83240f468f770641d2578f4ff613cdcf0a209fb73079ccb70c55
SIZE (ktoblzcheck-1.53.tar.gz) = 531459
SHA256 (ktoblzcheck-bankdata-20231204.tar.gz) = fbb84b8bc149c9a111fb7408a8bd48f47385dca7182383e425450556ea68a547
SIZE (ktoblzcheck-bankdata-20231204.tar.gz) = 293232
TIMESTAMP = 1705083248
SHA256 (ktoblzcheck-1.57.tar.gz) = 4c3b782e5d8e31e219c3e2ece0c6e84a93929ae0b2f36080d4c183a644d05672
SIZE (ktoblzcheck-1.57.tar.gz) = 96788
SHA256 (ktoblzcheck-bankdata-20240108.tar.gz) = ce039f989ef7ac7b12de5ea57fa58991e98cecf0ce7ba2b75d567ca5c4db43e5
SIZE (ktoblzcheck-bankdata-20240108.tar.gz) = 534789

View File

@ -0,0 +1,23 @@
--- src/bankdata/CMakeLists.txt.orig 2024-01-05 07:31:23 UTC
+++ src/bankdata/CMakeLists.txt
@@ -23,6 +23,7 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/ch_data.cmake "
file(DOWNLOAD \"${CH_RAW_DATA_URL}\" \"${CH_RAW_DATA_PATH}\")
")
+if(ENABLE_BANKDATA_DOWNLOAD)
# fetch validity date from bank's website
function(extract_date ARG)
file(DOWNLOAD ${BANK_WEBSITE_URL} ${TEMP_FILE})
@@ -57,10 +58,10 @@ add_custom_command(
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Download raw bank data file to ${CH_RAW_DATA_PATH}"
)
+endif()
# store the validity date in VALID_DATE
-set(VALID_DATE "")
-extract_date(VALID_DATE)
+set(VALID_DATE "%%BANKDATA_DATE%%")
if(NOT "${VALID_DATE}" STREQUAL "")
add_custom_command(

View File

@ -1,83 +0,0 @@
Update methods 45, B1, and C2. Implement method E4.
https://sourceforge.net/p/ktoblzcheck/code/merge-requests/14/
--- src/lib/methods.cc.orig 2020-01-20 15:07:55 UTC
+++ src/lib/methods.cc
@@ -530,15 +530,15 @@ AccountNumberCheck::Result method_44(const int *accoun
return algo01(11, weight, false, 10, account);
}
+// method 45 was extended for due-date 2018-06-04
AccountNumberCheck::Result method_45(const int *account, int *weight)
{
- // some numbers do not have a checksum
- if (0 == account[0] || 1 == account[4]) {
+ // accountIDs starting with "0" or "48" do not have a check digit
+ // accountIDs that have "1" as the fifth digit do not have a check digit
+ if (0 == account[0] || 1 == account[4] || (4 == account[0] && 8 == account[1])) {
return AccountNumberCheck::OK;
}
-
- number2Array("2121212120", weight);
- return algo01(10, weight, true, 10, account);
+ return method_00(account, weight);
}
AccountNumberCheck::Result method_46(const int *account, int *weight)
@@ -1644,13 +1644,13 @@ AccountNumberCheck::Result method_B0(const int *accoun
// Checked with Bundesbank-Testnumbers
AccountNumberCheck::Result method_B1(const int *account, int *weight)
{
- number2Array("1371371370", weight);
- if (AccountNumberCheck::OK == algo01(10, weight, false, 10, account)) {
- return AccountNumberCheck::OK; // variant 1 (method "05")
+ if (AccountNumberCheck::OK == method_05(account, weight)) {
+ return AccountNumberCheck::OK; // variant 1
}
- number2Array("1731731730", weight);
- return algo01(10, weight, false, 10, account);
- // variant 2 (method "01")
+ if (AccountNumberCheck::OK == method_01(account, weight)) {
+ return AccountNumberCheck::OK; // variant 2
+ }
+ return method_00(account, weight); //variant 3, extended for due-date 2017-06-05
}
// Added by Jens Gecius (new Method as of September 6th, 2004)
@@ -1824,7 +1824,10 @@ AccountNumberCheck::Result method_C2(const int *accoun
if (AccountNumberCheck::OK == method_22(account, weight)) { // variant 1
return AccountNumberCheck::OK;
}
- return method_00(account, weight); // variant 2
+ if (AccountNumberCheck::OK == method_00(account, weight)) { // variant 2
+ return AccountNumberCheck::OK;
+ }
+ return method_04(account, weight); // variant 3, extended for due-date 2017-09-04
}
// new method C3 and C4 valid from March 5th, 2007, checked with Bundesbank-Testnumbers
@@ -2190,6 +2193,16 @@ AccountNumberCheck::Result method_E3(const int *accoun
return method_21(account, weight); // variant 2
}
+// new method E4 valid from 2017-06-05
+// checked with Bundesbank-Testnumbers
+AccountNumberCheck::Result method_E4(const int *account, int *weight)
+{
+ if (AccountNumberCheck::OK == method_02(account, weight)) { // variant 1
+ return AccountNumberCheck::OK;
+ }
+ return method_00(account, weight); // variant 2
+}
+
struct method_func_s {
const char *str;
AccountNumberCheck::MethodFunc func;
@@ -2337,6 +2350,7 @@ const struct method_func_s cb_funcs[] = {
{ "E1", method_E1},
{ "E2", method_E2},
{ "E3", method_E3},
+ { "E4", method_E4},
{ 0, 0} // Important: The array has to end with the {0,0} entry,
// otherwise initMethodMap() will runaway and crash!
};

View File

@ -1,7 +1,9 @@
bin/ibanchk
bin/ktoblzcheck
bin/ktoblzupdate
include/iban.h
include/ktoblzcheck.h
include/ktoblzcheck_export.h
lib/cmake/KtoBlzCheck/KtoBlzCheckConfig.cmake
lib/cmake/KtoBlzCheck/KtoBlzCheckConfigVersion.cmake
lib/cmake/KtoBlzCheck/KtoBlzCheckTargets-%%CMAKE_BUILD_TYPE%%.cmake
@ -10,28 +12,32 @@ lib/libktoblzcheck.so
lib/libktoblzcheck.so.1
lib/libktoblzcheck.so.1.5.26
libdata/pkgconfig/ktoblzcheck.pc
share/man/man1/ibanchk.1.gz
share/man/man1/ktoblzcheck.1.gz
%%DOXYGEN%%%%DOCSDIR%%/api/README_8md.html
%%DOXYGEN%%%%DOCSDIR%%/api/_8build_2src_2include_2ktoblzcheck__export_8h.html
%%DOXYGEN%%%%DOCSDIR%%/api/_8build_2src_2include_2ktoblzcheck__export_8h_source.html
%%DOXYGEN%%%%DOCSDIR%%/api/annotated.html
%%DOXYGEN%%%%DOCSDIR%%/api/bc_s.png
%%DOXYGEN%%%%DOCSDIR%%/api/bc_sd.png
%%DOXYGEN%%%%DOCSDIR%%/api/bdwn.png
%%DOXYGEN%%%%DOCSDIR%%/api/classAccountNumberCheck-members.html
%%DOXYGEN%%%%DOCSDIR%%/api/classAccountNumberCheck.html
%%DOXYGEN%%%%DOCSDIR%%/api/classAccountNumberCheck_1_1Record-members.html
%%DOXYGEN%%%%DOCSDIR%%/api/classAccountNumberCheck_1_1Record.html
%%DOXYGEN%%%%DOCSDIR%%/api/classDataUpdater-members.html
%%DOXYGEN%%%%DOCSDIR%%/api/classDataUpdater.html
%%DOXYGEN%%%%DOCSDIR%%/api/classIban-members.html
%%DOXYGEN%%%%DOCSDIR%%/api/classIban.html
%%DOXYGEN%%%%DOCSDIR%%/api/classIbanCheck-members.html
%%DOXYGEN%%%%DOCSDIR%%/api/classIbanCheck.html
%%DOXYGEN%%%%DOCSDIR%%/api/classes.html
%%DOXYGEN%%%%DOCSDIR%%/api/closed.png
%%DOXYGEN%%%%DOCSDIR%%/api/dir_2d731f5ea854aa8d4182cb287b4b4714.html
%%DOXYGEN%%%%DOCSDIR%%/api/dir_5652562e240707faebb7b26ba93ec871.html
%%DOXYGEN%%%%DOCSDIR%%/api/dir_027acad13201f25411f30b3a77f2b006.html
%%DOXYGEN%%%%DOCSDIR%%/api/dir_5a44bfe66872ebd87256b63344bc501a.html
%%DOXYGEN%%%%DOCSDIR%%/api/dir_6b601777cc03b1c222ba0713691323f0.html
%%DOXYGEN%%%%DOCSDIR%%/api/dir_63c478c42e36c4f05959c97623df5ccd.html
%%DOXYGEN%%%%DOCSDIR%%/api/dir_8f1ddfcaba34d370f217a025e0bf2872.html
%%DOXYGEN%%%%DOCSDIR%%/api/dir_b6310677cdb1a308af776abddf4b17ae.html
%%DOXYGEN%%%%DOCSDIR%%/api/doc.png
%%DOXYGEN%%%%DOCSDIR%%/api/docd.png
%%DOXYGEN%%%%DOCSDIR%%/api/doxygen.css
%%DOXYGEN%%%%DOCSDIR%%/api/doxygen.svg
%%DOXYGEN%%%%DOCSDIR%%/api/dynsections.js
@ -53,22 +59,34 @@ share/man/man1/ktoblzcheck.1.gz
%%DOXYGEN%%%%DOCSDIR%%/api/iban_8h_source.html
%%DOXYGEN%%%%DOCSDIR%%/api/index.html
%%DOXYGEN%%%%DOCSDIR%%/api/jquery.js
%%DOXYGEN%%%%DOCSDIR%%/api/ktoblzcheck-1_857_2src_2include_2ktoblzcheck__export_8h.html
%%DOXYGEN%%%%DOCSDIR%%/api/ktoblzcheck-1_857_2src_2include_2ktoblzcheck__export_8h_source.html
%%DOXYGEN%%%%DOCSDIR%%/api/ktoblzcheck_8h.html
%%DOXYGEN%%%%DOCSDIR%%/api/ktoblzcheck_8h_source.html
%%DOXYGEN%%%%DOCSDIR%%/api/menu.js
%%DOXYGEN%%%%DOCSDIR%%/api/menudata.js
%%DOXYGEN%%%%DOCSDIR%%/api/nav_f.png
%%DOXYGEN%%%%DOCSDIR%%/api/nav_fd.png
%%DOXYGEN%%%%DOCSDIR%%/api/nav_g.png
%%DOXYGEN%%%%DOCSDIR%%/api/nav_h.png
%%DOXYGEN%%%%DOCSDIR%%/api/nav_hd.png
%%DOXYGEN%%%%DOCSDIR%%/api/open.png
%%DOXYGEN%%%%DOCSDIR%%/api/splitbar.png
%%DOXYGEN%%%%DOCSDIR%%/api/splitbard.png
%%DOXYGEN%%%%DOCSDIR%%/api/sync_off.png
%%DOXYGEN%%%%DOCSDIR%%/api/sync_on.png
%%DOXYGEN%%%%DOCSDIR%%/api/tab_a.png
%%DOXYGEN%%%%DOCSDIR%%/api/tab_ad.png
%%DOXYGEN%%%%DOCSDIR%%/api/tab_b.png
%%DOXYGEN%%%%DOCSDIR%%/api/tab_bd.png
%%DOXYGEN%%%%DOCSDIR%%/api/tab_h.png
%%DOXYGEN%%%%DOCSDIR%%/api/tab_hd.png
%%DOXYGEN%%%%DOCSDIR%%/api/tab_s.png
%%DOXYGEN%%%%DOCSDIR%%/api/tab_sd.png
%%DOXYGEN%%%%DOCSDIR%%/api/tabs.css
%%DATADIR%%/bankdata_%%BANKDATA_DATE%%.txt
%%DATADIR%%/blz_%%BANKDATA_DATE%%.txt
%%DATADIR%%/bankdata.ch.db
%%DATADIR%%/bankdata.de.db
%%DATADIR%%/bankdata.nl.db
%%DATADIR%%/ibandata.txt
share/man/man1/ibanchk.1.gz
share/man/man1/ktoblzcheck.1.gz