BtCheck is BitTorrent data checker and torrent file content viewer.

WWW: https://sourceforge.net/projects/btcheck/
This commit is contained in:
Alexey Dokuchaev 2021-05-10 09:15:26 +00:00
parent 4a025a9c50
commit 5899c04eff
5 changed files with 104 additions and 0 deletions

View file

@ -11,6 +11,7 @@
SUBDIR += bitmark-cli
SUBDIR += bitmark-daemon
SUBDIR += bitmark-recorder
SUBDIR += btcheck
SUBDIR += btpd
SUBDIR += c-lightning
SUBDIR += cpuminer

62
net-p2p/btcheck/Makefile Normal file
View file

@ -0,0 +1,62 @@
# Created by: Alexey Dokuchaev <danfe@FreeBSD.org>
PORTNAME= btcheck
PORTVERSION= 2.1
CATEGORIES= net-p2p
MASTER_SITES= SF/${PORTNAME}
MAINTAINER= danfe@FreeBSD.org
COMMENT= BitTorrent data checker and torrent file content viewer
LICENSE= GPLv3
GNU_CONFIGURE= yes
PLIST_FILES= bin/btcheck man/man1/btcheck.1.gz
PORTDOCS= AUTHORS ChangeLog NEWS README
OPTIONS_DEFINE= DOCS
OPTIONS_RADIO= SHA1
SHA1_DESC= Optimized SHA-1 calculation
OPTIONS_RADIO_SHA1= BEECRYPT GCRYPT GNUTLS MBEDTLS NETTLE OPENSSL TOMCRYPT
OPTIONS_DEFAULT= OPENSSL
BEECRYPT_DESC= Use SHA-1 implementation from BeeCrypt
BEECRYPT_LIB_DEPENDS= libbeecrypt.so:security/beecrypt
BEECRYPT_USES= localbase
BEECRYPT_CONFIGURE_ON= --with-beecrypt
GCRYPT_DESC= Use SHA-1 implementation from GNU crypt
GCRYPT_LIB_DEPENDS= libgcrypt.so:security/libgcrypt
GCRYPT_USES= localbase
GCRYPT_CONFIGURE_ON= --with-gcrypt
GNUTLS_DESC= Use SHA-1 implementation from GnuTLS
GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls
GNUTLS_USES= localbase
GNUTLS_CONFIGURE_ON= --with-gnutls
MBEDTLS_DESC= Use SHA-1 implementation from mbedTLS/PolarSSL
MBEDTLS_LIB_DEPENDS= libmbedcrypto.so:security/mbedtls
MBEDTLS_USES= localbase
MBEDTLS_CONFIGURE_ON= --with-polarssl
NETTLE_DESC= Use SHA-1 implementation from Nettle
NETTLE_LIB_DEPENDS= libnettle.so:security/nettle
NETTLE_USES= localbase
NETTLE_CONFIGURE_ON= --with-nettle
OPENSSL_DESC= Use SHA-1 implementation from OpenSSL
OPENSSL_USES= ssl
OPENSSL_CONFIGURE_ON= --with-openssl
TOMCRYPT_DESC= Use SHA-1 implementation from LibTomCrypt
TOMCRYPT_LIB_DEPENDS= libtomcrypt.so:security/libtomcrypt
TOMCRYPT_USES= localbase
TOMCRYPT_CONFIGURE_ON= --with-tomcrypt
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>

3
net-p2p/btcheck/distinfo Normal file
View file

@ -0,0 +1,3 @@
TIMESTAMP = 1503959726
SHA256 (btcheck-2.1.tar.gz) = 4718109d591e27bd58e1b2b07dbed7b63ae2fe869f5ced58c45b8aa64543c4b4
SIZE (btcheck-2.1.tar.gz) = 155618

View file

@ -0,0 +1,32 @@
--- src/check.c.orig 2017-08-26 19:37:29 UTC
+++ src/check.c
@@ -36,7 +36,7 @@ int check(btree_t *torrentbtree)
btfile_t *btfile;
void *piecebuffer, *piecedigest;
size_t size, length;
- int ret, pieceindex, failure;
+ int ret, pieceindex, failure, numpieces;
torrentinfo = search_dict_value(torrentbtree, TorrentInfoSearch);
if (torrentinfo == NULL) {
@@ -80,6 +80,7 @@ int check(btree_t *torrentbtree)
fprintf(stderr, "Can't open btfile.\n");
}
+ numpieces = (torrentinfolength + torrentinfopiecelength - 1) / torrentinfopiecelength;
failure = 0;
pieceindex = 0;
readlength = 0;
@@ -99,10 +100,10 @@ int check(btree_t *torrentbtree)
}
if (ret == 0) {
if (Verbose >= 0)
- printf("\rpiece[%d] OK ", pieceindex);
+ printf("\rpiece[%d/%d] OK ", pieceindex, numpieces);
} else {
if (Verbose >= 0)
- printf("\rpiece[%d] BAD \n", pieceindex);
+ printf("\rpiece[%d/%d] BAD \n", pieceindex, numpieces);
failure++;
}
fflush(stdout);

View file

@ -0,0 +1,6 @@
BtCheck can check downloaded data integrity according to the given
torrent and it can also show the information stored in the torrent
file: announce trackers, list of files with their size, hash value,
creation date, comments, etc.
WWW: https://sourceforge.net/projects/btcheck/