1 |
# $MidnightBSD$ |
2 |
|
3 |
PORTNAME= transmission |
4 |
PORTVERSION= 2.84 |
5 |
PORTREVISION?= 3 |
6 |
CATEGORIES?= net-p2p |
7 |
#MASTER_SITES= http://download.m0k.org/${PORTNAME}/files/ |
8 |
MASTER_SITES= http://transmission.cachefly.net/ |
9 |
PKGNAMESUFFIX?= -cli |
10 |
|
11 |
MAINTAINER?= ports@MidnightBSD.org |
12 |
COMMENT?= Lightweight CLI (command line) BitTorrent client and utilities |
13 |
|
14 |
SLAVEPORT?= cli |
15 |
|
16 |
# Odd arrangement here-- cli is MIT, everything else is GPL |
17 |
.if ${SLAVEPORT} == cli |
18 |
LICENSE= mit |
19 |
.else |
20 |
LICENSE= gpl2 |
21 |
.endif |
22 |
LICENSE_FILE= ${WRKSRC}/COPYING |
23 |
|
24 |
USES+= cpe tar:xz |
25 |
CPE_VENDOR= transmissionbt |
26 |
|
27 |
CONFLICTS_INSTALL= ${PORTNAME}${PKGNAMESUFFIX}-2.5* |
28 |
|
29 |
OPTIONS_DEFINE= LITE DOCS |
30 |
EXTRACT_AFTER_ARGS=--no-same-owner --no-same-permissions --exclude third-party |
31 |
|
32 |
.include <bsd.mport.options.mk> |
33 |
|
34 |
.if ${SLAVEPORT} != web |
35 |
LIB_DEPENDS?= ${GEN_LIB_DEPENDS} |
36 |
|
37 |
# General dependencies |
38 |
GEN_LIB_DEPENDS=libcurl.so:${PORTSDIR}/ftp/curl \ |
39 |
libdht.so:${PORTSDIR}/devel/jech-dht \ |
40 |
libminiupnpc.so:${PORTSDIR}/net/miniupnpc \ |
41 |
libnatpmp.so:${PORTSDIR}/net/libnatpmp \ |
42 |
libutp.so:${PORTSDIR}/net/libutp \ |
43 |
libevent.so:${PORTSDIR}/devel/libevent |
44 |
GEN_RUN_DEPENDS=transmission-web>=2.84:${PORTSDIR}/www/transmission-web |
45 |
|
46 |
# This is master port of transmission-*, so don't override USES definition |
47 |
USES+= gmake iconv libtool pkgconfig ssl |
48 |
GNU_CONFIGURE= yes |
49 |
CPPFLAGS+= -I${LOCALBASE}/include -DWITH_UTP=1 |
50 |
LDFLAGS+= -L${LOCALBASE}/lib |
51 |
LIBS+= ${ICONV_LIB} |
52 |
CONFIGURE_ARGS=--with-zlib=/usr \ |
53 |
--without-inotify \ |
54 |
--disable-utp \ |
55 |
--enable-external-natpmp \ |
56 |
${EXTRA_CONF_ARGS} |
57 |
CONFIGURE_ENV= OPENSSL_CFLAGS="-I${OPENSSLINC}" \ |
58 |
OPENSSL_LIBS="-L${OPENSSLLIB} -lcrypto" \ |
59 |
DHT_CFLAGS=" " \ |
60 |
DHT_LIBS="-ldht" \ |
61 |
LIBUTP_CFLAGS=" " \ |
62 |
LIBUTP_LIBS="-lutp" \ |
63 |
LIBUTP_LIBS_QT="-lutp" |
64 |
|
65 |
EXTRA_CONF_ARGS?=--enable-cli \ |
66 |
--disable-daemon \ |
67 |
--without-gtk \ |
68 |
--disable-mac \ |
69 |
--disable-nls |
70 |
|
71 |
.if ${PORT_OPTIONS:MLITE} |
72 |
CONFIGURE_ARGS+=--enable-lightweight |
73 |
.endif |
74 |
|
75 |
EXTRA_PATCHES= ${PATCHDIR}/disable-web |
76 |
.endif |
77 |
|
78 |
USES+= tar:xz |
79 |
|
80 |
DOCS= AUTHORS NEWS README |
81 |
DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX} |
82 |
|
83 |
general-patch: |
84 |
@${FIND} ${WRKSRC} -name Makefile.in | ${XARGS} ${REINPLACE_CMD} -e \ |
85 |
's|noinst_PROGRAMS = |noinst_PROGRAMS = #|g' |
86 |
.if ${SLAVEPORT} != gtk |
87 |
@${REINPLACE_CMD} -e '/#define DISABLE_GETTEXT/s,/\* \(.*\) \*/,\1,' \ |
88 |
${WRKSRC}/libtransmission/utils.h |
89 |
.endif |
90 |
@${REINPLACE_CMD} -e \ |
91 |
's|rt_clock_gettime=yes|rt_clock_gettime=no|g ; \ |
92 |
s|" == "|" = "|g' \ |
93 |
${WRKSRC}/configure |
94 |
@${REINPLACE_CMD} -e 's|doc \\| \\|g' \ |
95 |
${WRKSRC}/Makefile.in |
96 |
.if ${SLAVEPORT} != cli |
97 |
@${REINPLACE_CMD} -e 's|utils \\|\\|g' \ |
98 |
${WRKSRC}/Makefile.in |
99 |
.endif |
100 |
# Don't conflict with patches but force system libraries |
101 |
@${REINPLACE_CMD} -e 's|third-party \\|\\|g' \ |
102 |
${WRKSRC}/Makefile.in |
103 |
@${REINPLACE_CMD} -Ee '/^DHT_(CFLAGS|LIBS)=/d' \ |
104 |
-e 's|third-party/[^ ]*Makefile||g' \ |
105 |
${WRKSRC}/configure |
106 |
@${REINPLACE_CMD} \ |
107 |
-e 's,TRANSMISSION_TOP}/third-party/dht/libdht.a,DHT_LIBS},' \ |
108 |
${WRKSRC}/qt/qtr.pro |
109 |
@${ECHO_CMD} 'DHT_LIBS = @DHT_LIBS@' >>${WRKSRC}/qt/config.pri.in |
110 |
|
111 |
post-patch: general-patch |
112 |
|
113 |
general-install: |
114 |
(cd ${WRKSRC} && ${COPYTREE_SHARE} \ |
115 |
"${DOCS}" ${STAGEDIR}${DOCSDIR}) |
116 |
|
117 |
post-install: general-install |
118 |
|
119 |
.include <bsd.port.mk> |