summaryrefslogtreecommitdiff
path: root/pcr/opentracker-git/PKGBUILD
blob: f5ef91aef7fd6cbe483ffa6d65cd1f84823a4eda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Maintainer (Arch): TheCreeper <loxoko@gmail.com>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname=opentracker-git
pkgver=r583.6c60309
pkgrel=1
pkgdesc="Opentracker is a open and free bittorrent tracker project. It aims for minimal resource usage and is intended to run at your wlan router."
arch=('i686' 'x86_64')
url="http://erdgeist.org/arts/software/opentracker/"
license=('custom')
depends=('libowfat')
makedepends=(
	'git'
	#'cvs'
	'make'
	'gcc'
	'gcc-libs'
	'dietlibc'
)
backup=("etc/opentracker/config")
source=(
	'opentracker.service'
	'license.txt'
	"$pkgname"::'git://erdgeist.org/opentracker')
sha1sums=(
	'f623a45a0722bdc007f1d4b303ff6e3913281953'
	'7cd200ee8ee89ddbd302dbbf63b6993bc51d4e3e'
	'SKIP')

pkgver() {
	cd "$srcdir/$pkgname"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {

	## BEWARE:
	## I had problems compiling this on arm using the new verson of GCC.

	####
	## Build Libowfat
	####

	## Pull in libowfat
	#msg "Pulling in libowfat"
	#cvs -d :pserver:cvs@cvs.fefe.de:/cvs -z9 co libowfat

	## Compile libowfat
	#msg "Compiling libowfat"
	#cd "$srcdir/libowfat"
	#make

	####
	## Build Opentracker
	####

	####
	## The following is a list of compile time options
	## Add them to the 'FEATURES' option of the make command below

	#DWANT_V6 > Compile in IPV6 only support.

	## Only one of the following accesslist options can be used.
	#DWANT_ACCESSLIST_BLACK > Compile in a blacklist of allowed torrents.
	#DWANT_ACCESSLIST_WHITE > Compile in a whitelist of allowed torrents.

	#FDWANT_SYNC_LIVE > Compile in support for running in clusters.
	#DWANT_IP_FROM_QUERY_STRING > Experimental or old feature. No idea what this does.
	#DWANT_COMPRESSION_GZIP > Compile in support for GZIP. This is used when downloading scrapes.
	#DWANT_COMPRESSION_GZIP_ALWAYS > Always compress scrapes using GZIP before serving them to clients.
	#DWANT_LOG_NETWORKS > Experimental or old feature. No idea what this does.
	#DWANT_RESTRICT_STATS > Compile in support for restricting tracker stats based on IP. Can be configured in the configuration file.
	#DWANT_IP_FROM_PROXY > Experimental or old feature. No idea what this does.
	#DWANT_FULLLOG_NETWORKS > Experimental or old feature. No idea what this does.
	#DWANT_LOG_NUMWANT > Experimental or old feature. No idea what this does.
	#DWANT_MODEST_FULLSCRAPES > Experimental or old feature. No idea what this does.
	#DWANT_SPOT_WOODPECKER > Experimental or old feature. No idea what this does.
	#DWANT_SYSLOGS > Experimental or old feature. No idea what this does.
	#DWANT_DEV_RANDOM > Experimental or old feature. No idea what this does.
	#DWANT_FULLSCRAPE > Compile in support for querying opentracker for all tracked torrents. Defualt. Change Makefile to compile out this support.

	#D_DEBUG_HTTPERROR > This should add in support for serving errors to clients when pages like 127.0.0.1:6969/random are accessed which are not used by opentracker.

	msg "Compiling Opentracker"
	cd "$srcdir/opentracker-git/"

	make 	LIBOWFAT_HEADERS="/usr/include" \
		LIBOWFAT_LIBRARY="/usr/lib" \
		#LIBOWFAT_HEADERS="../libowfat" \
		#LIBOWFAT_LIBRARY="../libowfat" \
		FEATURES="-DWANT_SYSLOGS -DDEBUG_HTTPERROR" \
		CC="/opt/diet/bin/diet gcc"
}

package() {

	msg "Preparing the package"

	cd "$srcdir/"

	install -d $pkgdir/usr/bin/
	install -m 755 opentracker-git/opentracker $pkgdir/usr/bin/

	install -d $pkgdir/usr/lib/systemd/system
	install -m 755 opentracker.service $pkgdir/usr/lib/systemd/system/

	install -d $pkgdir/etc/opentracker
	install -m 644 opentracker-git/opentracker.conf.sample $pkgdir/etc/opentracker/config

	install -d $pkgdir/usr/share/doc/opentracker/
	install -m 644 opentracker-git/opentracker.conf.sample $pkgdir/usr/share/doc/opentracker/config

	install -d $pkgdir/usr/share/licenses/opentracker/
	install -m 644 license.txt $pkgdir/usr/share/licenses/opentracker/

	msg "Finished"
}