git: 86b27ebb8a0e - main - net-p2p/mkbrr: New port: Commmand-line utility to create, modify and inspect torrent files

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Fri, 07 Mar 2025 22:06:57 UTC
The branch main has been updated by diizzy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=86b27ebb8a0e9ffc16c8ae4da58259eb56fe978b

commit 86b27ebb8a0e9ffc16c8ae4da58259eb56fe978b
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2025-03-07 21:34:08 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2025-03-07 22:06:42 +0000

    net-p2p/mkbrr: New port: Commmand-line utility to create, modify and inspect torrent files
    
    Supports features such as:
    
    * Creating torrent files
    * Inspecting torrent files
    * Modifying torrent metadata
    * Supports tracker-specific requirements automatically
    * Batch mode
---
 net-p2p/Makefile                  |  1 +
 net-p2p/mkbrr/Makefile            | 27 +++++++++++++++++++++++++++
 net-p2p/mkbrr/distinfo            |  5 +++++
 net-p2p/mkbrr/files/patch-main.go | 13 +++++++++++++
 net-p2p/mkbrr/pkg-descr           | 10 ++++++++++
 5 files changed, 56 insertions(+)

diff --git a/net-p2p/Makefile b/net-p2p/Makefile
index 1ea962ca10b5..635a3768aafb 100644
--- a/net-p2p/Makefile
+++ b/net-p2p/Makefile
@@ -53,6 +53,7 @@
     SUBDIR += lxmf
     SUBDIR += microdc2
     SUBDIR += minder
+    SUBDIR += mkbrr
     SUBDIR += mktorrent
     SUBDIR += mldonkey
     SUBDIR += mldonkey-core
diff --git a/net-p2p/mkbrr/Makefile b/net-p2p/mkbrr/Makefile
new file mode 100644
index 000000000000..aba02c252da7
--- /dev/null
+++ b/net-p2p/mkbrr/Makefile
@@ -0,0 +1,27 @@
+PORTNAME=	mkbrr
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.3.0
+CATEGORIES=	net-p2p
+
+MAINTAINER=	diizzy@FreeBSD.org
+COMMENT=	Commmand-line utility to create, modify and inspect torrent files written in Go
+WWW=		https://github.com/autobrr/mkbrr
+
+LICENSE=	GPLv2
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USES=		go:1.23,modules
+
+CGO_ENABLED=	0
+GO_MODULE=	github.com/autobrr/${PORTNAME}
+
+PLIST_FILES=	bin/mkbrr
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|%%DISTVERSION%%|${DISTVERSION}|g' \
+	    ${PATCH_WRKSRC}/main.go
+	@${REINPLACE_CMD} -e 's|%%BUILDTIME%%|${CONFIGURE_TARGET}|g' \
+	    ${PATCH_WRKSRC}/main.go
+	${RM} ${PATCH_WRKSRC}/cmd/update.go
+
+.include <bsd.port.mk>
diff --git a/net-p2p/mkbrr/distinfo b/net-p2p/mkbrr/distinfo
new file mode 100644
index 000000000000..fdc792bd990e
--- /dev/null
+++ b/net-p2p/mkbrr/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1741382943
+SHA256 (go/net-p2p_mkbrr/mkbrr-v1.3.0/v1.3.0.mod) = 7eb4252628e608712058fbed6f72cfa3a97fc6e8c5d7d3feb9efa8ec6d5d4676
+SIZE (go/net-p2p_mkbrr/mkbrr-v1.3.0/v1.3.0.mod) = 2106
+SHA256 (go/net-p2p_mkbrr/mkbrr-v1.3.0/v1.3.0.zip) = 426fd987d9f71b890d579d4d2a03b70d911b9e9a9e3ebc2824583a10012e13aa
+SIZE (go/net-p2p_mkbrr/mkbrr-v1.3.0/v1.3.0.zip) = 73885
diff --git a/net-p2p/mkbrr/files/patch-main.go b/net-p2p/mkbrr/files/patch-main.go
new file mode 100644
index 000000000000..8ee590106e3f
--- /dev/null
+++ b/net-p2p/mkbrr/files/patch-main.go
@@ -0,0 +1,13 @@
+--- main.go.orig	2025-03-07 21:35:10 UTC
++++ main.go
+@@ -7,8 +7,8 @@ var (
+ )
+ 
+ var (
+-	version   = "dev"
+-	buildTime = "unknown"
++	version   = "%%DISTVERSION%%"
++	buildTime = "%%BUILDTIME%%"
+ )
+ 
+ func main() {
diff --git a/net-p2p/mkbrr/pkg-descr b/net-p2p/mkbrr/pkg-descr
new file mode 100644
index 000000000000..93c7dcd832fc
--- /dev/null
+++ b/net-p2p/mkbrr/pkg-descr
@@ -0,0 +1,10 @@
+Commmand-line utility to create, modify and inspect torrent files written in Go
+
+A simple yet powerful tool for:
+
+* Creating torrent files
+* Inspecting torrent files
+* Modifying torrent metadata
+* Supports tracker-specific requirements automatically
+
+