Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Marcus Osdoba <marcus.osdoba@googlemail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] introducing transmission bittorrent client
Date: Thu,  9 Sep 2010 22:28:52 +0200	[thread overview]
Message-ID: <1284064132-21384-2-git-send-email-marcus.osdoba@googlemail.com> (raw)
In-Reply-To: <1284064132-21384-1-git-send-email-marcus.osdoba@googlemail.com>

introduces version 2.04 of transmission,
it has an excellent web interface which runs on port 9091 per default,
the patch provides two options, enable cli and/or remote component

the work is based on the patch from Kelvin Cheung

Signed-off-by: Marcus Osdoba <marcus.osdoba@googlemail.com>
---
 fs/skeleton/var/transmission         |    1 +
 package/Config.in                    |    1 +
 package/transmission/Config.in       |   23 +++++++++
 package/transmission/S92transmission |   88 ++++++++++++++++++++++++++++++++++
 package/transmission/transmission.mk |   32 ++++++++++++
 5 files changed, 145 insertions(+), 0 deletions(-)
 create mode 120000 fs/skeleton/var/transmission
 create mode 100755 package/transmission/Config.in
 create mode 100755 package/transmission/S92transmission
 create mode 100644 package/transmission/transmission.mk

diff --git a/fs/skeleton/var/transmission b/fs/skeleton/var/transmission
new file mode 120000
index 0000000..1431b0e
--- /dev/null
+++ b/fs/skeleton/var/transmission
@@ -0,0 +1 @@
+../tmp
\ No newline at end of file
diff --git a/package/Config.in b/package/Config.in
index d60d8ef..17386ad 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -427,6 +427,7 @@ source "package/thttpd/Config.in"
 source "package/tinyhttpd/Config.in"
 endif
 source "package/tn5250/Config.in"
+source "package/transmission/Config.in"
 source "package/ttcp/Config.in"
 source "package/udpcast/Config.in"
 source "package/vpnc/Config.in"
