summaryrefslogtreecommitdiff
path: root/repo/transmission
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-06-03 13:05:13 +0100
committerdavidovski <david@davidovski.xyz>2022-06-03 13:05:13 +0100
commit66c326b6d65388e9f1003715ad9675505f01f9d2 (patch)
tree40d7355cccfa3464902cf339a563e744c28a7101 /repo/transmission
parentfccdaa986f67f820df2914bef851d5fed77abac8 (diff)
added porting from alpine linux
Diffstat (limited to 'repo/transmission')
-rw-r--r--repo/transmission/disable-missing-lang.patch10
-rw-r--r--repo/transmission/fix-gettext-sigsegv.patch15
-rw-r--r--repo/transmission/transmission-daemon.confd14
-rw-r--r--repo/transmission/transmission-daemon.initd73
-rw-r--r--repo/transmission/transmission-daemon.logrotate8
-rw-r--r--repo/transmission/transmission-daemon.post-upgrade10
-rw-r--r--repo/transmission/transmission-daemon.pre-install6
-rw-r--r--repo/transmission/transmission.xibuild40
8 files changed, 176 insertions, 0 deletions
diff --git a/repo/transmission/disable-missing-lang.patch b/repo/transmission/disable-missing-lang.patch
new file mode 100644
index 0000000..22c0caf
--- /dev/null
+++ b/repo/transmission/disable-missing-lang.patch
@@ -0,0 +1,10 @@
+--- a/po/CMakeLists.txt
++++ b/po/CMakeLists.txt
+@@ -70,7 +70,6 @@
+ pl
+ pt
+ pt_BR
+- pt_PT
+ ro
+ ru
+ si
diff --git a/repo/transmission/fix-gettext-sigsegv.patch b/repo/transmission/fix-gettext-sigsegv.patch
new file mode 100644
index 0000000..7e990ee
--- /dev/null
+++ b/repo/transmission/fix-gettext-sigsegv.patch
@@ -0,0 +1,15 @@
+mostly the equivalent of the new upstream version:
+https://github.com/transmission/transmission/blob/e14c7f38e59f89c5c6a67c1596a0e548869b7e9d/gtk/FilterBar.cc#L530
+--- a/gtk/filter.c
++++ b/gtk/filter.c
+@@ -599,7 +599,9 @@
+
+ for (size_t i = 0; i < G_N_ELEMENTS(types); ++i)
+ {
+- char const* name = types[i].context != NULL ? g_dpgettext2(NULL, types[i].context, types[i].name) : _(types[i].name);
++ char const* name = types[i].name ?
++ types[i].context != NULL ? g_dpgettext2(NULL, types[i].context, types[i].name) : _(types[i].name)
++ : "\0";
+ gtk_list_store_insert_with_values(store, NULL, -1,
+ ACTIVITY_FILTER_COL_NAME, name,
+ ACTIVITY_FILTER_COL_TYPE, types[i].type,
diff --git a/repo/transmission/transmission-daemon.confd b/repo/transmission/transmission-daemon.confd
new file mode 100644
index 0000000..8f3b131
--- /dev/null
+++ b/repo/transmission/transmission-daemon.confd
@@ -0,0 +1,14 @@
+# This is the transmission-daemon configuration file. For other options and
+# better explanation, take a look at transmission-daemon manual page Note: it's
+# better to configure some settings (like username/password) in
+# /var/lib/transmission/config/settings.json to avoid other users see it with `ps`
+
+TRANSMISSION_OPTIONS="--encryption-preferred"
+
+# Run daemon as another user (username or username:groupname)
+# If you change this setting, chown -R /var/lib/transmission/config <and download directory, check web settings>
+#runas_user=transmission
+
+# Location of logfile (should be writeable for runas_user user)
+# Set logfile=syslog to use syslog for logging
+#logfile=/var/log/transmission/transmission.log
diff --git a/repo/transmission/transmission-daemon.initd b/repo/transmission/transmission-daemon.initd
new file mode 100644
index 0000000..0c9e366
--- /dev/null
+++ b/repo/transmission/transmission-daemon.initd
@@ -0,0 +1,73 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-p2p/transmission/files/transmission-daemon.initd.8,v 1.2 2011/12/04 10:35:07 swegener Exp $
+
+extra_started_commands="reload"
+description="Transmission is a fast, easy and free bittorrent client"
+description_start="Start transmission-daemon server and web interface"
+description_stop="Stop transmission-daemon server and web interface"
+description_reload="Reload transmission-daemon settings"
+
+rundir=${rundir:-/var/run/transmission}
+pidfile=${pidfile:-${rundir}/transmission.pid}
+config_dir=${config_dir:-/var/lib/transmission/config}
+download_dir=${download_dir:-/var/lib/transmission/downloads}
+logfile=${logfile:-/var/log/transmission/transmission.log}
+runas_user=${runas_user:-transmission:transmission}
+
+SSD_OPTIONS=""
+
+# compatibility for upgraders
+TRANSMISSION_OPTIONS=${TRANSMISSION_OPTIONS:-$TD_OPTS}
+
+depend() {
+ need net
+ after firewall
+}
+
+check_config() {
+ if [ ! -d "${rundir}" ]; then
+ mkdir "${rundir}"
+ if [ -n "${runas_user}" ]; then
+ chown -R ${runas_user} "${rundir}"
+ fi
+ fi
+
+ # In case no config directory option passed use default
+ if ! $(echo ${TRANSMISSION_OPTIONS} | grep -q -e '\B-g' -e '\B--config-dir'); then
+ TRANSMISSION_OPTIONS="${TRANSMISSION_OPTIONS} --config-dir ${config_dir}"
+ # put download dir location on first run (and take it from config later)
+ if [ ! -f ${config_dir}/settings.json ]; then
+ TRANSMISSION_OPTIONS="${TRANSMISSION_OPTIONS} --download-dir ${download_dir}"
+ fi
+ fi
+
+ if [ -n "${runas_user}" ]; then
+ SSD_OPTIONS="${SSD_OPTIONS} --user ${runas_user}"
+ fi
+}
+
+start() {
+ check_config
+
+ ebegin "Starting transmission daemon"
+ start-stop-daemon --start --quiet --pidfile ${pidfile} ${SSD_OPTIONS} \
+ --exec /usr/bin/transmission-daemon -- --pid-file ${pidfile} \
+ $(test ${logfile} != "syslog" && echo --logfile ${logfile}) \
+ ${TRANSMISSION_OPTIONS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping transmission daemon"
+ start-stop-daemon --stop --quiet --retry TERM/45/QUIT/15 --pidfile ${pidfile}
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading transmission configuration"
+ start-stop-daemon --signal HUP --pidfile ${pidfile}
+ eend $?
+}
+
diff --git a/repo/transmission/transmission-daemon.logrotate b/repo/transmission/transmission-daemon.logrotate
new file mode 100644
index 0000000..bd8b5ae
--- /dev/null
+++ b/repo/transmission/transmission-daemon.logrotate
@@ -0,0 +1,8 @@
+/var/log/transmission/transmission.log {
+ daily
+ missingok
+ copytruncate
+ rotate 7
+ compress
+ notifempty
+}
diff --git a/repo/transmission/transmission-daemon.post-upgrade b/repo/transmission/transmission-daemon.post-upgrade
new file mode 100644
index 0000000..e0aaa8e
--- /dev/null
+++ b/repo/transmission/transmission-daemon.post-upgrade
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+dir=/var/lib/transmission
+
+# rename config and create compat symlink
+if [ -e "$dir"/.config ] && ! [ -e "$dir"/config ]; then
+ mv "$dir"/.config "$dir"/config
+ ln -s config "$dir"/.config
+fi
+
diff --git a/repo/transmission/transmission-daemon.pre-install b/repo/transmission/transmission-daemon.pre-install
new file mode 100644
index 0000000..2e26d48
--- /dev/null
+++ b/repo/transmission/transmission-daemon.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S transmission 2>/dev/null
+adduser -S -D -h /var/lib/transmission -s /sbin/nologin -G transmission -g transmission transmission 2>/dev/null
+
+exit 0
diff --git a/repo/transmission/transmission.xibuild b/repo/transmission/transmission.xibuild
new file mode 100644
index 0000000..7e0c19d
--- /dev/null
+++ b/repo/transmission/transmission.xibuild
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+NAME="transmission"
+DESC="Lightweight GTK BitTorrent client"
+
+MAKEDEPS="cmake curl dbus-glib ninja gtk3 intltool libevent libnotify openssl tar"
+
+PKG_VER=3.00
+SOURCE="https://github.com/transmission/transmission-releases/raw/master/transmission-$PKG_VER.tar.xz"
+
+ADDITIONAL="
+disable-missing-lang.patch
+fix-gettext-sigsegv.patch
+transmission-daemon.confd
+transmission-daemon.initd
+"
+
+build() {
+ cmake -B build -G Ninja \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DBUILD_SHARED_LIBS=True \
+ -DCMAKE_BUILD_TYPE=MinSizeRel \
+ -DENABLE_GTK=TRUE \
+ -DENABLE_CLI=TRUE \
+ -DENABLE_NLS=FALSE \
+ -DENABLE_TESTS=FALSE \
+ -DWITH_SYSTEMD=FALSE \
+ -DINSTALL_LIB=TRUE
+ cmake --build build
+}
+
+package() {
+ DESTDIR="$PKG_DEST" cmake --install build
+
+ install -D -m755 "$BUILD_ROOT"/transmission-daemon.initd \
+ "$PKG_DEST"/etc/init.d/transmission-daemon
+ install -D -m644 "$BUILD_ROOT"/transmission-daemon.confd \
+ "$PKG_DEST"/etc/conf.d/transmission-daemon
+}