aboutsummaryrefslogtreecommitdiffstats
path: root/net/opentracker/Makefile
blob: 388395e9bf8ad80306eefff854f4f5f46474f90b (plain) (blame)
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
# $FreeBSD$

PORTNAME=   opentracker
PORTVERSION=    0.2010.05.30
PORTREVISION=   1
CATEGORIES= net
MASTER_SITES=   http://www.bayofrum.net/dist/${PORTNAME}/ \
        https://www.glenbarber.us/ports/net/${PORTNAME}/

MAINTAINER= crees@FreeBSD.org
COMMENT=    Free lightweight bittorrent tracker using libowfat

BUILD_DEPENDS=  ${LOCALBASE}/lib/libowfat.a:${PORTSDIR}/devel/libowfat

USES=   tar:bzip2
USE_RC_SUBR=    ${PORTNAME}

OPTIONS_DEFINE= COMPRESSION_GZIP DEBUG_HTTPERROR FULLSCRAPE RESTRICT_STATS IPV6
OPTIONS_SINGLE= accesslist
OPTIONS_SINGLE_accesslist=  ACCESSLIST_OPEN ACCESSLIST_BLACK \
                ACCESSLIST_WHITE

OPTIONS_DEFAULT=    FULLSCRAPE RESTRICT_STATS ACCESSLIST_OPEN

ACCESSLIST_OPEN_DESC=   Disable black/whitelisting
ACCESSLIST_BLACK_DESC=  Enable client blacklisting
ACCESSLIST_WHITE_DESC=  Enable client whitelisting
COMPRESSION_GZIP_DESC=  Deliver gzip compressed full scrapes
DEBUG_HTTPERROR_DESC=   Verbose HTTPERRORs
FULLSCRAPE_DESC=    Can query tracker for all torrents
RESTRICT_STATS_DESC=    Limit stats access based on IP

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MACCESSLIST_BLACK}
FEATURES+=-DWANT_ACCESSLIST_BLACK
.elif ${PORT_OPTIONS:MACCESSLIST_WHITE}
FEATURES+=-DWANT_ACCESSLIST_WHITE
.endif

.if ${PORT_OPTIONS:MCOMPRESSION_GZIP}
FEATURES+=-DWANT_COMPRESSION_GZIP
.endif

.if ${PORT_OPTIONS:MDEBUG_HTTPERROR}
FEATURES+=-D_DEBUG_HTTPERROR
.endif

.if ${PORT_OPTIONS:MFULLSCRAPE}
FEATURES+=-DWANT_FULLSCRAPE
.endif

.if ${PORT_OPTIONS:MIPV6}
FEATURES+=-DWANT_V6
.endif

.if ${PORT_OPTIONS:MRESTRICT_STATS}
FEATURES+=-DWANT_RESTRICT_STATS
.endif

MAKE_ENV+=FEATURES="${FEATURES}"

post-patch:
    @${FIND} ${WRKSRC} -name "*.orig" -delete

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
    ${MKDIR} ${STAGEDIR}${ETCDIR}
    ${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf.sample \
        ${STAGEDIR}${ETCDIR}/${PORTNAME}.conf.sample

.include <bsd.port.mk>