Gentoo Archives: gentoo-commits

From: Jory Pratt <anarchy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/anarchy:master commit in: net-p2p/transmission/, net-p2p/transmission/files/
Date: Mon, 31 Oct 2011 14:44:55
Message-Id: 34a7328ba54d1ab0619a1383308cab7f9c769fdc.anarchy@gentoo
1 commit: 34a7328ba54d1ab0619a1383308cab7f9c769fdc
2 Author: Jory A. Pratt <anarchy <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 31 14:44:29 2011 +0000
4 Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 31 14:44:29 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/anarchy.git;a=commit;h=34a7328b
7
8 workaround broken transmission in portage
9
10 ---
11 net-p2p/transmission/Manifest | 8 +
12 .../transmission-2.33-0001-configure.ac.patch | 47 ++++
13 ...transmission-2.33-0002-config.in-4-qt.pro.patch | 72 +++++
14 .../transmission-2.41-0003-system-miniupnpc.patch | 281 ++++++++++++++++++++
15 .../files/transmission-2.41-no_utp.patch | 15 +
16 .../transmission/files/transmission-daemon.confd.3 | 14 +
17 .../transmission/files/transmission-daemon.initd.8 | 73 +++++
18 net-p2p/transmission/transmission-2.41.ebuild | 154 +++++++++++
19 8 files changed, 664 insertions(+), 0 deletions(-)
20
21 diff --git a/net-p2p/transmission/Manifest b/net-p2p/transmission/Manifest
22 new file mode 100644
23 index 0000000..f9a4f11
24 --- /dev/null
25 +++ b/net-p2p/transmission/Manifest
26 @@ -0,0 +1,8 @@
27 +AUX transmission-2.33-0001-configure.ac.patch 1513 RMD160 c55d306b5657a07e71c88e703d4be86c47606bdf SHA1 e2c230117fb57ecddebb3798402cd1b36e45776c SHA256 aa269bb7ab69754a29399062b8abdab915a7172fa99a0747360584bcc9afaa25
28 +AUX transmission-2.33-0002-config.in-4-qt.pro.patch 2434 RMD160 eff545e8416f2bb92035717a35121ecaa0ba089f SHA1 e4470173150fe2b84583e295842e9ad13063ca75 SHA256 41d289f1701606eb337375ddcbc69f9c6b7e3e82d7212d8c3e4ecb4d034f7c46
29 +AUX transmission-2.41-0003-system-miniupnpc.patch 9639 RMD160 e23714576aa12d6a79ca8ca64793f549cc4d6534 SHA1 1d21efda014426ff4c34a30a7beadf7c730496c2 SHA256 9949347aa2dec92ef73b3dfc00d49618572b397e66d8415cca15933cce2f63f0
30 +AUX transmission-2.41-no_utp.patch 323 RMD160 120286fa0b4a9ba3cbcc5577fd2c7fe932c41b32 SHA1 b07ae38137bbb54c814b85232f9e07c53e6539f2 SHA256 0665f97fe4bd9e627252d5eed3bfc937747b80813a1579a93fc0f8b17fac0535
31 +AUX transmission-daemon.confd.3 703 RMD160 482953d2bd8e9c69300af3389615764649954a63 SHA1 a4d16dde4e2408b48620cc89c4a8759b042797f2 SHA256 4b47acf195a14a322550cfcaa735a59aac38410d1c2c63ffa824ff131c55ca70
32 +AUX transmission-daemon.initd.8 2235 RMD160 2848770ae93c597ea5cd6e8d22857bb99578b9e5 SHA1 683a27b11c84033de6efa831c6dabd1c487feb33 SHA256 370ec8a257a5bea28f9bb9d607e76676db94159def8be83932c7bda473f59012
33 +DIST transmission-2.41.tar.xz 2623344 RMD160 a2c9c80cff444978dff305d573007473af5b3084 SHA1 dd9531587778dc46757b1520accacf6afa20c370 SHA256 f31bf798f620b436b2f5ed7047fa27fab78ce4b229d6d02f8c71f9867277685a
34 +EBUILD transmission-2.41.ebuild 3967 RMD160 d20d576c39dd48f16dba5ba78e77a801a67e60d5 SHA1 20b54d89b37984bde1c80ba98b4ae045709de25a SHA256 51977af40712d968c983f15eebdeaceb251512e2136dd4500fbeaf94f293679b
35
36 diff --git a/net-p2p/transmission/files/transmission-2.33-0001-configure.ac.patch b/net-p2p/transmission/files/transmission-2.33-0001-configure.ac.patch
37 new file mode 100644
38 index 0000000..75e6594
39 --- /dev/null
40 +++ b/net-p2p/transmission/files/transmission-2.33-0001-configure.ac.patch
41 @@ -0,0 +1,47 @@
42 +From fc34254a20735efaeb903365e0960d4a009463b3 Mon Sep 17 00:00:00 2001
43 +From: Peter Volkov <pva@g.o>
44 +Date: Thu, 16 Jun 2011 12:46:48 +0400
45 +Subject: [PATCH 1/3] configure.ac: Drop redudant code/indentation.
46 +
47 +---
48 + configure.ac | 16 ++++------------
49 + 1 files changed, 4 insertions(+), 12 deletions(-)
50 +
51 +diff --git a/configure.ac b/configure.ac
52 +index 7dcbcf0..421946f 100644
53 +--- a/configure.ac
54 ++++ b/configure.ac
55 +@@ -214,26 +214,18 @@ AC_CHECK_LIB([rt],
56 +
57 + AC_MSG_CHECKING([µTP])
58 + build_utp="no"
59 +-if test "x$CXX" = "x" ; then
60 +- have_utp="no"
61 +-else
62 +- have_utp="yes"
63 +-fi
64 + AC_ARG_ENABLE([utp],
65 + AS_HELP_STRING([--enable-utp],[build µTP support]),
66 + [want_utp=${enableval}],
67 +- [want_utp=${have_utp}])
68 ++ [want_utp="yes"])
69 + if test "x$want_utp" = "xyes" ; then
70 +- if test "x$have_utp" = "xyes"; then
71 ++ if test "x$CXX" != "x" ; then
72 + LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"
73 +- LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a"
74 +- if test "x$libutp_extra_libs" != "x" ; then
75 +- LIBUTP_LIBS="$LIBUTP_LIBS $libutp_extra_libs"
76 +- fi
77 ++ LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a $libutp_extra_libs"
78 + AC_DEFINE([WITH_UTP],[1])
79 + build_utp="yes"
80 + else
81 +- AC_MSG_ERROR("Unable to build uTP support -- C++ compiler not found")
82 ++ AC_MSG_ERROR("Unable to build uTP support -- C++ compiler not found; consider --disable-utp")
83 + fi
84 + fi
85 + AC_SUBST(LIBUTP_CFLAGS)
86 +--
87 +1.7.3.4
88 +
89
90 diff --git a/net-p2p/transmission/files/transmission-2.33-0002-config.in-4-qt.pro.patch b/net-p2p/transmission/files/transmission-2.33-0002-config.in-4-qt.pro.patch
91 new file mode 100644
92 index 0000000..1060795
93 --- /dev/null
94 +++ b/net-p2p/transmission/files/transmission-2.33-0002-config.in-4-qt.pro.patch
95 @@ -0,0 +1,72 @@
96 +From 9b55e6ce1a98b4c2f32349982d4172d0971601c6 Mon Sep 17 00:00:00 2001
97 +From: Peter Volkov <pva@g.o>
98 +Date: Thu, 16 Jun 2011 12:48:11 +0400
99 +Subject: [PATCH 2/3] Add qt/config to make qmake aware about ./configure results. This simplifies use of system third-party tools. Fixes build issue caused by ordering of make/qmake run: bugs.gentoo.org/368523.
100 +
101 +---
102 + configure.ac | 5 ++++-
103 + qt/config.in | 1 +
104 + qt/qtr.pro | 6 +++---
105 + 3 files changed, 8 insertions(+), 4 deletions(-)
106 + create mode 100644 qt/config.in
107 +
108 +diff --git a/configure.ac b/configure.ac
109 +index 421946f..bf0622b 100644
110 +--- a/configure.ac
111 ++++ b/configure.ac
112 +@@ -222,6 +222,7 @@ if test "x$want_utp" = "xyes" ; then
113 + if test "x$CXX" != "x" ; then
114 + LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"
115 + LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a $libutp_extra_libs"
116 ++ LIBUTP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/libutp/libutp.a $libutp_extra_libs"
117 + AC_DEFINE([WITH_UTP],[1])
118 + build_utp="yes"
119 + else
120 +@@ -230,6 +231,7 @@ if test "x$want_utp" = "xyes" ; then
121 + fi
122 + AC_SUBST(LIBUTP_CFLAGS)
123 + AC_SUBST(LIBUTP_LIBS)
124 ++AC_SUBST(LIBUTP_LIBS_QT)
125 + AM_CONDITIONAL([BUILD_UTP],[test "x$build_utp" = "xyes"])
126 + AC_MSG_RESULT([$build_utp])
127 +
128 +@@ -484,7 +486,8 @@ AC_CONFIG_FILES([Makefile
129 + web/javascript/Makefile
130 + web/javascript/jquery/Makefile
131 + web/stylesheets/Makefile
132 +- po/Makefile.in])
133 ++ po/Makefile.in
134 ++ qt/config])
135 +
136 + AC_OUTPUT
137 +
138 +diff --git a/qt/config.in b/qt/config.in
139 +new file mode 100644
140 +index 0000000..3340d1a
141 +--- /dev/null
142 ++++ b/qt/config.in
143 +@@ -0,0 +1 @@
144 ++LIBUTP_LIBS = @LIBUTP_LIBS_QT@
145 +diff --git a/qt/qtr.pro b/qt/qtr.pro
146 +index ce138a2..4e28e98 100644
147 +--- a/qt/qtr.pro
148 ++++ b/qt/qtr.pro
149 +@@ -16,12 +16,12 @@ QT += network
150 + PKGCONFIG = fontconfig libcurl openssl libevent
151 +
152 + TRANSMISSION_TOP = ..
153 ++include(config)
154 ++
155 + INCLUDEPATH = $${EVENT_TOP}/include $${INCLUDEPATH}
156 + INCLUDEPATH += $${TRANSMISSION_TOP}
157 + LIBS += $${TRANSMISSION_TOP}/libtransmission/libtransmission.a
158 +-exists( $${TRANSMISSION_TOP}/third-party/libutp/libutp.a ) {
159 +- LIBS += $${TRANSMISSION_TOP}/third-party/libutp/libutp.a
160 +-}
161 ++LIBS += $${LIBUTP_LIBS}
162 + LIBS += $${TRANSMISSION_TOP}/third-party/dht/libdht.a
163 + LIBS += $${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a
164 + LIBS += $${TRANSMISSION_TOP}/third-party/libnatpmp/libnatpmp.a
165 +--
166 +1.7.3.4
167 +
168
169 diff --git a/net-p2p/transmission/files/transmission-2.41-0003-system-miniupnpc.patch b/net-p2p/transmission/files/transmission-2.41-0003-system-miniupnpc.patch
170 new file mode 100644
171 index 0000000..e4b6271
172 --- /dev/null
173 +++ b/net-p2p/transmission/files/transmission-2.41-0003-system-miniupnpc.patch
174 @@ -0,0 +1,281 @@
175 +=== modified file 'cli/Makefile.am'
176 +--- cli/Makefile.am 2011-10-19 10:26:45 +0000
177 ++++ cli/Makefile.am 2011-10-19 10:37:21 +0000
178 +@@ -18,8 +18,8 @@
179 +
180 + transmission_cli_LDADD = \
181 + $(top_builddir)/libtransmission/libtransmission.a \
182 ++ @LIBUPNP_LIBS@ \
183 + $(top_builddir)/third-party/libnatpmp/libnatpmp.a \
184 +- $(top_builddir)/third-party/miniupnp/libminiupnp.a \
185 + @DHT_LIBS@ \
186 + @LIBUTP_LIBS@ \
187 + @LIBEVENT_LIBS@ \
188 +
189 +=== modified file 'configure.ac'
190 +--- configure.ac 2011-10-19 10:36:21 +0000
191 ++++ configure.ac 2011-10-19 10:37:21 +0000
192 +@@ -229,6 +229,77 @@
193 +
194 + dnl ----------------------------------------------------------------------------
195 + dnl
196 ++dnl Allow usage of system miniupnp library
197 ++LIBUPNP_CFLAGS="-I\$(top_srcdir)/third-party/"
198 ++LIBUPNP_LIBS="\$(top_builddir)/third-party/miniupnp/libminiupnp.a"
199 ++LIBUPNP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a"
200 ++build_bundled_miniupnp="yes"
201 ++AC_ARG_ENABLE([external-miniupnp],
202 ++ AS_HELP_STRING([--enable-external-miniupnp],[Use system external-miniupnp]),
203 ++ [want_external_miniupnp=${enableval}],
204 ++ [want_external_miniupnp=no])
205 ++if test "x$want_external_miniupnp" != "xno" ; then
206 ++ AC_DEFINE([SYSTEM_MINIUPNP])
207 ++ ac_save_LIBS="$LIBS"
208 ++ LIBS="-lminiupnpc"
209 ++ # Check miniupnp 1.5
210 ++ AC_TRY_LINK([
211 ++ #include <stdlib.h>
212 ++ #include <miniupnpc/miniupnpc.h>
213 ++ #include <miniupnpc/upnpcommands.h>
214 ++ ],[
215 ++ struct UPNPDev * devlist;
216 ++ struct UPNPUrls urls;
217 ++ struct IGDdatas data;
218 ++ char lanaddr[16];
219 ++ char portStr[8];
220 ++ char intPort[8];
221 ++ char intClient[16];
222 ++ upnpDiscover( 2000, NULL, NULL, 0 );
223 ++ UPNP_GetValidIGD( devlist, &urls, &data, lanaddr, sizeof( lanaddr ) );
224 ++ UPNP_GetSpecificPortMappingEntry( urls.controlURL, data.first.servicetype,
225 ++ portStr, "TCP", intClient, intPort );
226 ++ ],[
227 ++ AC_DEFINE(HAVE_MINIUPNP_15, 1, [Define to 1 if you have miniupnpc version 1.5])
228 ++ build_bundled_miniupnp="no"])
229 ++
230 ++ # Check miniupnp 1.6
231 ++ AC_TRY_LINK([
232 ++ #include <stdlib.h>
233 ++ #include <errno.h>
234 ++ #include <miniupnpc/miniupnpc.h>
235 ++ #include <miniupnpc/upnpcommands.h>
236 ++ ],[
237 ++ struct UPNPDev * devlist;
238 ++ struct UPNPUrls urls;
239 ++ struct IGDdatas data;
240 ++ char lanaddr[16];
241 ++ char portStr[8];
242 ++ char intPort[8];
243 ++ char intClient[16];
244 ++ upnpDiscover( 2000, NULL, NULL, 0, 0, &errno );
245 ++ UPNP_GetValidIGD( devlist, &urls, &data, lanaddr, sizeof( lanaddr ) );
246 ++ UPNP_GetSpecificPortMappingEntry( urls.controlURL, data.first.servicetype,
247 ++ portStr, "TCP", intClient, intPort, NULL, NULL, NULL );
248 ++ ],[
249 ++ AC_DEFINE(HAVE_MINIUPNP_16, 1, [Define to 1 if you have miniupnpc version 1.6])
250 ++ build_bundled_miniupnp="no"])
251 ++
252 ++ if test "x$build_bundled_miniupnp" = "xno" ; then
253 ++ LIBUPNP_CFLAGS=""
254 ++ LIBUPNP_LIBS="-lminiupnpc"
255 ++ LIBUPNP_LIBS_QT="-lminiupnpc"
256 ++ else
257 ++ AC_MSG_ERROR("Requested system libminiupnp but it is not found")
258 ++ fi
259 ++ LIBS="$ac_save_LIBS"
260 ++fi
261 ++AM_CONDITIONAL([BUILD_MINIUPNP],[test "x$build_bundled_miniupnp" = "xyes"])
262 ++AC_SUBST(LIBUPNP_CFLAGS)
263 ++AC_SUBST(LIBUPNP_LIBS)
264 ++AC_SUBST(LIBUPNP_LIBS_QT)
265 ++dnl ----------------------------------------------------------------------------
266 ++dnl
267 + dnl detection for the GTK+ client
268 +
269 + PKG_CHECK_MODULES(GTK,
270 +@@ -401,7 +472,7 @@
271 + libtransmission/Makefile
272 + utils/Makefile
273 + third-party/Makefile
274 +- third-party/miniupnp/Makefile
275 ++ third-party/miniupnp/Makefile
276 + third-party/libnatpmp/Makefile
277 + third-party/libutp/Makefile
278 + third-party/dht/Makefile
279 +
280 +=== modified file 'daemon/Makefile.am'
281 +--- daemon/Makefile.am 2011-10-19 10:26:45 +0000
282 ++++ daemon/Makefile.am 2011-10-19 10:37:21 +0000
283 +@@ -20,7 +20,7 @@
284 +
285 + LDADD = \
286 + $(top_builddir)/libtransmission/libtransmission.a \
287 +- $(top_builddir)/third-party/miniupnp/libminiupnp.a \
288 ++ @LIBUPNP_LIBS@ \
289 + $(top_builddir)/third-party/libnatpmp/libnatpmp.a \
290 + @DHT_LIBS@ \
291 + @LIBUTP_LIBS@ \
292 +
293 +=== modified file 'gtk/Makefile.am'
294 +--- gtk/Makefile.am 2011-10-19 10:26:45 +0000
295 ++++ gtk/Makefile.am 2011-10-19 10:37:21 +0000
296 +@@ -84,7 +84,7 @@
297 +
298 + transmission_gtk_LDADD = \
299 + $(top_builddir)/libtransmission/libtransmission.a \
300 +- $(top_builddir)/third-party/miniupnp/libminiupnp.a \
301 ++ @LIBUPNP_LIBS@ \
302 + $(top_builddir)/third-party/libnatpmp/libnatpmp.a \
303 + @DHT_LIBS@ \
304 + @LIBUTP_LIBS@ \
305 +
306 +=== modified file 'libtransmission/Makefile.am'
307 +--- libtransmission/Makefile.am 2011-10-19 10:26:45 +0000
308 ++++ libtransmission/Makefile.am 2011-10-19 10:37:21 +0000
309 +@@ -8,6 +8,7 @@
310 + AM_CFLAGS = \
311 + @DHT_CFLAGS@ \
312 + @LIBUTP_CFLAGS@ \
313 ++ @LIBUPNP_CFLAGS@ \
314 + @LIBEVENT_CFLAGS@ \
315 + @LIBCURL_CFLAGS@ \
316 + @OPENSSL_CFLAGS@ \
317 +@@ -139,7 +140,7 @@
318 +
319 + apps_ldadd = \
320 + ./libtransmission.a \
321 +- $(top_builddir)/third-party/miniupnp/libminiupnp.a \
322 ++ @LIBUPNP_LIBS@ \
323 + $(top_builddir)/third-party/libnatpmp/libnatpmp.a \
324 + @INTLLIBS@ \
325 + @DHT_LIBS@ \
326 +
327 +=== modified file 'libtransmission/upnp.c'
328 +--- libtransmission/upnp.c 2011-10-19 10:26:45 +0000
329 ++++ libtransmission/upnp.c 2011-10-19 10:37:21 +0000
330 +@@ -13,8 +13,13 @@
331 + #include <assert.h>
332 + #include <errno.h>
333 +
334 ++#ifdef SYSTEM_MINIUPNP
335 ++#include <miniupnpc/miniupnpc.h>
336 ++#include <miniupnpc/upnpcommands.h>
337 ++#else
338 + #include <miniupnp/miniupnpc.h>
339 + #include <miniupnp/upnpcommands.h>
340 ++#endif
341 +
342 + #include "transmission.h"
343 + #include "port-forwarding.h"
344 +@@ -97,7 +102,12 @@
345 + {
346 + struct UPNPDev * devlist;
347 + errno = 0;
348 +- devlist = upnpDiscover( 2000, NULL, NULL, 0, 0, &errno );
349 ++#ifdef HAVE_MINIUPNP_16
350 ++ devlist = upnpDiscover( 2000, NULL, NULL, 0, 0, &errno );
351 ++#else
352 ++ devlist = upnpDiscover( 2000, NULL, NULL, 0 );
353 ++#endif
354 ++
355 + if( devlist == NULL )
356 + {
357 + tr_ndbg(
358 +@@ -144,9 +154,17 @@
359 +
360 + tr_snprintf( portStr, sizeof( portStr ), "%d", handle->port );
361 + if( UPNP_GetSpecificPortMappingEntry( handle->urls.controlURL, handle->data.first.servicetype,
362 +- portStr, "TCP", intClient, intPort, NULL, NULL, NULL ) != UPNPCOMMAND_SUCCESS ||
363 ++#ifdef HAVE_MINIUPNP_16
364 ++ portStr, "TCP", intClient, intPort, NULL, NULL, NULL ) != UPNPCOMMAND_SUCCESS ||
365 ++#else
366 ++ portStr, "TCP", intClient, intPort ) != UPNPCOMMAND_SUCCESS ||
367 ++#endif
368 + UPNP_GetSpecificPortMappingEntry( handle->urls.controlURL, handle->data.first.servicetype,
369 ++#ifdef HAVE_MINIUPNP_16
370 + portStr, "UDP", intClient, intPort, NULL, NULL, NULL ) != UPNPCOMMAND_SUCCESS )
371 ++#else
372 ++ portStr, "UDP", intClient, intPort ) != UPNPCOMMAND_SUCCESS )
373 ++#endif
374 + {
375 + tr_ninf( getKey( ), _( "Port %d isn't forwarded" ), handle->port );
376 + handle->isMapped = false;
377 +@@ -198,7 +216,11 @@
378 + err_tcp = UPNP_AddPortMapping( handle->urls.controlURL,
379 + handle->data.first.servicetype,
380 + portStr, portStr, handle->lanaddr,
381 ++#ifdef HAVE_MINIUPNP_16
382 + desc, "TCP", NULL, NULL );
383 ++#else
384 ++ desc, "TCP", NULL );
385 ++#endif
386 + if( err_tcp )
387 + tr_ndbg( getKey( ), "TCP Port forwarding failed with error %d (errno %d - %s)",
388 + err_tcp, errno, tr_strerror( errno ) );
389 +@@ -207,7 +229,11 @@
390 + err_udp = UPNP_AddPortMapping( handle->urls.controlURL,
391 + handle->data.first.servicetype,
392 + portStr, portStr, handle->lanaddr,
393 ++#ifdef HAVE_MINIUPNP_16
394 + desc, "UDP", NULL, NULL );
395 ++#else
396 ++ desc, "UDP", NULL );
397 ++#endif
398 + if( err_udp )
399 + tr_ndbg( getKey( ), "UDP Port forwarding failed with error %d (errno %d - %s)",
400 + err_udp, errno, tr_strerror( errno ) );
401 +
402 +=== modified file 'qt/config.in'
403 +--- qt/config.in 2011-10-19 10:36:21 +0000
404 ++++ qt/config.in 2011-10-19 10:37:01 +0000
405 +@@ -1,1 +1,3 @@
406 + LIBUTP_LIBS = @LIBUTP_LIBS_QT@
407 ++MINIUPNP_LIBS = @LIBUPNP_LIBS_QT@
408 ++
409 +
410 +=== modified file 'qt/qtr.pro'
411 +--- qt/qtr.pro 2011-10-19 10:36:21 +0000
412 ++++ qt/qtr.pro 2011-10-19 10:37:26 +0000
413 +@@ -23,7 +23,7 @@
414 + LIBS += $${TRANSMISSION_TOP}/libtransmission/libtransmission.a
415 + LIBS += $${LIBUTP_LIBS}
416 + LIBS += $${TRANSMISSION_TOP}/third-party/dht/libdht.a
417 +-LIBS += $${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a
418 ++LIBS += $${MINIUPNP_LIBS}
419 + LIBS += $${TRANSMISSION_TOP}/third-party/libnatpmp/libnatpmp.a
420 + unix: LIBS += -L$${EVENT_TOP}/lib -lz -lrt
421 + win32:DEFINES += QT_DBUS
422 +
423 +=== modified file 'third-party/Makefile.am'
424 +--- third-party/Makefile.am 2011-10-19 10:26:45 +0000
425 ++++ third-party/Makefile.am 2011-10-19 10:37:26 +0000
426 +@@ -1,11 +1,14 @@
427 + if BUILD_UTP
428 + UTP_DIR = libutp
429 + endif
430 ++if BUILD_MINIUPNP
431 ++ MINIUPNP_DIR = miniupnp
432 ++endif
433 +
434 + SUBDIRS = \
435 + dht \
436 + libnatpmp \
437 +- miniupnp \
438 ++ $(MINIUPNP_DIR) \
439 + $(UTP_DIR)
440 +
441 + EXTRA_DIST = \
442 +
443 +=== modified file 'utils/Makefile.am'
444 +--- utils/Makefile.am 2011-10-19 10:26:45 +0000
445 ++++ utils/Makefile.am 2011-10-19 10:37:26 +0000
446 +@@ -26,7 +26,7 @@
447 +
448 + transmission_create_LDADD = \
449 + $(top_builddir)/libtransmission/libtransmission.a \
450 +- $(top_builddir)/third-party/miniupnp/libminiupnp.a \
451 ++ @LIBUPNP_LIBS@ \
452 + $(top_builddir)/third-party/libnatpmp/libnatpmp.a \
453 + @INTLLIBS@ \
454 + @DHT_LIBS@ \
455 +
456
457 diff --git a/net-p2p/transmission/files/transmission-2.41-no_utp.patch b/net-p2p/transmission/files/transmission-2.41-no_utp.patch
458 new file mode 100644
459 index 0000000..afe93fd
460 --- /dev/null
461 +++ b/net-p2p/transmission/files/transmission-2.41-no_utp.patch
462 @@ -0,0 +1,15 @@
463 +--- a/third-party/libutp/utypes.h Wed Sep 28 19:46:15 2011
464 ++++ b/third-party/libutp/utypes.h Wed Sep 28 19:47:06 2011
465 +@@ -36,7 +36,11 @@ typedef const char * cstr;
466 + typedef char * str;
467 +
468 + #ifndef __cplusplus
469 ++#ifdef HAVE_STDBOOL_H
470 ++#include <stdbool.h>
471 ++#else
472 + typedef uint8 bool;
473 ++#endif
474 + #endif
475 +
476 + #endif //__UTYPES_H__
477 +
478
479 diff --git a/net-p2p/transmission/files/transmission-daemon.confd.3 b/net-p2p/transmission/files/transmission-daemon.confd.3
480 new file mode 100644
481 index 0000000..fcf37c7
482 --- /dev/null
483 +++ b/net-p2p/transmission/files/transmission-daemon.confd.3
484 @@ -0,0 +1,14 @@
485 +# This is the transmission-daemon configuration file. For other options and
486 +# better explanation, take a look at transmission-daemon manual page Note: it's
487 +# better to configure some settings (like username/password) in
488 +# /var/transmission/config/settings.json to avoid other users see it with `ps`
489 +
490 +TRANSMISSION_OPTIONS="--encryption-preferred"
491 +
492 +# Run daemon as another user (username or username:groupname)
493 +# If you change this setting, chown -R /var/transmission/config <and download directory, check web settings>
494 +#runas_user=transmission
495 +
496 +# Location of logfile (should be writeable for runas_user user)
497 +# Set logfile=syslog to use syslog for logging
498 +#logfile=/var/log/transmission/transmission.log
499
500 diff --git a/net-p2p/transmission/files/transmission-daemon.initd.8 b/net-p2p/transmission/files/transmission-daemon.initd.8
501 new file mode 100644
502 index 0000000..1641cce
503 --- /dev/null
504 +++ b/net-p2p/transmission/files/transmission-daemon.initd.8
505 @@ -0,0 +1,73 @@
506 +#!/sbin/runscript
507 +# Copyright 1999-2011 Gentoo Foundation
508 +# Distributed under the terms of the GNU General Public License v2
509 +# $Header: /var/cvsroot/gentoo-x86/net-p2p/transmission/files/transmission-daemon.initd.8,v 1.1 2011/06/16 09:13:27 pva Exp $
510 +
511 +opts="start stop reload"
512 +description="Transmission is a fast, easy and free bittorrent client"
513 +description_start="Start transmission-daemon server and web interface"
514 +description_stop="Stop transmission-daemon server and web interface"
515 +description_reload="Reload transmission-daemon settings"
516 +
517 +rundir=${rundir:-/var/run/transmission}
518 +pidfile=${pidfile:-${rundir}/transmission.pid}
519 +config_dir=${config_dir:-/var/transmission/config}
520 +download_dir=${download_dir:-/var/transmission/downloads}
521 +logfile=${logfile:-/var/log/transmission/transmission.log}
522 +runas_user=${runas_user:-transmission:transmission}
523 +
524 +SSD_OPTIONS=""
525 +
526 +depend() {
527 + need net
528 +}
529 +
530 +check_config() {
531 + if [ ! -d "${rundir}" ]; then
532 + mkdir "${rundir}"
533 + if [ -n "${runas_user}" ]; then
534 + chown -R ${runas_user} "${rundir}"
535 + fi
536 + fi
537 +
538 + # In case no config directory option passed use default
539 + if ! $(echo ${TRANSMISSION_OPTIONS} | grep -q -e '\B-g' -e '\B--config-dir'); then
540 + TRANSMISSION_OPTIONS="${TRANSMISSION_OPTIONS} --config-dir ${config_dir}"
541 + # put download dir location on first run (and take it from config later)
542 + if [ ! -f ${config_dir}/settings.json ]; then
543 + TRANSMISSION_OPTIONS="${TRANSMISSION_OPTIONS} --download-dir ${download_dir}"
544 + fi
545 + fi
546 +
547 + if [ -n "${runas_user}" ]; then
548 + if [ -f /etc/init.d/sysfs ]; then
549 + SSD_OPTIONS="${SSD_OPTIONS} --user ${runas_user}"
550 + else
551 + SSD_OPTIONS="${SSD_OPTIONS} --chuid ${runas_user}"
552 + fi
553 + fi
554 +}
555 +
556 +start() {
557 + check_config
558 +
559 + ebegin "Starting transmission daemon"
560 + start-stop-daemon --start --quiet --pidfile ${pidfile} ${SSD_OPTIONS} \
561 + --exec /usr/bin/transmission-daemon -- --pid-file ${pidfile} \
562 + $(test ${logfile} != "syslog" && echo --logfile ${logfile}) \
563 + ${TRANSMISSION_OPTIONS}
564 + eend $?
565 +}
566 +
567 +stop() {
568 + ebegin "Stopping transmission daemon"
569 + start-stop-daemon --stop --quiet --retry TERM/45/QUIT/15 --pidfile ${pidfile}
570 + eend $?
571 +}
572 +
573 +reload() {
574 + ebegin "Reloading transmission configuration"
575 + start-stop-daemon --signal HUP --pidfile ${pidfile}
576 + eend $?
577 +}
578 +
579
580 diff --git a/net-p2p/transmission/transmission-2.41.ebuild b/net-p2p/transmission/transmission-2.41.ebuild
581 new file mode 100644
582 index 0000000..2062695
583 --- /dev/null
584 +++ b/net-p2p/transmission/transmission-2.41.ebuild
585 @@ -0,0 +1,154 @@
586 +# Copyright 1999-2011 Gentoo Foundation
587 +# Distributed under the terms of the GNU General Public License v2
588 +# $Header: /var/cvsroot/gentoo-x86/net-p2p/transmission/transmission-2.41.ebuild,v 1.2 2011/10/19 11:49:53 pva Exp $
589 +
590 +EAPI=4
591 +inherit eutils fdo-mime gnome2-utils qt4-r2 autotools
592 +
593 +MY_P="${P/_beta/b}"
594 +
595 +DESCRIPTION="A Fast, Easy and Free BitTorrent client"
596 +HOMEPAGE="http://www.transmissionbt.com/"
597 +SRC_URI="http://download.transmissionbt.com/${PN}/files/${MY_P}.tar.xz"
598 +
599 +LICENSE="MIT GPL-2"
600 +SLOT="0"
601 +KEYWORDS="~amd64 ~x86"
602 +IUSE="gtk kde nls qt4 utp"
603 +
604 +RDEPEND="
605 + sys-libs/zlib
606 + >=dev-libs/libevent-2.0.10
607 + >=dev-libs/openssl-0.9.4
608 + || ( >=net-misc/curl-7.16.3[ssl]
609 + >=net-misc/curl-7.16.3[gnutls] )
610 + >=net-libs/miniupnpc-1.6
611 + gtk? ( >=dev-libs/glib-2.28:2
612 + >=x11-libs/gtk+-2.22:2
613 + >=dev-libs/dbus-glib-0.70 )
614 + qt4? ( x11-libs/qt-gui:4[dbus] )"
615 +DEPEND="${RDEPEND}
616 + >=sys-devel/libtool-2.2.6b
617 + nls? ( sys-devel/gettext
618 + >=dev-util/intltool-0.40 )
619 + dev-util/pkgconfig
620 + sys-apps/sed"
621 +
622 +S="${WORKDIR}/${MY_P}"
623 +
624 +REQUIRED_USE="gtk? ( nls )"
625 +
626 +pkg_setup() {
627 + enewgroup transmission
628 + enewuser transmission -1 -1 -1 transmission
629 +}
630 +
631 +src_prepare() {
632 + # Bug #387709, workaround redefines
633 + if use !utp; then
634 + epatch "${FILESDIR}/${P}-no_utp.patch"
635 + fi
636 +
637 + # https://trac.transmissionbt.com/ticket/4323
638 + epatch "${FILESDIR}/${PN}-2.33-0001-configure.ac.patch"
639 + epatch "${FILESDIR}/${PN}-2.33-0002-config.in-4-qt.pro.patch"
640 + epatch "${FILESDIR}/${P}-0003-system-miniupnpc.patch"
641 +
642 + # Upstream is not interested in this: https://trac.transmissionbt.com/ticket/4324
643 + sed -e 's|noinst\(_PROGRAMS = $(TESTS)\)|check\1|' -i libtransmission/Makefile.am || die
644 +
645 + eautoreconf
646 +
647 + sed -i -e 's:-ggdb3::g' configure || die
648 + # Magnet link support
649 + if use kde; then
650 + cat > qt/transmission-magnet.protocol <<-EOF
651 + [Protocol]
652 + exec=transmission-qt '%u'
653 + protocol=magnet
654 + Icon=transmission
655 + input=none
656 + output=none
657 + helper=true
658 + listing=
659 + reading=false
660 + writing=false
661 + makedir=false
662 + deleting=false
663 + EOF
664 + fi
665 +}
666 +
667 +src_configure() {
668 + # cli and daemon doesn't have external deps and are enabled by default
669 + econf \
670 + $(use_enable nls) \
671 + $(use_enable utp) \
672 + $(use_enable gtk) \
673 + --enable-external-miniupnp
674 +
675 + use qt4 && cd qt && eqmake4 qtr.pro
676 +}
677 +
678 +src_compile() {
679 + emake
680 + use qt4 && cd qt && emake
681 +}
682 +
683 +src_install() {
684 + emake DESTDIR="${D}" install
685 +
686 + dodoc AUTHORS NEWS qt/README.txt
687 + rm -f "${ED}"/usr/share/${PN}/web/LICENSE
688 +
689 + newinitd "${FILESDIR}"/${PN}-daemon.initd.8 ${PN}-daemon
690 + newconfd "${FILESDIR}"/${PN}-daemon.confd.3 ${PN}-daemon
691 +
692 + keepdir /var/{transmission/{config,downloads},log/transmission}
693 + fowners -R transmission:transmission /var/{transmission/{,config,downloads},log/transmission}
694 +
695 + if use qt4; then
696 + cd qt
697 + emake INSTALL_ROOT="${D}/usr" install
698 + insinto /usr/share/applications/
699 + doins transmission-qt.desktop
700 + mv icons/transmission{,-qt}.png
701 + doicon icons/transmission-qt.png
702 + if use kde; then
703 + insinto /usr/share/kde4/services/
704 + doins transmission-magnet.protocol
705 + fi
706 + fi
707 +}
708 +
709 +pkg_preinst() {
710 + gnome2_icon_savelist
711 +}
712 +
713 +pkg_postinst() {
714 + fdo-mime_desktop_database_update
715 + gnome2_icon_cache_update
716 +
717 + ewarn "If you use transmission-daemon, please, set 'rpc-username' and"
718 + ewarn "'rpc-password' (in plain text, transmission-daemon will hash it on"
719 + ewarn "start) in settings.json file located at /var/transmission/config or"
720 + ewarn "any other appropriate config directory."
721 + elog
722 + elog "To enable sound emerge media-libs/libcanberra and check that at least"
723 + elog "some sound them is selected. For this go:"
724 + elog "Gnome/system/preferences/sound themes tab and 'sound theme: default'"
725 + elog
726 + if use utp; then
727 + ewarn
728 + ewarn "Since uTP is enabled ${PN} needs large kernel buffers for the UDP socket."
729 + ewarn "Please, add into /etc/sysctl.conf following lines:"
730 + ewarn " net.core.rmem_max = 4194304"
731 + ewarn " net.core.wmem_max = 1048576"
732 + ewarn "and run sysctl -p"
733 + fi
734 +}
735 +
736 +pkg_postrm() {
737 + fdo-mime_desktop_database_update
738 + gnome2_icon_cache_update
739 +}