From 74c3376eb93e2f6c80f1a29d604a45558104f45c Mon Sep 17 00:00:00 2001 From: Martin Wilke Date: Wed, 29 Jul 2009 13:17:33 +0000 Subject: [PATCH] opentracker is a open and free bittorrent tracker project. It aims for minimal resource usage and is intended to run at your wlan router. Currently it is deployed as an open and free tracker instance. WWW: http://erdgeist.org/arts/software/opentracker/ PR: ports/137130 Submitted by: utisoft at gmail.com --- net/Makefile | 1 + net/opentracker/Makefile | 62 ++++++++++++++++++++++++++++ net/opentracker/distinfo | 3 ++ net/opentracker/files/opentracker.in | 29 +++++++++++++ net/opentracker/files/patch-Makefile | 58 ++++++++++++++++++++++++++ net/opentracker/pkg-descr | 6 +++ net/opentracker/pkg-plist | 4 ++ 7 files changed, 163 insertions(+) create mode 100644 net/opentracker/Makefile create mode 100644 net/opentracker/distinfo create mode 100644 net/opentracker/files/opentracker.in create mode 100644 net/opentracker/files/patch-Makefile create mode 100644 net/opentracker/pkg-descr create mode 100644 net/opentracker/pkg-plist diff --git a/net/Makefile b/net/Makefile index 1c98330b6135..0cc58ebeb16b 100644 --- a/net/Makefile +++ b/net/Makefile @@ -449,6 +449,7 @@ SUBDIR += openradius SUBDIR += openser SUBDIR += openslp + SUBDIR += opentracker SUBDIR += openverse SUBDIR += ortp SUBDIR += osrtspproxy diff --git a/net/opentracker/Makefile b/net/opentracker/Makefile new file mode 100644 index 000000000000..f4da092bff00 --- /dev/null +++ b/net/opentracker/Makefile @@ -0,0 +1,62 @@ +# New ports collection Makefile for: opentracker +# Date created: 27 July 2009 +# Whom: utisoft@gmail.com +# +# $FreeBSD$ +# + +PORTNAME= opentracker +PORTVERSION= 0.2009.06.27 +CATEGORIES= net +MASTER_SITES= http://www.bayofrum.net/opentracker/ \ + http://freebsd.dev-urandom.com/opentracker/ + +MAINTAINER= utisoft@gmail.com +COMMENT= A free lightweight bittorrent tracker using libowfat + +BUILD_DEPENDS= ${LOCALBASE}/lib/libowfat.a:${PORTSDIR}/devel/libowfat + +USE_RC_SUBR= opentracker + +OPTIONS=WANT_ACCESSLIST_BLACK "Enable client blacklisting" Off \ + WANT_ACCESSLIST_WHITE "Enable client whitelisting" Off \ + WANT_COMPRESSION_GZIP "Deliver gzip compressed full scrapes" Off \ + DEBUG_HTTPERROR "Verbose HTTPERRORs" Off \ + WANT_FULLSCRAPE "Can query tracker for all torrents" On \ + WANT_V6 "IPv6-only" Off \ + +.include + +.if defined(WITH_WANT_ACCESSLIST_BLACK) +FEATURES+=-DWANT_ACCESSLIST_BLACK +.endif +.if defined(WITH_WANT_ACCESSLIST_WHITE) +FEATURES+=-DWANT_ACCESSLIST_WHITE +.endif +.if defined(WITH_WANT_COMPRESSION_GZIP) +FEATURES+=-DWANT_COMPRESSION_GZIP +.endif +.if defined(WITH_DEBUG_HTTPERROR) +FEATURES+=-D_DEBUG_HTTPERROR +.endif +.if defined(WITH_WANT_FULLSCRAPE) +FEATURES+=-DWANT_FULLSCRAPE +.endif +.if defined(WITH_WANT_V6) +FEATURES+=-DWANT_V6 +.endif + +MAKE_ENV+=FEATURES="${FEATURES}" + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin + ${MKDIR} ${PREFIX}/etc/${PORTNAME} + ${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf.sample ${PREFIX}/etc/${PORTNAME}/${PORTNAME}.conf.sample + +post-install: + @if [ ! -f ${PREFIX}/etc/${PORTNAME}/${PORTNAME}.conf ]; then \ + ${CP} -p ${PREFIX}/etc/${PORTNAME}/${PORTNAME}.conf.sample \ + ${PREFIX}/etc/${PORTNAME}/${PORTNAME}.conf ; \ + fi + +.include diff --git a/net/opentracker/distinfo b/net/opentracker/distinfo new file mode 100644 index 000000000000..d7bf5ec1d9a7 --- /dev/null +++ b/net/opentracker/distinfo @@ -0,0 +1,3 @@ +MD5 (opentracker-0.2009.06.27.tar.gz) = b453bbd8b557f6cdd633ab000b9ef6db +SHA256 (opentracker-0.2009.06.27.tar.gz) = e8b3437bc98ab6f9f25cbb107a272ae1e4c86ce635c11195c197cae5f0d40fe7 +SIZE (opentracker-0.2009.06.27.tar.gz) = 45117 diff --git a/net/opentracker/files/opentracker.in b/net/opentracker/files/opentracker.in new file mode 100644 index 000000000000..afcbde34b282 --- /dev/null +++ b/net/opentracker/files/opentracker.in @@ -0,0 +1,29 @@ +#!/bin/sh + +# PROVIDE: opentracker +# REQUIRE: LOGIN + +# Add the following lines to /etc/rc.conf or /etc/rc.conf.local to +# enable opentracker: +# opentracker_enable (bool): Set to "NO" by default. +# opentracker_config (path): Set to +# "%%PREFIX%%/etc/opentracker/opentracker.conf" +# by default + +. %%RC_SUBR%% + +name="opentracker" +rcvar=`set_rcvar` + +load_rc_config $name + +: ${opentracker_enable="NO"} +: ${opentracker_config="%%PREFIX%%/etc/opentracker/opentracker.conf"} + +command="/usr/sbin/daemon" +command_args="-p /var/run/opentracker.pid %%PREFIX%%/bin/opentracker -f ${opentracker_config}" +procname="%%PREFIX%%/bin/opentracker" +pidfile="/var/run/opentracker.pid" +required_files=${opentracker_config} + +run_rc_command "$1" diff --git a/net/opentracker/files/patch-Makefile b/net/opentracker/files/patch-Makefile new file mode 100644 index 000000000000..5d168a0fe92d --- /dev/null +++ b/net/opentracker/files/patch-Makefile @@ -0,0 +1,58 @@ +--- Makefile.orig 2009-06-27 16:48:37.000000000 +0100 ++++ Makefile 2009-06-27 18:19:43.000000000 +0100 +@@ -8,14 +8,14 @@ + # LIBOWFAT_LIBRARY=$(PREFIX)/lib + + # BSD flavour +-# PREFIX?=/usr/local +-# LIBOWFAT_HEADERS=$(PREFIX)/include/libowfat +-# LIBOWFAT_LIBRARY=$(PREFIX)/lib ++PREFIX?=/usr/local ++LIBOWFAT_HEADERS=$(LOCALBASE)/include/libowfat ++LIBOWFAT_LIBRARY=$(LOCALBASE)/lib + + # Debug flavour +-PREFIX?=.. +-LIBOWFAT_HEADERS=$(PREFIX)/libowfat +-LIBOWFAT_LIBRARY=$(PREFIX)/libowfat ++# PREFIX?=.. ++# LIBOWFAT_HEADERS=$(PREFIX)/libowfat ++# LIBOWFAT_LIBRARY=$(PREFIX)/libowfat + + BINDIR?=$(PREFIX)/bin + +@@ -31,7 +31,7 @@ + #FEATURES+=-DWANT_LOG_NETWORKS + #FEATURES+=-DWANT_RESTRICT_STATS + #FEATURES+=-DWANT_IP_FROM_PROXY +-FEATURES+=-DWANT_FULLSCRAPE ++#FEATURES+=-DWANT_FULLSCRAPE + + #FEATURES+=-D_DEBUG_HTTPERROR + +@@ -46,23 +46,15 @@ + SOURCES=opentracker.c trackerlogic.c scan_urlencoded_query.c ot_mutex.c ot_stats.c ot_vector.c ot_clean.c ot_udp.c ot_iovec.c ot_fullscrape.c ot_accesslist.c ot_http.c ot_livesync.c + + OBJECTS = $(SOURCES:%.c=%.o) +-OBJECTS_debug = $(SOURCES:%.c=%.debug.o) + +-.SUFFIXES: .debug.o .o .c ++.SUFFIXES: .o .c + +-all: $(BINARY) $(BINARY).debug ++all: $(BINARY) + + CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES) +-CFLAGS_debug = $(CFLAGS) $(OPTS_debug) $(FEATURES) + + $(BINARY): $(OBJECTS) $(HEADERS) + $(CC) -o $@ $(OBJECTS) $(LDFLAGS) +- strip $@ +-$(BINARY).debug: $(OBJECTS_debug) $(HEADERS) +- $(CC) -o $@ $(OBJECTS_debug) $(LDFLAGS) +- +-.c.debug.o : $(HEADERS) +- $(CC) -c -o $@ $(CFLAGS_debug) $(<:.debug.o=.c) + + .c.o : $(HEADERS) + $(CC) -c -o $@ $(CFLAGS_production) $< diff --git a/net/opentracker/pkg-descr b/net/opentracker/pkg-descr new file mode 100644 index 000000000000..2f754a0707e1 --- /dev/null +++ b/net/opentracker/pkg-descr @@ -0,0 +1,6 @@ +opentracker is a open and free bittorrent tracker project. +It aims for minimal resource usage and is intended to run +at your wlan router. Currently it is deployed as an open and +free tracker instance. + +WWW: http://erdgeist.org/arts/software/opentracker/ diff --git a/net/opentracker/pkg-plist b/net/opentracker/pkg-plist new file mode 100644 index 000000000000..413e982399aa --- /dev/null +++ b/net/opentracker/pkg-plist @@ -0,0 +1,4 @@ +bin/opentracker +@unexec if cmp -s %D/etc/opentracker/opentracker.conf.sample %D/etc/opentracker/opentracker.conf; then rm -f %D/etc/opentracker/opentracker.conf; fi +etc/opentracker/opentracker.conf.sample +@dirrm etc/opentracker