diff options
author | Leon Anavi <leon.anavi@konsulko.com> | 2020-05-15 15:32:42 +0300 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-05-15 08:31:09 -0700 |
commit | b260aa79693d2b6ba30e203197263ace73c12b4c (patch) | |
tree | 2cbc2ed7e037f94d810d2b9082e3fcddc961682c /meta-oe/recipes-connectivity/transmission | |
parent | 33a15c790688e6bd959fc59062c2020485b992b6 (diff) | |
download | meta-openembedded-b260aa79693d2b6ba30e203197263ace73c12b4c.tar.gz |
transmission: Add version 2.94
Transmission is a fast, easy, and free BitTorrent client. This
recipe provides it as a GTK+ application for X11, headless daemon
and a web user interface (UI).
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-connectivity/transmission')
3 files changed, 276 insertions, 0 deletions
diff --git a/meta-oe/recipes-connectivity/transmission/files/0001-configure.ac-Fix-no-libsystemd-daemon.patch b/meta-oe/recipes-connectivity/transmission/files/0001-configure.ac-Fix-no-libsystemd-daemon.patch new file mode 100644 index 0000000000..130ead0842 --- /dev/null +++ b/meta-oe/recipes-connectivity/transmission/files/0001-configure.ac-Fix-no-libsystemd-daemon.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From 73ee7e68402a77287054df779f0e44ae1a4f9f0b Mon Sep 17 00:00:00 2001 | ||
2 | From: Leon Anavi <leon.anavi@konsulko.com> | ||
3 | Date: Mon, 11 May 2020 17:01:35 +0000 | ||
4 | Subject: [PATCH] configure.ac: Fix no libsystemd-daemon | ||
5 | |||
6 | Replace libsystemd-daemon with libsystemd. | ||
7 | |||
8 | Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> | ||
9 | --- | ||
10 | configure.ac | 5 ++--- | ||
11 | 1 file changed, 2 insertions(+), 3 deletions(-) | ||
12 | |||
13 | diff --git a/configure.ac b/configure.ac | ||
14 | index df8cb5007..9a6fb9b2e 100644 | ||
15 | --- a/configure.ac | ||
16 | +++ b/configure.ac | ||
17 | @@ -249,10 +249,10 @@ AC_ARG_WITH([systemd-daemon], AS_HELP_STRING([--with-systemd-daemon], | ||
18 | [Add support for systemd startup notification (default is autodetected)]), | ||
19 | [USE_SYSTEMD_DAEMON=$withval], [USE_SYSTEMD_DAEMON=auto]) | ||
20 | AS_IF([test "x$USE_SYSTEMD_DAEMON" != "xno"], [ | ||
21 | - PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon], | ||
22 | + PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd], | ||
23 | [AC_DEFINE(USE_SYSTEMD_DAEMON,1,[Use systemd startup notification])], | ||
24 | [AS_IF([test "x$USE_SYSTEMD_DAEMON" = "xyes"], | ||
25 | - [AC_MSG_ERROR([systemd startup notification support requested, but libsystemd-daemon not found.])] | ||
26 | + [AC_MSG_ERROR([systemd startup notification support requested, but libsystemd not found.])] | ||
27 | )] | ||
28 | ) | ||
29 | ]) | ||
30 | @@ -558,7 +558,6 @@ if test "x$enable_nls" = "xyes" ; then | ||
31 | GETTEXT_PACKAGE=transmission-gtk | ||
32 | AC_SUBST(GETTEXT_PACKAGE) | ||
33 | AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package]) | ||
34 | - AM_GLIB_GNU_GETTEXT | ||
35 | transmissionlocaledir='${prefix}/${DATADIRNAME}/locale' | ||
36 | AC_SUBST(transmissionlocaledir) | ||
37 | fi | ||
38 | -- | ||
39 | 2.17.1 | ||
40 | |||
diff --git a/meta-oe/recipes-connectivity/transmission/files/transmission-daemon b/meta-oe/recipes-connectivity/transmission/files/transmission-daemon new file mode 100644 index 0000000000..d1ffff58b0 --- /dev/null +++ b/meta-oe/recipes-connectivity/transmission/files/transmission-daemon | |||
@@ -0,0 +1,163 @@ | |||
1 | #! /bin/sh | ||
2 | ### BEGIN INIT INFO | ||
3 | # Provides: transmission-daemon | ||
4 | # Required-Start: networking | ||
5 | # Required-Stop: networking | ||
6 | # Default-Start: 2 3 5 | ||
7 | # Default-Stop: 0 1 6 | ||
8 | # Short-Description: Start the transmission BitTorrent daemon client. | ||
9 | ### END INIT INFO | ||
10 | |||
11 | # Original Author: Lennart A. JÃŒtte, based on Rob Howell's script | ||
12 | # Modified by Maarten Van Coile & others (on IRC) | ||
13 | |||
14 | # Do NOT "set -e" | ||
15 | |||
16 | # | ||
17 | # ----- CONFIGURATION ----- | ||
18 | # | ||
19 | # For the default location Transmission uses, visit: | ||
20 | # http://trac.transmissionbt.com/wiki/ConfigFiles | ||
21 | # For a guide on how set the preferences, visit: | ||
22 | # http://trac.transmissionbt.com/wiki/EditConfigFiles | ||
23 | # For the available environement variables, visit: | ||
24 | # http://trac.transmissionbt.com/wiki/EnvironmentVariables | ||
25 | # | ||
26 | # The name of the user that should run Transmission. | ||
27 | # It's RECOMENDED to run Transmission in it's own user, | ||
28 | # by default, this is set to 'transmission'. | ||
29 | # For the sake of security you shouldn't set a password | ||
30 | # on this user | ||
31 | USERNAME=transmission | ||
32 | |||
33 | |||
34 | # ----- *ADVANCED* CONFIGURATION ----- | ||
35 | # Only change these options if you know what you are doing! | ||
36 | # | ||
37 | # The folder where Transmission stores the config & web files. | ||
38 | # ONLY change this you have it at a non-default location | ||
39 | #TRANSMISSION_HOME="/var/config/transmission-daemon" | ||
40 | #TRANSMISSION_WEB_HOME="/usr/share/transmission/web" | ||
41 | # | ||
42 | # The arguments passed on to transmission-daemon. | ||
43 | # ONLY change this you need to, otherwise use the | ||
44 | # settings file as per above. | ||
45 | #TRANSMISSION_ARGS="" | ||
46 | |||
47 | |||
48 | # ----- END OF CONFIGURATION ----- | ||
49 | # | ||
50 | # PATH should only include /usr/* if it runs after the mountnfs.sh script. | ||
51 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
52 | DESC="bittorrent client" | ||
53 | NAME=transmission-daemon | ||
54 | DAEMON=$(which $NAME) | ||
55 | PIDFILE=/var/run/$NAME.pid | ||
56 | SCRIPTNAME=/etc/init.d/$NAME | ||
57 | |||
58 | # Exit if the package is not installed | ||
59 | [ -x "$DAEMON" ] || exit 0 | ||
60 | |||
61 | # Read configuration variable file if it is present | ||
62 | [ -r /etc/default/$NAME ] && . /etc/default/$NAME | ||
63 | |||
64 | # Load the VERBOSE setting and other rcS variables | ||
65 | [ -f /etc/default/rcS ] && . /etc/default/rcS | ||
66 | |||
67 | # | ||
68 | # Function that starts the daemon/service | ||
69 | # | ||
70 | |||
71 | do_start() | ||
72 | { | ||
73 | # Export the configuration/web directory, if set | ||
74 | if [ -n "$TRANSMISSION_HOME" ]; then | ||
75 | export TRANSMISSION_HOME | ||
76 | fi | ||
77 | if [ -n "$TRANSMISSION_WEB_HOME" ]; then | ||
78 | export TRANSMISSION_WEB_HOME | ||
79 | fi | ||
80 | |||
81 | # Return | ||
82 | # 0 if daemon has been started | ||
83 | # 1 if daemon was already running | ||
84 | # 2 if daemon could not be started | ||
85 | start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --make-pidfile \ | ||
86 | --exec $DAEMON --background --test -- -f $TRANSMISSION_ARGS > /dev/null \ | ||
87 | || return 1 | ||
88 | start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --make-pidfile \ | ||
89 | --exec $DAEMON --background -- -f $TRANSMISSION_ARGS \ | ||
90 | || return 2 | ||
91 | } | ||
92 | |||
93 | # | ||
94 | # Function that stops the daemon/service | ||
95 | # | ||
96 | do_stop() | ||
97 | { | ||
98 | # Return | ||
99 | # 0 if daemon has been stopped | ||
100 | # 1 if daemon was already stopped | ||
101 | # 2 if daemon could not be stopped | ||
102 | # other if a failure occurred | ||
103 | start-stop-daemon --stop --quiet --retry=TERM/10/KILL/5 --pidfile $PIDFILE --exec $DAEMON | ||
104 | RETVAL="$?" | ||
105 | [ "$RETVAL" = 2 ] && return 2 | ||
106 | |||
107 | # Wait for children to finish too if this is a daemon that forks | ||
108 | # and if the daemon is only ever run from this initscript. | ||
109 | # If the above conditions are not satisfied then add some other code | ||
110 | # that waits for the process to drop all resources that could be | ||
111 | # needed by services started subsequently. A last resort is to | ||
112 | # sleep for some time. | ||
113 | |||
114 | start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON | ||
115 | [ "$?" = 2 ] && return 2 | ||
116 | |||
117 | # Many daemons don't delete their pidfiles when they exit. | ||
118 | rm -f $PIDFILE | ||
119 | |||
120 | return "$RETVAL" | ||
121 | } | ||
122 | |||
123 | case "$1" in | ||
124 | start) | ||
125 | echo "Starting $DESC" "$NAME..." | ||
126 | do_start | ||
127 | case "$?" in | ||
128 | 0|1) echo " Starting $DESC $NAME succeeded" ;; | ||
129 | *) echo " Starting $DESC $NAME failed" ;; | ||
130 | esac | ||
131 | ;; | ||
132 | stop) | ||
133 | echo "Stopping $DESC $NAME..." | ||
134 | do_stop | ||
135 | case "$?" in | ||
136 | 0|1) echo " Stopping $DESC $NAME succeeded" ;; | ||
137 | *) echo " Stopping $DESC $NAME failed" ;; | ||
138 | esac | ||
139 | ;; | ||
140 | restart|force-reload) | ||
141 | # | ||
142 | # If the "reload" option is implemented then remove the | ||
143 | # 'force-reload' alias | ||
144 | # | ||
145 | echo "Restarting $DESC $NAME..." | ||
146 | do_stop | ||
147 | case "$?" in | ||
148 | 0|1) | ||
149 | do_start | ||
150 | case "$?" in | ||
151 | 0|1) echo " Restarting $DESC $NAME succeeded" ;; | ||
152 | *) echo " Restarting $DESC $NAME failed: couldn't start $NAME" ;; | ||
153 | esac | ||
154 | ;; | ||
155 | *) | ||
156 | echo " Restarting $DESC $NAME failed: couldn't stop $NAME" ;; | ||
157 | esac | ||
158 | ;; | ||
159 | *) | ||
160 | echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 | ||
161 | exit 3 | ||
162 | ;; | ||
163 | esac | ||
diff --git a/meta-oe/recipes-connectivity/transmission/transmission_git.bb b/meta-oe/recipes-connectivity/transmission/transmission_git.bb new file mode 100644 index 0000000000..ee5578f8b9 --- /dev/null +++ b/meta-oe/recipes-connectivity/transmission/transmission_git.bb | |||
@@ -0,0 +1,73 @@ | |||
1 | DESCRIPTION = "Transmission is a fast, easy, and free BitTorrent client" | ||
2 | SECTION = "network" | ||
3 | HOMEPAGE = "https://transmissionbt.com/" | ||
4 | LICENSE = "GPL-2.0" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=0dd9fcdc1416ff123c41c785192a1895" | ||
6 | |||
7 | DEPENDS = "curl libevent gnutls openssl libtool intltool-native glib-2.0-native" | ||
8 | RDEPENDS_${PN}-web = "${PN}" | ||
9 | |||
10 | SRC_URI = " \ | ||
11 | git://github.com/transmission/transmission \ | ||
12 | file://0001-configure.ac-Fix-no-libsystemd-daemon.patch \ | ||
13 | file://transmission-daemon \ | ||
14 | " | ||
15 | |||
16 | # Transmission release 2.94 | ||
17 | SRCREV = "d8e60ee44f4295935bd98bf741f85ed19f5a7dfb" | ||
18 | PV = "2.94" | ||
19 | |||
20 | S = "${WORKDIR}/git" | ||
21 | |||
22 | inherit autotools gettext update-rc.d systemd mime-xdg features_check | ||
23 | |||
24 | PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gtk', '', d)} \ | ||
25 | ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)}" | ||
26 | |||
27 | PACKAGECONFIG[gtk] = " --with-gtk,--without-gtk,gtk+3," | ||
28 | PACKAGECONFIG[systemd] = "--with-systemd-daemon,--without-systemd-daemon,systemd," | ||
29 | |||
30 | # Weak default values for transmission user and group | ||
31 | # Change them in bbappend if needed | ||
32 | TRANSMISSION_USER ??= "root" | ||
33 | TRANSMISSION_GROUP ??= "root" | ||
34 | |||
35 | # Configure aborts with: | ||
36 | # config.status: error: po/Makefile.in.in was not created by intltoolize. | ||
37 | B = "${S}" | ||
38 | do_configure_prepend() { | ||
39 | sed -i /AM_GLIB_GNU_GETTEXT/d ${S}/configure.ac | ||
40 | cd ${S} | ||
41 | ./update-version-h.sh | ||
42 | intltoolize --copy --force --automake | ||
43 | } | ||
44 | |||
45 | do_install_append() { | ||
46 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
47 | sed -i '/USERNAME=/c\USERNAME=${TRANSMISSION_USER}' ${WORKDIR}/transmission-daemon | ||
48 | install -d ${D}${sysconfdir}/init.d | ||
49 | install -m 0744 ${WORKDIR}/transmission-daemon ${D}${sysconfdir}/init.d/ | ||
50 | chown ${TRANSMISSION_USER}:${TRANSMISSION_GROUP} ${D}${sysconfdir}/init.d/transmission-daemon | ||
51 | fi | ||
52 | |||
53 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
54 | sed -i '/User=/c\User=${TRANSMISSION_USER}' ${S}/daemon/transmission-daemon.service | ||
55 | install -d ${D}${systemd_unitdir}/system | ||
56 | install -m 0644 ${S}/daemon/transmission-daemon.service ${D}${systemd_unitdir}/system | ||
57 | fi | ||
58 | } | ||
59 | |||
60 | PACKAGES += "${PN}-gtk ${PN}-client ${PN}-web" | ||
61 | |||
62 | FILES_${PN}-client = "${bindir}/transmission-remote ${bindir}/transmission-cli ${bindir}/transmission-create ${bindir}/transmission-show ${bindir}/transmission-edit" | ||
63 | FILES_${PN}-gtk += "${bindir}/transmission-gtk ${datadir}/icons ${datadir}/applications ${datadir}/pixmaps" | ||
64 | FILES_${PN}-web = "${datadir}/transmission/web" | ||
65 | FILES_${PN} = "${bindir}/transmission-daemon ${sysconfdir}/init.d/transmission-daemon" | ||
66 | |||
67 | SYSTEMD_SERVICE_${PN} = "transmission-daemon.service" | ||
68 | |||
69 | # Script transmission-daemon following the guidelines in: | ||
70 | # https://trac.transmissionbt.com/wiki/Scripts/initd | ||
71 | INITSCRIPT_PACKAGES = "transmission-daemon" | ||
72 | INITSCRIPT_NAME = "transmission-daemon" | ||
73 | INITSCRIPT_PARAMS = "start 99 5 3 2 . stop 10 0 1 6 ." | ||