aboutsummaryrefslogtreecommitdiff
path: root/net-p2p/xbt
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2022-11-16 03:42:02 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2022-11-16 03:42:02 +0000
commit31518129c6af7a445831fa96d407d4d1d344d75d (patch)
tree643cd95a2d34a54ce92ca5aa52c543b46fa1f9e3 /net-p2p/xbt
parent30502135f297ff727b4992afbb76f0ca675c53ec (diff)
downloadports-31518129c6af7a445831fa96d407d4d1d344d75d.tar.gz
ports-31518129c6af7a445831fa96d407d4d1d344d75d.zip
net-p2p/xbt: new BitTorrent tracker port had been added (+)
It is written in modern C++ and designed for high performance while consuming little resources (CPU and RAM). Consisting of just a dozen files, it can be easily built with BSD or GNU make.
Diffstat (limited to 'net-p2p/xbt')
-rw-r--r--net-p2p/xbt/Makefile33
-rw-r--r--net-p2p/xbt/distinfo3
-rw-r--r--net-p2p/xbt/files/makefile30
-rw-r--r--net-p2p/xbt/files/patch-misc_socket.cpp9
-rw-r--r--net-p2p/xbt/pkg-descr6
5 files changed, 81 insertions, 0 deletions
diff --git a/net-p2p/xbt/Makefile b/net-p2p/xbt/Makefile
new file mode 100644
index 000000000000..316fe67cfc10
--- /dev/null
+++ b/net-p2p/xbt/Makefile
@@ -0,0 +1,33 @@
+PORTNAME= xbt
+PORTVERSION= g20221002
+CATEGORIES= net-p2p
+
+MAINTAINER= danfe@FreeBSD.org
+COMMENT= High-performance low-overhead BitTorrent tracker
+WWW= https://xbtt.sourceforge.net/
+
+LICENSE= GPLv3
+
+BUILD_DEPENDS= ${LOCALBASE}/include/boost/asio.hpp:devel/boost-libs
+
+USES= compiler:c++17-lang mysql pkgconfig
+USE_GITHUB= yes
+GH_ACCOUNT= OlafvdSpek
+GH_TAGNAME= 9c7dbc4
+
+MAKEFILE= ${FILESDIR}/makefile
+
+PLIST_FILES= bin/${PORTNAME}_tracker \
+ @sample\ etc/xbt_tracker.conf.sample \
+ ${DATADIR_REL}/xbt_tracker.sql
+
+do-install:
+ ${INSTALL_PROGRAM} ${INSTALL_WRKSRC}/${PORTNAME}_tracker \
+ ${STAGEDIR}${PREFIX}/bin
+ @${MKDIR} ${STAGEDIR}${DATADIR}
+ ${INSTALL_DATA} ${INSTALL_WRKSRC}/Tracker/xbt_tracker.sql \
+ ${STAGEDIR}${DATADIR}
+ ${INSTALL_DATA} ${INSTALL_WRKSRC}/Tracker/xbt_tracker.conf.default \
+ ${STAGEDIR}${PREFIX}/etc/xbt_tracker.conf.sample
+
+.include <bsd.port.mk>
diff --git a/net-p2p/xbt/distinfo b/net-p2p/xbt/distinfo
new file mode 100644
index 000000000000..079effc2084c
--- /dev/null
+++ b/net-p2p/xbt/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1664705861
+SHA256 (OlafvdSpek-xbt-g20221002-9c7dbc4_GH0.tar.gz) = dfc99aa59f661f5df2479cc10f27422b51b696353bfd1cbb2cfe5a155e25989c
+SIZE (OlafvdSpek-xbt-g20221002-9c7dbc4_GH0.tar.gz) = 276909
diff --git a/net-p2p/xbt/files/makefile b/net-p2p/xbt/files/makefile
new file mode 100644
index 000000000000..f6f6f0f55679
--- /dev/null
+++ b/net-p2p/xbt/files/makefile
@@ -0,0 +1,30 @@
+CXXFLAGS+= -std=c++17 -Wall -Wextra
+CPPFLAGS+= -Imisc -I$(LOCALBASE)/include
+LIBS!= pkg-config --libs mysqlclient
+LIBS+= -lz
+
+misc_OBJS= misc/bt_misc.o \
+ misc/database.o \
+ misc/sha1.o \
+ misc/socket.o \
+ misc/sql_query.o \
+ misc/xcc_z.o
+
+tracker_OBJS= Tracker/config.o \
+ Tracker/connection.o \
+ Tracker/epoll.o \
+ Tracker/tracker.o \
+ Tracker/tracker_input.o \
+ Tracker/transaction.o
+
+CCACHE!= command -v ccache
+
+.cpp.o:
+ $(CCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $@ -c $<
+
+xbt_tracker: $(misc_OBJS) $(tracker_OBJS)
+ $(CXX) $(LDFLAGS) -o $@ $>$^ $(LIBS)
+
+all: xbt_tracker
+
+.PHONY: all
diff --git a/net-p2p/xbt/files/patch-misc_socket.cpp b/net-p2p/xbt/files/patch-misc_socket.cpp
new file mode 100644
index 000000000000..43bbdcbcf280
--- /dev/null
+++ b/net-p2p/xbt/files/patch-misc_socket.cpp
@@ -0,0 +1,9 @@
+--- misc/socket.cpp.orig 2022-10-02 10:17:41 UTC
++++ misc/socket.cpp
+@@ -1,5 +1,6 @@
+ #include "socket.h"
+
++#include <array>
+ #include <cstring>
+ #include <cstdio>
+
diff --git a/net-p2p/xbt/pkg-descr b/net-p2p/xbt/pkg-descr
new file mode 100644
index 000000000000..46fb6d311bc8
--- /dev/null
+++ b/net-p2p/xbt/pkg-descr
@@ -0,0 +1,6 @@
+XBT (Extended BitTorrent) tracker is a BitTorrent tracker written in
+modern C++. It's designed to offer high performance while consuming
+little resources (CPU and RAM). It's a pure tracker, so it doesn't
+offer a frontend; please use any (e.g. PHP-based) frontend you want.
+The tracker stores statistics in a MySQL database/table; version 5 or
+higher is required.