mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 03:30:05 +02:00
Transmission: launch_daemon support (#2416)
* Transmission-CLI: LaunchDaemon support * Fix * Cleanup * launch Transmission-daemon, not the gui * Cleanup * Transmission user * Cleanup
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
job x-vnd.transmission_daemon {
|
||||
launch /system/bin/transmission-daemon
|
||||
no_safemode
|
||||
legacy
|
||||
on {
|
||||
initial_volumes_mounted
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
From d350c9f0569a19eb2d8b56dfd39cfc638f5bd21e Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Fri, 5 Sep 2014 14:57:25 +0000
|
||||
Subject: haiku patch
|
||||
|
||||
|
||||
diff --git a/libtransmission/platform-quota.c b/libtransmission/platform-quota.c
|
||||
index e8a2771..538eb68 100644
|
||||
--- a/libtransmission/platform-quota.c
|
||||
+++ b/libtransmission/platform-quota.c
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <unistd.h> /* getuid() */
|
||||
#include <event2/util.h> /* evutil_ascii_strcasecmp () */
|
||||
|
||||
-#ifndef WIN32
|
||||
+#if !defined(WIN32) && !defined(__HAIKU__)
|
||||
#include <sys/types.h> /* types needed by quota.h */
|
||||
#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
#include <ufs/ufs/quota.h> /* quotactl() */
|
||||
@@ -69,7 +69,7 @@
|
||||
****
|
||||
***/
|
||||
|
||||
-#ifndef WIN32
|
||||
+#if !defined(WIN32) && !defined(__HAIKU__)
|
||||
static const char *
|
||||
getdev (const char * path)
|
||||
{
|
||||
@@ -344,7 +344,7 @@ tr_getQuotaFreeSpace (const struct tr_device_info * info)
|
||||
{
|
||||
int64_t ret = -1;
|
||||
|
||||
-#ifndef WIN32
|
||||
+#if !defined(WIN32) && !defined(__HAIKU__)
|
||||
|
||||
if (info->fstype && !evutil_ascii_strcasecmp(info->fstype, "xfs"))
|
||||
{
|
||||
@@ -391,7 +391,7 @@ tr_device_info_create (const char * path)
|
||||
|
||||
info = tr_new0 (struct tr_device_info, 1);
|
||||
info->path = tr_strdup (path);
|
||||
-#ifndef WIN32
|
||||
+#if !defined(WIN32) && !defined(__HAIKU__)
|
||||
info->device = tr_strdup (getblkdev (path));
|
||||
info->fstype = tr_strdup (getfstype (path));
|
||||
#endif
|
||||
diff --git a/third-party/miniupnp/miniupnpc.c b/third-party/miniupnp/miniupnpc.c
|
||||
index 85b7d75..7c40326 100644
|
||||
--- a/third-party/miniupnp/miniupnpc.c
|
||||
+++ b/third-party/miniupnp/miniupnpc.c
|
||||
@@ -17,7 +17,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
-#if !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(MACOSX) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__sun)
|
||||
+#if !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(MACOSX) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__sun) && !defined(__HAIKU__)
|
||||
#define HAS_IP_MREQN
|
||||
#endif
|
||||
|
||||
diff --git a/third-party/miniupnp/portlistingparse.c b/third-party/miniupnp/portlistingparse.c
|
||||
index 19e3054..2b1bce8 100644
|
||||
--- a/third-party/miniupnp/portlistingparse.c
|
||||
+++ b/third-party/miniupnp/portlistingparse.c
|
||||
@@ -28,7 +28,7 @@ static const struct {
|
||||
|
||||
/* Helper function */
|
||||
static UNSIGNED_INTEGER
|
||||
-atoui(const char * p, int l)
|
||||
+my_atoui(const char * p, int l)
|
||||
{
|
||||
UNSIGNED_INTEGER r = 0;
|
||||
while(l > 0 && *p)
|
||||
@@ -94,7 +94,7 @@ data(void * d, const char * data, int l)
|
||||
pm->remoteHost[l] = '\0';
|
||||
break;
|
||||
case NewExternalPort:
|
||||
- pm->externalPort = (unsigned short)atoui(data, l);
|
||||
+ pm->externalPort = (unsigned short)my_atoui(data, l);
|
||||
break;
|
||||
case NewProtocol:
|
||||
if(l > 3)
|
||||
@@ -103,21 +103,21 @@ data(void * d, const char * data, int l)
|
||||
pm->protocol[l] = '\0';
|
||||
break;
|
||||
case NewInternalPort:
|
||||
- pm->internalPort = (unsigned short)atoui(data, l);
|
||||
+ pm->internalPort = (unsigned short)my_atoui(data, l);
|
||||
break;
|
||||
case NewInternalClient:
|
||||
memcpy(pm->internalClient, data, l);
|
||||
pm->internalClient[l] = '\0';
|
||||
break;
|
||||
case NewEnabled:
|
||||
- pm->enabled = (unsigned char)atoui(data, l);
|
||||
+ pm->enabled = (unsigned char)my_atoui(data, l);
|
||||
break;
|
||||
case NewDescription:
|
||||
memcpy(pm->description, data, l);
|
||||
pm->description[l] = '\0';
|
||||
break;
|
||||
case NewLeaseTime:
|
||||
- pm->leaseTime = atoui(data, l);
|
||||
+ pm->leaseTime = my_atoui(data, l);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
SUMMARY="A cross-platform open source BitTorrent client"
|
||||
DESCRIPTION="Transmission has the features you want from a BitTorrent client: \
|
||||
encryption, a web interface, peer exchange, magnet links, DHT, µTP, UPnP and \
|
||||
NAT-PMP port forwarding, webseed support, watch directories, tracker editing, \
|
||||
global and per-torrent speed limits, and more."
|
||||
HOMEPAGE="https://www.transmissionbt.com/"
|
||||
COPYRIGHT="2005-2014 By the respective authors"
|
||||
LICENSE="Transmission
|
||||
MIT
|
||||
GNU GPL v2"
|
||||
REVISION="4"
|
||||
SOURCE_URI="https://download.transmissionbt.com/files/transmission-$portVersion.tar.xz"
|
||||
CHECKSUM_SHA256="a9fc1936b4ee414acc732ada04e84339d6755cd0d097bcbd11ba2cfc540db9eb"
|
||||
PATCHES="transmission-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="!x86_gcc2 x86"
|
||||
|
||||
PROVIDES="
|
||||
transmission$secondaryArchSuffix = $portVersion
|
||||
cmd:transmission_cli$secondaryArchSuffix
|
||||
cmd:transmission_create$secondaryArchSuffix
|
||||
cmd:transmission_daemon$secondaryArchSuffix
|
||||
cmd:transmission_edit$secondaryArchSuffix
|
||||
cmd:transmission_remote$secondaryArchSuffix
|
||||
cmd:transmission_show$secondaryArchSuffix
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libcrypto$secondaryArchSuffix
|
||||
lib:libcurl$secondaryArchSuffix
|
||||
lib:libevent$secondaryArchSuffix
|
||||
lib:libiconv$secondaryArchSuffix
|
||||
lib:libintl$secondaryArchSuffix
|
||||
lib:libssl$secondaryArchSuffix
|
||||
lib:libz$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:libssl$secondaryArchSuffix
|
||||
devel:libcurl$secondaryArchSuffix
|
||||
devel:libz$secondaryArchSuffix
|
||||
devel:libevent$secondaryArchSuffix
|
||||
devel:libiconv$secondaryArchSuffix
|
||||
devel:libgettextlib$secondaryArchSuffix >= 0.14.1
|
||||
intltool >= 0.40
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:ld$secondaryArchSuffix
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
cmd:make
|
||||
cmd:awk
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
export CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS"
|
||||
export CXXFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS"
|
||||
export LDFLAGS="-lposix_error_mapper"
|
||||
runConfigure ./configure --without-gtk --datadir=$dataDir
|
||||
make
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
make install
|
||||
}
|
||||
@@ -23,7 +23,8 @@ REVISION="1"
|
||||
SOURCE_URI="https://github.com/transmission/transmission-releases/raw/master/transmission-$portVersion.tar.xz"
|
||||
CHECKSUM_SHA256="8815920e0a4499bcdadbbe89a4115092dab42ce5199f71ff9a926cfd12b9b90b"
|
||||
PATCHES="transmission-$portVersion.patchset"
|
||||
ADDITIONAL_FILES="transmission.rdef.in"
|
||||
ADDITIONAL_FILES="transmission.rdef.in
|
||||
Transmission_userlaunch"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="!x86_gcc2 x86"
|
||||
@@ -93,7 +94,12 @@ defineDebugInfoPackage transmission$secondaryArchSuffix \
|
||||
"$binDir"/transmission-edit \
|
||||
"$binDir"/transmission-remote \
|
||||
"$binDir"/transmission-show
|
||||
|
||||
|
||||
transmissionUserHomeDir="$dataDir"/transmission/empty
|
||||
PACKAGE_USERS="
|
||||
transmissiond real-name \"transmission user\" home \"$transmissionUserHomeDir\" shell \"/bin/true\"
|
||||
"
|
||||
PACKAGE_GROUPS="transmissiond"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
@@ -134,6 +140,10 @@ INSTALL()
|
||||
mimeset -f $appsDir/Transmission
|
||||
|
||||
addAppDeskbarSymlink $appsDir/Transmission
|
||||
|
||||
mkdir -p $dataDir/user_launch
|
||||
cp -af $portDir/additional-files/Transmission_userlaunch \
|
||||
$dataDir/user_launch/Transmission
|
||||
}
|
||||
|
||||
TEST()
|
||||
|
||||
Reference in New Issue
Block a user