From 261efab410991f63a750d095cdfab8bd7682b088 Mon Sep 17 00:00:00 2001 From: Micha Glave Date: Wed, 15 Jan 2014 09:42:40 +0100 Subject: [PATCH] adding opentracker-live-build --- net-p2p/opentracker/Manifest | 5 + net-p2p/opentracker/files/opentracker.8 | 189 +++++++++++++++++++ net-p2p/opentracker/files/opentracker.conf.d | 3 + net-p2p/opentracker/files/opentracker.init.d | 29 +++ net-p2p/opentracker/metadata-opentracker.xml | 18 ++ net-p2p/opentracker/opentracker-9999.ebuild | 133 +++++++++++++ repo.xml | 14 ++ 7 files changed, 391 insertions(+) create mode 100644 net-p2p/opentracker/Manifest create mode 100644 net-p2p/opentracker/files/opentracker.8 create mode 100644 net-p2p/opentracker/files/opentracker.conf.d create mode 100644 net-p2p/opentracker/files/opentracker.init.d create mode 100644 net-p2p/opentracker/metadata-opentracker.xml create mode 100644 net-p2p/opentracker/opentracker-9999.ebuild create mode 100644 repo.xml diff --git a/net-p2p/opentracker/Manifest b/net-p2p/opentracker/Manifest new file mode 100644 index 0000000..2b35384 --- /dev/null +++ b/net-p2p/opentracker/Manifest @@ -0,0 +1,5 @@ +AUX opentracker.8 6850 SHA256 c4a5ead78801e5fe25eb898c0d9a57e391d8224c5fb27151ab4b1570c81080e7 SHA512 6e1cf07f2ae7dcfac123b053e7661cfd8f654f40c7b20d1e060c24740497ea071beba3c0b1bddee22232914315f0d80fdabbc392e175d55a95b40296bd8708e7 WHIRLPOOL 1e440e4a6cbd95eb1fca8d65ad0b9a655d9cecbd34dbbdd832174958ea0e114ae9ec6e9d92a64b536e1e64d810792db4c0001610da69f77e586f5f985a210c74 +AUX opentracker.conf.d 104 SHA256 c050b2ba94872c0d1e74a20936fe32b980a956700ccc598d30e06804392879d4 SHA512 04ce8088caed2283095b4677e57e19adcf6f4dcc11a94c14a50b8084c604a76395774fb646b4f3403fb1aed3ed16a617345b1054c0778315d5c22eb9b314e9b9 WHIRLPOOL 5e660b468e14b838840f2e7b507f0c4acb618d45395e356a0f337568dd7c55a1e6c6accf4667adc41d86ef5a47ec367df3903169a885903c35ac0aa1dbb7aff8 +AUX opentracker.init.d 543 SHA256 cfbd3cf64045b1305bedbb3c1699cf234d65dfb04946b30d626438ed90e74682 SHA512 9ddfda5b88dfc77e6031b9268076f863d2be99743eea753a522046571c799b53e180fb9d5d77a0c62bb5cdca05269ee9232f2e1f4a27116750238609cb6b6fe4 WHIRLPOOL 86367f23f8709491945ed47d90f36632af6812125149aa37f36796ea2a103ef5ee30e1046266808f819d2dc0ce6404d2da5c48b4e50c54e70139db66b744f196 +EBUILD opentracker-9999.ebuild 4427 SHA256 764339ad6159d1038f355c0fee6024ae69f960c7341a487b1040a5a659312b95 SHA512 abdaf8cbb609c38bf5dd5ba51edda08e4b3a531e42fcaa9d021050569098b8c70755a638a8e328624f7e2ec0cbb6c53eb3aa2aeaf9d7de3c310076721d9ef551 WHIRLPOOL 7b7f264b283c463035dcff6f595e6c2cdfadf216ccb5c688539837fedebad86a2decece91eaac76d724d0681e2acf5cf20aba41b4dfb72a5d19a657a9d821701 +MISC metadata-opentracker.xml 870 SHA256 44fd9e3a6064fb48afb9b8f371c696e9dadaccb2721d7867694f49d73004b13c SHA512 11410e4ed5a94f933b64f046e13a61ec4b328fce98d1ecc6c0afa26c06a1f6137ab7698bd2f23a198ef471fe6e57d7d7295f6c51736f838cc5a41e7e1f51f24d WHIRLPOOL 29a4f10ec9e195eb5c733478abf6230d890c8dcc9b04e008c32c21cf56a8a4f79aeb745f9e78b7e77dd11894991158638112cf2a3e4f15d8259fff686b3944de diff --git a/net-p2p/opentracker/files/opentracker.8 b/net-p2p/opentracker/files/opentracker.8 new file mode 100644 index 0000000..a24755b --- /dev/null +++ b/net-p2p/opentracker/files/opentracker.8 @@ -0,0 +1,189 @@ +.TH opentracker 8 "March 22, 2013" "" "opentracker" +.SH NAME +.B opentracker +\- high-performance bittorrent tracker +.SH SYNOPSIS +.B opentracker +.RB [ \-i +.IR ip ] +.RB [ \-p +.IR tcpport ] +.RB [ \-P +.IR udpport ] +.RB [ \-r +.IR redirecturl ] +.RB [ \-d +.IR directory ] +.RB [ \-u +.IR user ] +.RB [ \-A +.IR ip ] +.RB [ \-f +.IR config ] +.RB [ \-s +.IR livesyncport ] +.RB [ \-b +.IR file ] +.RB [ \-w +.IR file ] +.SH DESCRIPTION +.B opentracker +is a open and free bittorrent tracker. It aims for minimal resource usage +and is intended to run at WLAN router. +.B opentracker +basically is an http-server that collects all clients ip addresses +into pools sorted by one of the request strings parameters +and answers all other clients that specified this exact same parameter +a list of all other recent clients. +Utilizing the highly scalable server framework from libowfat, +opentracker can easily serve multiple thousands of requests +on a standard plastic WLAN-router, limited only by hardware. + +.SH OPTIONS +The following command-line options are accepted by the server: +.IP "\-i \fIip\fP" +ip address to bind to. Default \- *, you may specify more than one. +.IP "\-p \fItcpport\fP" +tcp port to bind to. Default \- 6969, you may specify more than one. +.IP "\-P \fIudpport\fP" +udp port to bind to. Default \- 6969, you may specify more than one. +.IP "\-r \fIredirecturl\fP" +url where / should be redirected to. Default \- none. +.IP "\-d \fIdirectory\fP" +directory to try to chroot to. Default \- ".". +.IP "\-u \fIuser\fP" +user under whose priviliges opentracker should run. Default \- "nobody". +.IP "\-f \fIconfig\fP" +config file +.IP "\-A \fIip\fP" +ip address to sync from +.IP "\-w \fIfile\fP" +path to whitelist +.IP "\-b \fIfile\fP" +path to blacklist +.IP "\-s \fIlivesyncport\fP" +udp port to listen for incoming live sync packets. Default \- 9696. +.SH CONFIG +.IP listen.udp.workers +this statement determines if udp sockets are handled in the event +loop, when variable sets to 0 ( by default ), or are handled in blocking reads in +dedicated worker threads. You have to set this value before the listen.tcp_udp or +listen.udp, listen.tcp statements before it takes effect, but you can re-set it for each listen statement. +Normally you should keep it at the top of the config file. +Examples: 0, 1, 4 +.IP listen.tcp_udp +this statement specifies ip address +.B opentracker +will listen on, using both, tcp and udp, ports. +Examples: 0.0.0.0, 192.168.0.1:80, 10.0.0.5:6969 +.IP listen.tcp +this statement specifies ip address to listen on, using tcp ports only. +Examples: 0.0.0.0, 192.168.0.1:80, 10.0.0.5:6969 +.IP listen.udp +this statement specifies ip address to listen on, using udp ports only. +Examples: 0.0.0.0, 192.168.0.1:80, 10.0.0.5:6969 +.IP access.whitelist +this statement specifies path to file containing all torrent hashes that +.B opentracker +will serve. +File format is straight forward: "\\n\\n...". +.B opentracker +should be compiled with whitelist support ( option +.I DWANT_ACCESSLIST_BLACK +) to make this statement work. +.IP access.blacklist +this statement specifies path to file containing torrent hashes that +.B opentracker +will not serve. +File format is straight forward: "\\n\\n..." +.B opentracker +should be compiled with blacklist support ( option +.I DWANT_ACCESSLIST_BLACK +) to make this statement work. +.IP access.stats +this statement specifies ip address allowed to fetch stats. +.B opentracker +should be compiled with restrict stats support ( option +.I WANT_RESTRICT_STATS +) to make this statement work. +.IP access.stats_path stats +this statement allows obfuscate the path to stats. +It is located at /stats by default, but you can configure it to appear anywhere on your tracker. +.IP access.proxy +this statement specifies proxy ip address. +.B opentracker +should be compiled with ip from proxy support ( option +.I DWANT_IP_FROM_PROXY +) to make this statement work. +Examples: 192.168.0.1, 10.0.0.5 +.IP livesync.cluster.listen +this statement specifies ip address and port for live sync. +The port is used to listen for incoming live sync packets. +The ip address specifies interface, on which +.B opentracker +will join the multicast group 244.0.42.23. +Note that two udp sockets will be opened. One on ip address 0.0.0.0 +port 9696, that will join the multicast group 224.0.42.23 for incoming +udp packets, and one on specified ip address port 9696 for outgoing udp packets. +Also note, that one and only one ip address must be given. +.B opentracker +should be compiled with live sync support ( option +.I WANT_SYNC_LIVE +) to make this statement work. +Examples: 192.168.0.1, 10.0.0.5 +.IP livesync.cluster.node_ip +sync between trackers running in a cluster is restricted to packets coming from trusted ip addresses, specified in this statement. +Examples: 192.168.0.1, 10.0.0.5 +.IP batchsync.cluster.admin_ip +this statement specifies admin ip address for old style (HTTP based) asynchronus tracker syncing. +Examples: 192.168.0.1, 10.0.0.5 +.IP tracker.rootdir +this statement specifies directory +.B opentracker +will chroot/chdir to. All black/white list files must be put in that directory. +.IP tracker.user +this statement specifies which user to setuid to. +.IP tracker.redirect_url +.B opentracker +can be told to answer to a "GET / HTTP"-request with a redirect to another location. This statement specifies such location in a form of url. +Examples: https://your.tracker.local/, http://10.0.0.5/ +.IP persist.mode +this statement turns on persistence of memory data. On persistence mode "dump" +.B opentracker +will save torrents and peers information on disk. Persistence mode "null" turns persistence off. +.B opentracker +should be compiled with persistence support ( option +.I DWANT_PERSISTENCE +) to make this statement work. +.IP persist.file +this statement specifies which persist file to use. +.B opentracker +will load data from this file on startup. +Examples: /var/lib/storage.odb, /etc/opentracker/db.odb, ./file.odb +.IP persist.save +this statement controls frequency sync of persistent storage. +.B opentracker +will save the memory data if both the given number of seconds and the given number of change operations occurred. Format: . +Examples: 900 1, 300 10, 60 10000 + +.SH NOTES +.B opentracker +currently supports only IPv4 with persistent storage. +.PP +If no listen option ( listen.tcp_udp, listen.tcp, listen.udp ) is given in +.IR config +or on the command line, opentracker listens on 0.0.0.0:6969 tcp and udp. +.PP +.B opentracker +doesn't provide blacklist and whitelist support simultaneously. + +.SH FILES +.B +/usr/bin/opentracker + +.SH AUTHOR +.B opentracker +was originally written by Dirk Engling . Some features added by FengGu . +.PP +This manual page was written by Vladimir Pavljuchenkov +for Gentoo Linux (and may be used by others) \ No newline at end of file diff --git a/net-p2p/opentracker/files/opentracker.conf.d b/net-p2p/opentracker/files/opentracker.conf.d new file mode 100644 index 0000000..16c9bf3 --- /dev/null +++ b/net-p2p/opentracker/files/opentracker.conf.d @@ -0,0 +1,3 @@ +# All settings are located in /etc/opentracker.conf for Gentoo. + +EXEC_PARAMS="-f /etc/opentracker.conf" diff --git a/net-p2p/opentracker/files/opentracker.init.d b/net-p2p/opentracker/files/opentracker.init.d new file mode 100644 index 0000000..91ca48c --- /dev/null +++ b/net-p2p/opentracker/files/opentracker.init.d @@ -0,0 +1,29 @@ +#!/sbin/runscript +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +BINFILE="/usr/bin/opentracker" +PIDFILE="/var/run/opentracker.pid" + +depend() { + use net +} + +start() { + ebegin "Starting Opentracker daemon" + start-stop-daemon \ + --background \ + --start --make-pidfile --pidfile "$PIDFILE" \ + --exec "$BINFILE" -- \ + ${EXEC_PARAMS} + eend $? +} + +stop() { + ebegin "Stopping Opentracker daemon" + start-stop-daemon \ + --stop --pidfile "$PIDFILE" \ + --exec "$BINFILE" + eend $? +} + diff --git a/net-p2p/opentracker/metadata-opentracker.xml b/net-p2p/opentracker/metadata-opentracker.xml new file mode 100644 index 0000000..9c4242c --- /dev/null +++ b/net-p2p/opentracker/metadata-opentracker.xml @@ -0,0 +1,18 @@ + + + +no-herd + + maintainer-wanted@gentoo.org + +opentracker is a open and free bittorrent tracker project. It aims for minimal resource usage and is intended to run at your wlan router. + + Make use of a torrents black-list + Make use of a torrents white-list + Deliver gzip compressed full scrapes + Restrict statistics to the tracker owner + Allow synchronisation between several instances + Log network traffic + Log to syslog + + diff --git a/net-p2p/opentracker/opentracker-9999.ebuild b/net-p2p/opentracker/opentracker-9999.ebuild new file mode 100644 index 0000000..11f7ef9 --- /dev/null +++ b/net-p2p/opentracker/opentracker-9999.ebuild @@ -0,0 +1,133 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="5" + +# reference: http://data.gpo.zugaina.org/bgo-overlay/net-p2p/opentracker/opentracker-9999.ebuild + +inherit eutils git-2 user + +EGIT_REPO_URI="https://github.com/flygoast/opentracker.git" + +DESCRIPTION="High-performance bittorrent tracker" +HOMEPAGE="https://github.com/flygoast/opentracker http://erdgeist.org/arts/software/opentracker/" +LICENSE="BEER-WARE" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +declare -A FLAGS +FLAGS=( [blacklist]="DWANT_ACCESSLIST_BLACK" + [gzip]="DWANT_COMPRESSION_GZIP$" + [gzip_always]="DWANT_COMPRESSION_GZIP_ALWAYS" + [ip_from_query]="DWANT_IP_FROM_QUERY_STRING" + [ip_from_proxy]="DWANT_IP_FROM_PROXY" + [ipv6]="DWANT_V6" + [fullscrapes]="DWANT_FULLSCRAPE" + [fullscrapes_modest]="DWANT_MODEST_FULLSCRAPES" + [live_sync]="DWANT_SYNC_LIVE" + [live_sync_unicast]="DSYNC_LIVE_UNICAST" + [log_networks_full]="DWANT_FULLLOG_NETWORKS" + [log_numwant]="DWANT_LOG_NUMWANT" + [persistence]="DWANT_PERSISTENCE" + [spot_woodpeckers]="DWANT_SPOT_WOODPECKER" + [syslog]="DWANT_SYSLOG" + [restrict_stats]="DWANT_RESTRICT_STATS" + [whitelist]="DWANT_ACCESSLIST_WHITE" +) + +IUSE="blacklist debug examples +gzip gzip_always ip_from_query ip_from_proxy ipv6 +fullscrapes fullscrapes_modest live_sync live_sync_unicast log_networks_full log_numwant persistence restrict_stats spot_woodpeckers syslog whitelist" + +RDEPEND=">=dev-libs/libowfat-0.27 + gzip? ( sys-libs/zlib )" + +REQUIRED_USE="blacklist? ( !whitelist ) + gzip_always? ( gzip ) + gzip? ( fullscrapes ) + live_sync_unicast? ( live_sync ) + persistence? ( !ipv6 ) +" + +pkg_setup() { + # Add opentracker group and user to system + # (no home directory specified, because otherwise it will be result in opentracker:root ownership on it) + enewgroup ${PN} + enewuser ${PN} -1 -1 -1 ${PN} +} + +src_prepare() { + # Fix use of FEATURES, so it's not mixed up with portage's FEATURES, and comment all of them + # Define PREFIX, BINDIR and path to libowfat; remove lpthread, lz and O3 flag, owfat target, stripping; create dirs on install + sed -i \ + -e "s|FEATURES|FEATURES_INTERNAL|g" \ + -e "s|^FEATURES_INTERNAL|#FEATURES_INTERNAL|g" \ + -e "s|PREFIX?=..|PREFIX?=/usr|g" \ + -e "s|LIBOWFAT_HEADERS=libowfat|LIBOWFAT_HEADERS=\$(PREFIX)/include/libowfat|g" \ + -e "s|-lpthread||g" \ + -e "s|-O3||g" \ + -e "s|-lz||g" \ + -e "s|strip \$@||g" \ + -e "s|BINDIR?=\$(PREFIX)/bin|BINDIR?=\$(DESTDIR)\$(PREFIX)/bin/|g" \ + -e "s|all: owfat|all:|g" \ + -e "s|install -m 755 ${PN} \$(BINDIR)|install -D -m 755 ${PN} \$(BINDIR)/${PN}|g" \ + Makefile || die "sed for src_prepare failed" + + # Define which features to use + for flag in ${!FLAGS[@]} ; do + sed -i "$(usex $flag /${FLAGS[$flag]}/s/^#*// '')" Makefile || die "sed for $flag failed" + done + + # Return back -lz flag for gzip + sed -i "$(usex gzip /LDFLAGS+/s/$/-lz/ '')" Makefile || die "sed for lz in LDFLAGS failed" + + # Debug build: build opentracker.debug but target as opentracker, and don't build opentracker + if use debug; then + sed -i \ + -e '/D_DEBUG_HTTPERROR/s|^#*||g' \ + -e 's|all: $(BINARY)|all:|g' \ + -e 's|$@ $(OBJECTS_debug)|opentracker $(OBJECTS_debug)|g' \ + Makefile || die "sed for debug object failed" + fi + + # Correct config paths + sed -i \ + -e "/access.whitelist/s|/path/to/whitelist|/var/lib/${PN}/access.whitelist|g" \ + -e "/access.blacklist/s|./blacklist|/var/lib/${PN}/access.blacklist|g" \ + -e "/tracker.rootdir/s|/usr/local/etc/opentracker|/var/lib/${PN}|g" \ + -e "/tracker.user/s|nobody|${PN}|g" \ + -e "/persist.file/s|/path/to/persist.odb|/var/lib/${PN}/${PN}.odb|g" \ + "${S}"/opentracker.conf.sample || die "sed for config failed" +} + +src_install() { + # Install and copy documentation + default + + # Keeping chroot directory + diropts -m 755 -o ${PN} -g ${PN} + keepdir /var/lib/${PN} + + # Install Gentoo init script and its config + newinitd "${FILESDIR}"/${PN}.init.d ${PN} + newconfd "${FILESDIR}"/${PN}.conf.d ${PN} + + # Install manual page + doman "${FILESDIR}"/${PN}.8 + + # Install config + insinto /etc/${PN} + newins "${S}"/${PN}.conf.sample ${PN}.conf + + if use examples ; then + # Install files into specified directory + insinto /usr/share/${PN} + doins -r "${S}"/tests/*.sh + doins "${S}"/sync_daemon.pl + + use persistence && doins "${S}"/ODB_FORMAT.md + fi + + # Correct user, group and permissions for files and directories + fowners -R ${PN}:${PN} /etc/${PN} + fperms 0640 /etc/${PN}/${PN}.conf +} diff --git a/repo.xml b/repo.xml new file mode 100644 index 0000000..7ec3d4f --- /dev/null +++ b/repo.xml @@ -0,0 +1,14 @@ + + + + + AlphaQuadrant + experimental ebuilds of misc packages which are not present in the portage tree + http://migmedia.de + + gentoo@migmedia.de + Micha Glave + + https://hg.migmedia.net/public/alpha-quadrant/ + +