transmission: Fix compilation under uClibc-ng 8863/head
authorRosen Penev <rosenp@gmail.com>
Wed, 1 May 2019 17:41:27 +0000 (10:41 -0700)
committerRosen Penev <rosenp@gmail.com>
Wed, 1 May 2019 17:41:27 +0000 (10:41 -0700)
Upstream has a patch for this dated 2016.

Also ran the init script through shellcheck.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
net/transmission/Makefile
net/transmission/files/transmission.init
net/transmission/patches/070-uClibc-ng-since-1.0.18-has-sys-quota.h-synced-with-G.patch [new file with mode: 0644]

index 3ce72d831436f0e7509d71207445cb8e01cd1e0d..bbe073e698ad20d8d49544ae8767e617007493f9 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=transmission
 PKG_VERSION:=2.94
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GITHUB/transmission/transmission-releases/master
@@ -134,14 +134,12 @@ CONFIGURE_ARGS += \
        --without-systemd-daemon
 
 ifeq ($(BUILD_VARIANT),mbedtls)
-  CONFIGURE_ARGS += \
-       --with-crypto=polarssl
+  CONFIGURE_ARGS += --with-crypto=polarssl
   CONFIGURE_VARS += \
        MBEDTLS_CFLAGS="-I$(STAGING_DIR)/usr/include/mbedtls" \
        MBEDTLS_LIBS="-lmbedtls -lmbedcrypto"
 else
-  CONFIGURE_ARGS += \
-       --with-crypto=openssl
+  CONFIGURE_ARGS += --with-crypto=openssl
 endif
 
 define Package/transmission-daemon-openssl/install
index 521fe20b83ed0bc95933ab9a5f9d781872003aea..2a25214a7d2e4ed8439097cbf7e130443b485dba 100644 (file)
@@ -65,9 +65,11 @@ transmission() {
        config_get nice "$cfg" nice 0
        config_get web_home "$cfg" 'web_home'
 
-       local MEM=$(sed -ne 's!^MemTotal:[[:space:]]*\([0-9]*\) kB$!\1!p' /proc/meminfo)
+       local MEM
+
+       MEM=$(sed -ne 's!^MemTotal:[[:space:]]*\([0-9]*\) kB$!\1!p' /proc/meminfo)
        if test "$MEM" -gt 1;then
-               USE=$(expr $MEM \* $mem_percentage \* 10)
+               USE=$((MEM * mem_percentage * 10))
        fi
 
        config_file="$config_dir/settings.json"
@@ -78,7 +80,7 @@ transmission() {
                [ -z "$user" ] || chown -R "$user:$group" $config_dir
        }
 
-       [ "$config_overwrite" == 0 ] || {
+       [ "$config_overwrite" = 0 ] || {
 
                echo "{" > $config_file
 
diff --git a/net/transmission/patches/070-uClibc-ng-since-1.0.18-has-sys-quota.h-synced-with-G.patch b/net/transmission/patches/070-uClibc-ng-since-1.0.18-has-sys-quota.h-synced-with-G.patch
new file mode 100644 (file)
index 0000000..5dfd20f
--- /dev/null
@@ -0,0 +1,25 @@
+From e24f7c6653ec385c8af7eb6499d924994e78e42d Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@uclibc-ng.org>
+Date: Wed, 19 Oct 2016 19:33:35 +0200
+Subject: [PATCH] uClibc-ng since 1.0.18 has sys/quota.h synced with GNU libc
+
+---
+ libtransmission/platform-quota.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libtransmission/platform-quota.c b/libtransmission/platform-quota.c
+index e7d1f6d4f..bb1f9d9b9 100644
+--- a/libtransmission/platform-quota.c
++++ b/libtransmission/platform-quota.c
+@@ -285,7 +285,7 @@ getquota (const char * device)
+       spaceused = (int64_t) dq.dqb_curblocks >> 1;
+ #elif defined(__APPLE__)
+       spaceused = (int64_t) dq.dqb_curbytes;
+-#elif defined(__UCLIBC__)
++#elif defined (__UCLIBC__) && !TR_UCLIBC_CHECK_VERSION (1, 0, 18)
+       spaceused = (int64_t) btodb(dq.dqb_curblocks);
+ #elif defined(__sun) || (defined(_LINUX_QUOTA_VERSION) && _LINUX_QUOTA_VERSION < 2)
+       spaceused = (int64_t) dq.dqb_curblocks >> 1;
+-- 
+2.17.1
+