aboutsummaryrefslogtreecommitdiff
path: root/multimedia/xupnpd/patches
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2014-06-11 00:33:55 +0200
committerÁlvaro Fernández Rojas <noltari@gmail.com>2014-06-11 00:33:55 +0200
commit4aaeb5fd68570587502494b43ff2d2f6d4616cad (patch)
tree521694ecb36e20545280c41aa0ecc7196397ac4c /multimedia/xupnpd/patches
parent70a369d8136adffb43fe1b8ac0d8e4eb0b8423aa (diff)
xupnpd: Import r398 from packages and update to r399.
Diffstat (limited to 'multimedia/xupnpd/patches')
-rw-r--r--multimedia/xupnpd/patches/100-default_config.patch15
-rw-r--r--multimedia/xupnpd/patches/101-root_dir_param.patch83
2 files changed, 98 insertions, 0 deletions
diff --git a/multimedia/xupnpd/patches/100-default_config.patch b/multimedia/xupnpd/patches/100-default_config.patch
new file mode 100644
index 000000000..89958c7fe
--- /dev/null
+++ b/multimedia/xupnpd/patches/100-default_config.patch
@@ -0,0 +1,15 @@
+--- a/xupnpd.lua
++++ b/xupnpd.lua
+@@ -1,10 +1,10 @@
+ cfg={}
+
+ -- multicast interface for SSDP exchange, 'eth0', 'br0', 'br-lan' for example
+-cfg.ssdp_interface='lo'
++cfg.ssdp_interface='br-lan'
+
+ -- 'cfg.ssdp_loop' enables multicast loop (if player and server in one host)
+-cfg.ssdp_loop=1
++cfg.ssdp_loop=0
+
+ -- SSDP announcement interval
+ cfg.ssdp_notify_interval=15
diff --git a/multimedia/xupnpd/patches/101-root_dir_param.patch b/multimedia/xupnpd/patches/101-root_dir_param.patch
new file mode 100644
index 000000000..68ea3e82e
--- /dev/null
+++ b/multimedia/xupnpd/patches/101-root_dir_param.patch
@@ -0,0 +1,83 @@
+--- a/main.cpp
++++ b/main.cpp
+@@ -4,11 +4,14 @@
+ * https://tsdemuxer.googlecode.com/svn/trunk/xupnpd
+ */
+
++#include <ctype.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <sys/stat.h>
++#include <sys/types.h>
+ #include "luacompat.h"
+ #include "luaxlib.h"
+ #include "luaxcore.h"
+@@ -16,35 +19,36 @@
+
+ int main(int argc,char** argv)
+ {
+- const char* p=strrchr(argv[0],'/');
+-
+- int rc;
+-
+- if(p)
+- {
+- char location[512];
+- int n=p-argv[0];
+- if(n>=sizeof(location))
+- n=sizeof(location)-1;
+- strncpy(location,argv[0],n);
+- location[n]=0;
+-
+- rc=chdir(location);
+-
+- argv[0]=(char*)p+1;
+- }
+-
+- const char* root=getenv("XUPNPDROOTDIR");
+- if(root && *root)
+- rc=chdir(root);
+-
+- {
+- FILE* fp=fopen("xupnpd.lua","r");
+- if(fp)
+- fclose(fp);
+- else
+- rc=chdir("/usr/share/xupnpd/");
+- }
++ int c;
++ char *xupnpd_root = "/usr/share/xupnpd/";
++ struct stat s;
++
++ opterr = 0;
++ while ((c = getopt (argc, argv, "d:")) != -1) {
++ switch (c) {
++ case 'd':
++ xupnpd_root = optarg;
++ break;
++ case '?':
++ if (optopt == 'd')
++ fprintf(stderr, "Option -%c requires an argument.\n", optopt);
++ else if (isprint(optopt))
++ fprintf(stderr, "Unknown option \"-%c\".\n", optopt);
++ else
++ fprintf(stderr, "Unknown option\n");
++ return 1;
++ default:
++ abort();
++ }
++ }
++
++ if(stat(xupnpd_root, &s) != -1 && S_ISDIR(s.st_mode)) {
++ c = chdir(xupnpd_root);
++ }
++ else {
++ fprintf(stderr, "Directory %s doesn't exist.\n", xupnpd_root);
++ return 1;
++ }
+
+ lua_State* L=lua_open();
+ if(L)