aboutsummaryrefslogtreecommitdiff
path: root/net-p2p
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2021-05-10 09:15:26 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2021-05-10 09:15:30 +0000
commit5899c04eff968eef1bf356dc964ddc66123a7489 (patch)
tree7e5a60ae0446c50bd394a7a85b24adb411fdd1a4 /net-p2p
parent4a025a9c50bb980c7259c4bae81be602c1341f79 (diff)
downloadports-5899c04eff968eef1bf356dc964ddc66123a7489.tar.gz
ports-5899c04eff968eef1bf356dc964ddc66123a7489.zip
BtCheck is BitTorrent data checker and torrent file content viewer.
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/Makefile1
-rw-r--r--net-p2p/btcheck/Makefile62
-rw-r--r--net-p2p/btcheck/distinfo3
-rw-r--r--net-p2p/btcheck/files/patch-src_check.c32
-rw-r--r--net-p2p/btcheck/pkg-descr6
5 files changed, 104 insertions, 0 deletions
diff --git a/net-p2p/Makefile b/net-p2p/Makefile
index f588d7e18d85..7f849ecae71c 100644
--- a/net-p2p/Makefile
+++ b/net-p2p/Makefile
@@ -11,6 +11,7 @@
SUBDIR += bitmark-cli
SUBDIR += bitmark-daemon
SUBDIR += bitmark-recorder
+ SUBDIR += btcheck
SUBDIR += btpd
SUBDIR += c-lightning
SUBDIR += cpuminer
diff --git a/net-p2p/btcheck/Makefile b/net-p2p/btcheck/Makefile
new file mode 100644
index 000000000000..c205af140e70
--- /dev/null
+++ b/net-p2p/btcheck/Makefile
@@ -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>
diff --git a/net-p2p/btcheck/distinfo b/net-p2p/btcheck/distinfo
new file mode 100644
index 000000000000..13ece7bf10cb
--- /dev/null
+++ b/net-p2p/btcheck/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1503959726
+SHA256 (btcheck-2.1.tar.gz) = 4718109d591e27bd58e1b2b07dbed7b63ae2fe869f5ced58c45b8aa64543c4b4
+SIZE (btcheck-2.1.tar.gz) = 155618
diff --git a/net-p2p/btcheck/files/patch-src_check.c b/net-p2p/btcheck/files/patch-src_check.c
new file mode 100644
index 000000000000..a04553d43300
--- /dev/null
+++ b/net-p2p/btcheck/files/patch-src_check.c
@@ -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);
diff --git a/net-p2p/btcheck/pkg-descr b/net-p2p/btcheck/pkg-descr
new file mode 100644
index 000000000000..5df215fd333e
--- /dev/null
+++ b/net-p2p/btcheck/pkg-descr
@@ -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/