diff --git a/package/transmission/Config.in b/package/transmission/Config.in
new file mode 100755
index 0000000..49f618f
--- /dev/null
+++ b/package/transmission/Config.in
@@ -0,0 +1,23 @@
+config BR2_PACKAGE_TRANSMISSION
+	bool "transmission"
+	select BR2_PACKAGE_ZLIB
+	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_LIBCURL
+	select BR2_PACKAGE_LIBEVENT
+	default n
+	help
+	  transmission - Transmission BitTorrent Client
+
+config BR2_PACKAGE_TRANSMISSION_CLI
+	bool "transmissioncli"
+	depends on BR2_PACKAGE_TRANSMISSION
+	default no
+	help
+	  Install transmission command line interface.
+
+config BR2_PACKAGE_TRANSMISSION_REMOTE
+	bool "transmission-remote"
+	depends on BR2_PACKAGE_TRANSMISSION
+	default yes
+	help
+	  Install transmission remote management tool.
diff --git a/package/transmission/S92transmission b/package/transmission/S92transmission
new file mode 100755
index 0000000..9c15aae
--- /dev/null
+++ b/package/transmission/S92transmission
@@ -0,0 +1,88 @@
+#!/bin/sh
+if [ ! -z "$2" ]; then
+	TRANSMISSION_ARGS="$2"
+else
+	TRANSMISSION_ARGS=""
+fi
+
+if [ ! -z "$3" ]; then
+	NET_INTERFACE="$3"
+else
+	NET_INTERFACE=""
+fi
+
+DESC="bittorrent client"
+NAME=transmission-daemon
+DAEMON=$(which $NAME)
+SCRIPTNAME=/etc/init.d/$0
+
+[ -x "$DAEMON" ] || exit 0
+
+do_start()
+{
+	if [ ! -z "$NET_INTERFACE" ]; then
+		# poll network interface
+		IFCONFIG_OUTPUT=`ifconfig $NET_INTERFACE`
+		IP_ADDR=`expr match "$IFCONFIG_OUTPUT" '.*inet addr:\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*'`
+		while [ -z "$IP_ADDR" ]
+		do
+			sleep 5
+			IFCONFIG_OUTPUT=`ifconfig $NET_INTERFACE`
+			IP_ADDR=`expr match "$IFCONFIG_OUTPUT" '.*inet addr:\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*'`
+		done
+	fi
+	if [ -z "$TRANSMISSION_ARGS" ]; then
+		start-stop-daemon -S -b -x ${DAEMON}
+	else
+		start-stop-daemon -S -b -x ${DAEMON} -- ${TRANSMISSION_ARGS}
+	fi
+	return $?
+}
+
+do_stop()
+{
+	start-stop-daemon -K -b -x ${DAEMON}
+	return $?
+}
+
+case "$1" in
+	start)
+		echo "Starting $DESC" "$NAME..."
+		do_start
+		case "$?" in
+			0) echo "   Start $DESC $NAME: SUCCESS" ;;
+			*)
+				echo "   Start $DESC $NAME: FAILED"
+				exit 3
+				;;
+		esac
+		;;
+	stop)
+		echo "Stopping $DESC $NAME..."
+		do_stop
+		case "$?" in
+			0) echo "   Stop $DESC $NAME: SUCCESS" ;;
+			*)
+				echo "   Stop $DESC $NAME: FAILED"
+				exit 3
+				;;
+		esac
+		;;
+	restart|force-reload)
+		echo "Restarting $DESC $NAME..."
+		do_stop
+		sleep 2
+		do_start
+		case "$?" in
+			0) echo "   Restart $DESC $NAME: SUCCESS" ;;
+			*)
+				echo "   Restart $DESC $NAME: FAILED: couldn't start $NAME"
+				exit 3
+				;;
+		esac
+		;;
+	*)
+		echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+		exit 3
+		;;
+esac
diff --git a/package/transmission/transmission.mk b/package/transmission/transmission.mk
new file mode 100644
index 0000000..71d4b43
--- /dev/null
+++ b/package/transmission/transmission.mk
@@ -0,0 +1,32 @@
+#############################################################
+#
+# transmission
+#
+#############################################################
+#
+#
+TRANSMISSION_VERSION=2.04
+TRANSMISSION_SOURCE=transmission-$(TRANSMISSION_VERSION).tar.bz2
+TRANSMISSION_SITE=http://mirrors.m0k.org/transmission/files/
+TRANSMISSION_LIBTOOL_PATCH=NO
+TRANSMISSION_DEPENDENCIES= host-pkg-config host-intltool zlib openssl libcurl libevent
+
+TRANSMISSION_CONF_OPT = --prefix=/usr \
+			--localstatedir=/var/transmission \
+			--disable-gtk \
+			--disable-libnotify \
+			--enable-daemon \
+			--with-zlib=$(STAGING_DIR) \
+			$(DISABLE_NLS) \
+			$(DISABLE_LARGEFILE)
+
+ifneq ($(BR2_PACKAGE_TRANSMISSION_CLI),y)
+TRANSMISSION_CONF_OPT += --disable-cli
+endif
+
+ifneq ($(BR2_PACKAGE_TRANSMISSION_REMOTE),y)
+TRANSMISSION_CONF_OPT += --disable-remote
+endif
+
+
+$(eval $(call AUTOTARGETS,package,transmission))
-- 
1.7.1

  reply	other threads:[~2010-09-09 20:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-09 20:28 [Buildroot] transmission better choice over ctorrent according to users voices Marcus Osdoba
2010-09-09 20:28 ` Marcus Osdoba [this message]
2010-09-10  5:07   ` [Buildroot] [PATCH] introducing transmission bittorrent client Belisko Marek
2010-09-10  8:10     ` Thomas Petazzoni
2010-09-10  8:15       ` Belisko Marek
2010-09-11 16:32         ` Marcus Osdoba
2010-09-10  6:55   ` Thomas Petazzoni
  -- strict thread matches above, loose matches on Subject: below --
2010-09-13 18:07 [Buildroot] resend transmission bittorrent client after 1st review by Thomas Marcus Osdoba
2010-09-13 18:07 ` [Buildroot] [PATCH] introducing transmission bittorrent client Marcus Osdoba
2010-09-19  8:23 Marcus Osdoba
2010-09-19  9:53 ` Marcus Osdoba
2010-09-21  2:00   ` Kelvin Cheung
2010-09-22 20:26     ` Marcus Osdoba
2010-09-22 23:06       ` Thomas Petazzoni
2010-09-27 21:46     ` Marcus Osdoba
2010-09-29  8:22       ` Thomas Petazzoni
2010-09-22 23:05 ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1284064132-21384-2-git-send-email-marcus.osdoba@googlemail.com \
    --to=marcus.osdoba@googlemail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox