summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /media-video/ushare/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'media-video/ushare/files')
-rw-r--r--media-video/ushare/files/01_all_ushare_build_system.patch170
-rw-r--r--media-video/ushare/files/02_all_ushare_build_warnings.patch35
-rw-r--r--media-video/ushare/files/03_all_ushare_mp4_video_mime.patch20
-rw-r--r--media-video/ushare/files/04_all_ushare_upnp_build_fix.patch156
-rw-r--r--media-video/ushare/files/05_all_missing_headers.patch59
-rw-r--r--media-video/ushare/files/06_all_ushare_disable_sysconf.patch20
-rw-r--r--media-video/ushare/files/07_all_drop_optimizations.patch20
-rw-r--r--media-video/ushare/files/ushare.conf.d38
-rw-r--r--media-video/ushare/files/ushare.init.d79
-rw-r--r--media-video/ushare/files/ushare.init.d.ng36
-rw-r--r--media-video/ushare/files/ushare.service11
11 files changed, 644 insertions, 0 deletions
diff --git a/media-video/ushare/files/01_all_ushare_build_system.patch b/media-video/ushare/files/01_all_ushare_build_system.patch
new file mode 100644
index 000000000000..c635bd7d52f4
--- /dev/null
+++ b/media-video/ushare/files/01_all_ushare_build_system.patch
@@ -0,0 +1,170 @@
+diff -uNr ushare-1.1a/configure ushare-1.1b/configure
+--- ushare-1.1a/configure 2007-12-09 08:03:36.000000000 -0500
++++ ushare-1.1b/configure 2012-03-25 17:35:07.000000000 -0400
+@@ -42,6 +42,9 @@
+ echo " --with-libdlna-dir=DIR check for libdlna installed in DIR"
+ echo ""
+ echo "Advanced options (experts only):"
++ echo " --disable-sysconf disable installation of init files"
++ echo " --enable-developer enable developer options"
++ echo " --disable-developer disable developer options"
+ echo " --enable-debug enable debugging symbols"
+ echo " --disable-debug disable debugging symbols"
+ echo " --disable-strip disable stripping of executables at installation"
+@@ -164,6 +167,11 @@
+ echo "#define $1 \"$2\"" >> $CONFIG_H
+ }
+
++check_cmd_exists(){
++ log check_cmd_exists "$@"
++ which "$@" >>$logfile 2>&1
++}
++
+ check_cmd(){
+ log "$@"
+ "$@" >>$logfile 2>&1
+@@ -300,13 +308,15 @@
+ strip="strip"
+ cpu=`uname -m`
+ optimize="yes"
++sysconf="yes"
++developer="no"
+ debug="no"
+ dostrip="yes"
+ extralibs=""
+ installstrip="-s"
+ cross_compile="no"
+ INSTALL="/usr/bin/install -c"
+-VERSION="1.1a"
++VERSION="1.2.0"
+ system_name=`uname -s 2>&1`
+
+ #################################################
+@@ -420,6 +430,12 @@
+ ;;
+ --disable-dlna) dlna="no"
+ ;;
++ --disable-sysconf) sysconf="no"
++ ;;
++ --enable-developer) developer="yes"
++ ;;
++ --disable-developer) developer="no"
++ ;;
+ --enable-debug) debug="yes"
+ ;;
+ --disable-debug) debug="no"
+@@ -584,6 +600,25 @@
+ linux && add_cflags -D_GNU_SOURCE
+
+ #################################################
++# check for developer options
++#################################################
++if enabled developer; then
++ add_cflags -Werror
++ add_cflags -DHAVE_DEVELOPER
++
++ have_ctags='no'
++ if check_cmd_exists 'ctags'; then
++ have_ctags='yes'
++ fi
++
++ have_etags='no'
++ if check_cmd_exists 'etags'; then
++ have_etags='yes'
++ fi
++
++fi
++
++#################################################
+ # check for debug symbols
+ #################################################
+ if enabled debug; then
+@@ -684,6 +719,8 @@
+ echolog " STRIP $strip"
+ echolog " make $make"
+ echolog " CPU $cpu ($tune)"
++echolog " install sysconf $sysconf"
++echolog " developer options $developer"
+ echolog " debug symbols $debug"
+ echolog " strip symbols $dostrip"
+ echolog " optimize $optimize"
+@@ -724,6 +761,10 @@
+ append_config "LDFLAGS=$LDFLAGS"
+ append_config "INSTALL=$INSTALL"
+
++append_config "INSTALL_SYSCONF=$sysconf"
++append_config "DEVELOPER=$developer"
++append_config "HAVE_CTAGS=$have_ctags"
++append_config "HAVE_ETAGS=$have_etags"
+ append_config "DEBUG=$debug"
+
+
+diff -uNr ushare-1.1a/scripts/Makefile ushare-1.1b/scripts/Makefile
+--- ushare-1.1a/scripts/Makefile 2007-12-09 08:03:36.000000000 -0500
++++ ushare-1.1b/scripts/Makefile 2012-03-25 17:35:07.000000000 -0400
+@@ -3,6 +3,11 @@
+ endif
+ include ../config.mak
+
++INSTALL_RULES =
++ifeq ($(INSTALL_SYSCONF),yes)
++ INSTALL_RULES += install-sysconf
++endif
++
+ CONF_FILE = "ushare.conf"
+ INITD_FILE = "ushare"
+
+@@ -14,7 +19,9 @@
+
+ distclean:
+
+-install:
++install: $(INSTALL_RULES)
++
++install-sysconf:
+ $(INSTALL) -d $(sysconfdir)
+ $(INSTALL) -m 644 $(CONF_FILE) $(sysconfdir)
+ $(INSTALL) -d $(sysconfdir)/init.d
+diff -uNr ushare-1.1a/src/Makefile ushare-1.1b/src/Makefile
+--- ushare-1.1a/src/Makefile 2007-12-09 08:03:36.000000000 -0500
++++ ushare-1.1b/src/Makefile 2012-03-25 17:35:07.000000000 -0400
+@@ -3,6 +3,15 @@
+ endif
+ include ../config.mak
+
++ifeq ($(DEVELOPER),yes)
++ ifeq ($(HAVE_ETAGS),yes)
++ BUILD_RULES += TAGS
++ endif
++ ifeq ($(HAVE_CTAGS),yes)
++ BUILD_RULES += tags
++ endif
++endif
++
+ PROG = ushare
+
+ EXTRADIST = ushare.1 \
+@@ -50,7 +59,7 @@
+
+ .SUFFIXES: .c .o
+
+-all: depend $(PROG)
++all: depend $(BUILD_RULES) $(PROG)
+
+ .c.o:
+ $(CC) -c $(CFLAGS) $(OPTFLAGS) -o $@ $<
+@@ -58,6 +67,14 @@
+ $(PROG): $(OBJS)
+ $(CC) $(OBJS) $(LDFLAGS) $(EXTRALIBS) -o $@
+
++TAGS:
++ @rm -f $@; \
++ ( find -name '*.[chS]' -print ) | xargs etags -a
++
++tags:
++ @rm -f $@; \
++ ( find -name '*.[chS]' -print ) | xargs ctags -a;
++
+ clean:
+ -$(RM) -f *.o $(PROG)
+ -$(RM) -f .depend
diff --git a/media-video/ushare/files/02_all_ushare_build_warnings.patch b/media-video/ushare/files/02_all_ushare_build_warnings.patch
new file mode 100644
index 000000000000..f79e7890f8c0
--- /dev/null
+++ b/media-video/ushare/files/02_all_ushare_build_warnings.patch
@@ -0,0 +1,35 @@
+diff --git a/src/ctrl_telnet.c b/src/ctrl_telnet.c
+index 0849d80..b3e9e8d 100644
+--- a/src/ctrl_telnet.c
++++ b/src/ctrl_telnet.c
+@@ -202,6 +202,7 @@ ctrl_telnet_start (int port)
+ void
+ ctrl_telnet_stop (void)
+ {
++ ssize_t tmp;
+ pthread_mutex_lock (&startstop_lock);
+
+ if (!started)
+@@ -211,7 +212,7 @@ ctrl_telnet_stop (void)
+ }
+
+ /* yes is int, which is bigger then char, so this should be safe */
+- write (ttd.killer[1], &yes, sizeof (char));
++ tmp = write (ttd.killer[1], &yes, sizeof (char));
+
+ pthread_mutex_unlock (&startstop_lock);
+ pthread_join (ttd.thread, NULL);
+diff --git a/src/mime.c b/src/mime.c
+index 66c48ab..bf0121b 100644
+--- a/src/mime.c
++++ b/src/mime.c
+@@ -144,7 +144,8 @@ char *mime_get_protocol (struct mime_type_t *mime)
+ if (!mime)
+ return NULL;
+
+- sprintf (protocol, mime->mime_protocol);
++ //sprintf (protocol, mime->mime_protocol);
++ strcpy (protocol, mime->mime_protocol);
+ strcat (protocol, "*");
+ return strdup (protocol);
+ }
diff --git a/media-video/ushare/files/03_all_ushare_mp4_video_mime.patch b/media-video/ushare/files/03_all_ushare_mp4_video_mime.patch
new file mode 100644
index 000000000000..0edba22cba94
--- /dev/null
+++ b/media-video/ushare/files/03_all_ushare_mp4_video_mime.patch
@@ -0,0 +1,20 @@
+diff --git a/src/mime.c b/src/mime.c
+index bf0121b..f38deca 100644
+--- a/src/mime.c
++++ b/src/mime.c
+@@ -53,6 +53,7 @@ const struct mime_type_t MIME_Type_List[] = {
+ { "mpeg2", UPNP_VIDEO, "http-get:*:video/mpeg2:"},
+ { "m4v", UPNP_VIDEO, "http-get:*:video/mp4:"},
+ { "m4p", UPNP_VIDEO, "http-get:*:video/mp4:"},
++ { "mp4", UPNP_VIDEO, "http-get:*:video/mp4:"},
+ { "mp4ps", UPNP_VIDEO, "http-get:*:video/x-nerodigital-ps:"},
+ { "ts", UPNP_VIDEO, "http-get:*:video/mpeg2:"},
+ { "ogm", UPNP_VIDEO, "http-get:*:video/mpeg:"},
+@@ -79,7 +80,6 @@ const struct mime_type_t MIME_Type_List[] = {
+ { "mp1", UPNP_AUDIO, "http-get:*:audio/mp1:"},
+ { "mp2", UPNP_AUDIO, "http-get:*:audio/mp2:"},
+ { "mp3", UPNP_AUDIO, "http-get:*:audio/mpeg:"},
+- { "mp4", UPNP_AUDIO, "http-get:*:audio/mp4:"},
+ { "m4a", UPNP_AUDIO, "http-get:*:audio/mp4:"},
+ { "ogg", UPNP_AUDIO, "http-get:*:audio/x-ogg:"},
+ { "wav", UPNP_AUDIO, "http-get:*:audio/wav:"},
diff --git a/media-video/ushare/files/04_all_ushare_upnp_build_fix.patch b/media-video/ushare/files/04_all_ushare_upnp_build_fix.patch
new file mode 100644
index 000000000000..c3ec37a324c5
--- /dev/null
+++ b/media-video/ushare/files/04_all_ushare_upnp_build_fix.patch
@@ -0,0 +1,156 @@
+diff -wbBur ushare-1.1a/src/http.c ushare-1.1a.my/src/http.c
+--- ushare-1.1a/src/http.c 2007-12-09 13:03:36.000000000 +0000
++++ ushare-1.1a.my/src/http.c 2010-10-29 11:13:07.000000000 +0000
+@@ -77,8 +77,7 @@
+ info->content_type = ixmlCloneDOMString (content_type);
+ }
+
+-static int
+-http_get_info (const char *filename, struct File_Info *info)
++int http_get_info (const char *filename, struct File_Info *info)
+ {
+ extern struct ushare_t *ut;
+ struct upnp_entry_t *entry = NULL;
+@@ -197,8 +196,7 @@
+ return ((UpnpWebFileHandle) file);
+ }
+
+-static UpnpWebFileHandle
+-http_open (const char *filename, enum UpnpOpenFileMode mode)
++UpnpWebFileHandle http_open (const char *filename, enum UpnpOpenFileMode mode)
+ {
+ extern struct ushare_t *ut;
+ struct upnp_entry_t *entry = NULL;
+@@ -251,8 +249,7 @@
+ return ((UpnpWebFileHandle) file);
+ }
+
+-static int
+-http_read (UpnpWebFileHandle fh, char *buf, size_t buflen)
++int http_read (UpnpWebFileHandle fh, char *buf, size_t buflen)
+ {
+ struct web_file_t *file = (struct web_file_t *) fh;
+ ssize_t len = -1;
+@@ -286,8 +283,7 @@
+ return len;
+ }
+
+-static int
+-http_write (UpnpWebFileHandle fh __attribute__((unused)),
++int http_write (UpnpWebFileHandle fh __attribute__((unused)),
+ char *buf __attribute__((unused)),
+ size_t buflen __attribute__((unused)))
+ {
+@@ -296,8 +292,7 @@
+ return 0;
+ }
+
+-static int
+-http_seek (UpnpWebFileHandle fh, off_t offset, int origin)
++int http_seek (UpnpWebFileHandle fh, off_t offset, int origin)
+ {
+ struct web_file_t *file = (struct web_file_t *) fh;
+ off_t newpos = -1;
+@@ -371,8 +366,7 @@
+ return 0;
+ }
+
+-static int
+-http_close (UpnpWebFileHandle fh)
++int http_close (UpnpWebFileHandle fh)
+ {
+ struct web_file_t *file = (struct web_file_t *) fh;
+
+@@ -402,13 +396,3 @@
+
+ return 0;
+ }
+-
+-struct UpnpVirtualDirCallbacks virtual_dir_callbacks =
+- {
+- http_get_info,
+- http_open,
+- http_read,
+- http_write,
+- http_seek,
+- http_close
+- };
+diff -wbBur ushare-1.1a/src/http.h ushare-1.1a.my/src/http.h
+--- ushare-1.1a/src/http.h 2007-12-09 13:03:36.000000000 +0000
++++ ushare-1.1a.my/src/http.h 2010-10-29 11:13:11.000000000 +0000
+@@ -25,6 +25,13 @@
+ #include <upnp/upnp.h>
+ #include <upnp/upnptools.h>
+
+-struct UpnpVirtualDirCallbacks virtual_dir_callbacks;
++int http_close (UpnpWebFileHandle fh);
++int http_write (UpnpWebFileHandle fh __attribute__((unused)),
++ char *buf __attribute__((unused)),
++ size_t buflen __attribute__((unused)));
++int http_seek (UpnpWebFileHandle fh, off_t offset, int origin);
++UpnpWebFileHandle http_open (const char *filename, enum UpnpOpenFileMode mode);
++int http_read (UpnpWebFileHandle fh, char *buf, size_t buflen);
++int http_get_info (const char *filename, struct File_Info *info);
+
+ #endif /* _HTTP_H_ */
+diff -wbBur ushare-1.1a/src/ushare.c ushare-1.1a.my/src/ushare.c
+--- ushare-1.1a/src/ushare.c 2007-12-09 13:03:36.000000000 +0000
++++ ushare-1.1a.my/src/ushare.c 2010-10-29 11:17:45.000000000 +0000
+@@ -188,7 +188,7 @@
+ if (strcmp (request->DevUDN + 5, ut->udn))
+ return;
+
+- ip = request->CtrlPtIPAddr.s_addr;
++ ip = (*(struct sockaddr_in*)&request->CtrlPtIPAddr).sin_addr.s_addr;
+ ip = ntohl (ip);
+ sprintf (val, "%d.%d.%d.%d",
+ (ip >> 24) & 0xFF, (ip >> 16) & 0xFF, (ip >> 8) & 0xFF, ip & 0xFF);
+@@ -348,7 +348,47 @@
+
+ UpnpEnableWebserver (TRUE);
+
+- res = UpnpSetVirtualDirCallbacks (&virtual_dir_callbacks);
++ res = UpnpVirtualDir_set_WriteCallback(http_write);
++ if (res != UPNP_E_SUCCESS)
++ {
++ log_error (_("Cannot set virtual directory callbacks\n"));
++ free (description);
++ return -1;
++ }
++
++ res = UpnpVirtualDir_set_GetInfoCallback(http_get_info);
++ if (res != UPNP_E_SUCCESS)
++ {
++ log_error (_("Cannot set virtual directory callbacks\n"));
++ free (description);
++ return -1;
++ }
++
++ res = UpnpVirtualDir_set_ReadCallback(http_read);
++ if (res != UPNP_E_SUCCESS)
++ {
++ log_error (_("Cannot set virtual directory callbacks\n"));
++ free (description);
++ return -1;
++ }
++
++ res = UpnpVirtualDir_set_OpenCallback(http_open);
++ if (res != UPNP_E_SUCCESS)
++ {
++ log_error (_("Cannot set virtual directory callbacks\n"));
++ free (description);
++ return -1;
++ }
++
++ res = UpnpVirtualDir_set_SeekCallback(http_seek);
++ if (res != UPNP_E_SUCCESS)
++ {
++ log_error (_("Cannot set virtual directory callbacks\n"));
++ free (description);
++ return -1;
++ }
++
++ res = UpnpVirtualDir_set_CloseCallback(http_close);
+ if (res != UPNP_E_SUCCESS)
+ {
+ log_error (_("Cannot set virtual directory callbacks\n"));
diff --git a/media-video/ushare/files/05_all_missing_headers.patch b/media-video/ushare/files/05_all_missing_headers.patch
new file mode 100644
index 000000000000..0d2f0e8faff9
--- /dev/null
+++ b/media-video/ushare/files/05_all_missing_headers.patch
@@ -0,0 +1,59 @@
+diff -uNr ushare-1.1a.a/src/cds.c ushare-1.1a.b/src/cds.c
+--- ushare-1.1a.a/src/cds.c 2007-12-09 08:03:36.000000000 -0500
++++ ushare-1.1a.b/src/cds.c 2012-05-27 11:28:42.000000000 -0400
+@@ -19,7 +19,9 @@
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
++#include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <upnp/upnp.h>
+ #include <upnp/upnptools.h>
+
+diff -uNr ushare-1.1a.a/src/cms.c ushare-1.1a.b/src/cms.c
+--- ushare-1.1a.a/src/cms.c 2007-12-09 08:03:36.000000000 -0500
++++ ushare-1.1a.b/src/cms.c 2012-05-27 11:25:03.000000000 -0400
+@@ -20,6 +20,7 @@
+ */
+
+ #include <stdlib.h>
++#include <string.h>
+ #include <upnp/upnp.h>
+ #include <upnp/upnptools.h>
+
+diff -uNr ushare-1.1a.a/src/http.c ushare-1.1a.b/src/http.c
+--- ushare-1.1a.a/src/http.c 2012-05-27 11:23:32.000000000 -0400
++++ ushare-1.1a.b/src/http.c 2012-05-27 11:25:13.000000000 -0400
+@@ -25,6 +25,7 @@
+ #include <errno.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <unistd.h>
+ #include <errno.h>
+
+diff -uNr ushare-1.1a.a/src/presentation.c ushare-1.1a.b/src/presentation.c
+--- ushare-1.1a.a/src/presentation.c 2007-12-09 08:03:36.000000000 -0500
++++ ushare-1.1a.b/src/presentation.c 2012-05-27 11:30:08.000000000 -0400
+@@ -18,7 +18,9 @@
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
++#include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+
+ #if HAVE_LANGINFO_CODESET
+ # include <langinfo.h>
+diff -uNr ushare-1.1a.a/src/services.c ushare-1.1a.b/src/services.c
+--- ushare-1.1a.a/src/services.c 2007-12-09 08:03:36.000000000 -0500
++++ ushare-1.1a.b/src/services.c 2012-05-27 11:25:26.000000000 -0400
+@@ -20,6 +20,7 @@
+ */
+
+ #include <stdlib.h>
++#include <string.h>
+ #include <upnp/upnp.h>
+ #include <upnp/upnptools.h>
+
diff --git a/media-video/ushare/files/06_all_ushare_disable_sysconf.patch b/media-video/ushare/files/06_all_ushare_disable_sysconf.patch
new file mode 100644
index 000000000000..c3adf8e54287
--- /dev/null
+++ b/media-video/ushare/files/06_all_ushare_disable_sysconf.patch
@@ -0,0 +1,20 @@
+Do not try to parse the default configuration file as everyting
+should be handled by the /etc/conf.d/ushare file in Gentoo
+Index: ushare-1.1a/src/ushare.c
+===================================================================
+--- ushare-1.1a.orig/src/ushare.c
++++ ushare-1.1a/src/ushare.c
+@@ -813,13 +813,6 @@ main (int argc, char **argv)
+ return EXIT_SUCCESS;
+ }
+
+- if (parse_config_file (ut) < 0)
+- {
+- /* fprintf here, because syslog not yet ready */
+- fprintf (stderr, _("Warning: can't parse file \"%s\".\n"),
+- ut->cfg_file ? ut->cfg_file : SYSCONFDIR "/" USHARE_CONFIG_FILE);
+- }
+-
+ if (ut->xbox360)
+ {
+ char *name;
diff --git a/media-video/ushare/files/07_all_drop_optimizations.patch b/media-video/ushare/files/07_all_drop_optimizations.patch
new file mode 100644
index 000000000000..7a5029f79519
--- /dev/null
+++ b/media-video/ushare/files/07_all_drop_optimizations.patch
@@ -0,0 +1,20 @@
+Index: ushare-1.1a/configure
+===================================================================
+--- ushare-1.1a.orig/configure
++++ ushare-1.1a/configure
+@@ -627,15 +627,6 @@ if enabled debug; then
+ dostrip=no
+ fi
+
+-if enabled optimize; then
+- if test -n "`$cc -v 2>&1 | grep xlc`"; then
+- add_cflags "-O5"
+- add_ldflags "-O5"
+- else
+- add_cflags "-O3"
+- fi
+-fi
+-
+ #################################################
+ # check for locales (optional)
+ #################################################
diff --git a/media-video/ushare/files/ushare.conf.d b/media-video/ushare/files/ushare.conf.d
new file mode 100644
index 000000000000..4779c0f2e2f7
--- /dev/null
+++ b/media-video/ushare/files/ushare.conf.d
@@ -0,0 +1,38 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# User to run ushare daemon (if none, root will be used)
+USHARE_USER="ushare"
+
+# UPNP Friendly Name:
+USHARE_NAME="uShare"
+
+# The interface to bind to:
+USHARE_IFACE="eth0"
+
+# Static ushare port:
+USHARE_PORT=""
+
+# Enable/Disable telnet:
+USHARE_TELNET="yes"
+
+# Choose different telnet port:
+USHARE_TELNET_PORT=""
+
+# Enable/Disable web component:
+USHARE_WEB="yes"
+
+# A List of directories to share, each precieded by '-c':
+USHARE_DIRS=""
+
+# Enable/Disable XboX 360 compliant profile:
+USHARE_XBOX="no"
+
+# Enable/Disable DLNA compliant profile (Playstation3 requires this):
+USHARE_DLNA="no"
+
+# Misc. options:
+USHARE_OPTS=""
+
+# Check ushare --help or man ushare for more options.
diff --git a/media-video/ushare/files/ushare.init.d b/media-video/ushare/files/ushare.init.d
new file mode 100644
index 000000000000..157a1e358842
--- /dev/null
+++ b/media-video/ushare/files/ushare.init.d
@@ -0,0 +1,79 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use net
+}
+
+start() {
+ ebegin "Starting uShare"
+
+ # Sanity check to avoid ushare failling on booting with no
+ # shared dirs
+ if [[ -z "${USHARE_DIRS}" ]] ; then
+ eerror "Please set shared dirs in /etc/conf.d/ushare"
+ return 1
+ fi
+
+ if [[ -z "${USHARE_PORT}" ]] ; then
+ einfo "${USHARE_NAME} runs on a dynamic port"
+ local ushare_port=
+ else
+ local ushare_port="--port ${USHARE_PORT}"
+ einfo "${USHARE_NAME} using port ${USHARE_PORT}"
+ fi
+
+ if [[ "${USHARE_TELNET}" == "yes" ]] ; then
+ local ushare_telnet=
+ else
+ local ushare_telnet="--no-telnet"
+ fi
+
+ if [[ -z "${ushare_telnet}" ]] ; then
+ if [[ -z "${USHARE_TELNET_PORT}" ]] ; then
+ local ushare_telnet_port=
+ einfo "${USHARE_NAME} runs telnet on the default port"
+ else
+ local ushare_telnet_port="--telnet-port ${USHARE_TELNET_PORT}"
+ einfo "${USHARE_NAME} runs telnet on port ${USHARE_TELNET_PORT}"
+ fi
+ else
+ local ushare_telnet_port=
+ fi
+
+ if [[ "${USHARE_WEB}" == "yes" ]] ; then
+ local ushare_web=
+ else
+ local ushare_web="--no-web"
+ fi
+
+ if [[ "${USHARE_XBOX}" == "yes" ]] ; then
+ local ushare_xbox="--xbox"
+ else
+ local ushare_xbox=
+ fi
+
+ if [[ "${USHARE_DLNA}" == "yes" ]] ; then
+ local ushare_dlna="--dlna"
+ else
+ local ushare_dlna=
+ fi
+
+ start-stop-daemon --start --quiet -u ${USHARE_USER:-root} \
+ --exec /usr/bin/ushare -- -D -i ${USHARE_IFACE} \
+ -n ${USHARE_NAME} ${USHARE_OPTS} ${USHARE_DIRS} \
+ ${ushare_port} \
+ ${ushare_telnet} ${ushare_telnet_port} \
+ ${ushare_web} \
+ ${ushare_xbox} \
+ ${ushare_dlna}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping uShare"
+ start-stop-daemon --stop --quiet --exec /usr/bin/ushare
+ eend $?
+}
diff --git a/media-video/ushare/files/ushare.init.d.ng b/media-video/ushare/files/ushare.init.d.ng
new file mode 100644
index 000000000000..5349c4bb353f
--- /dev/null
+++ b/media-video/ushare/files/ushare.init.d.ng
@@ -0,0 +1,36 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use net
+}
+
+start() {
+ ebegin "Starting uShare"
+
+ if [ ! -f /etc/ushare.conf -a -f /etc/conf.d/ushare ]; then
+ ewarn "Please migrate your settings from"
+ ewarn "/etc/conf.d/ushare to the new /etc/ushare.conf file"
+ ewarn "and then delete the /etc/conf.d/ushare file."
+ eerror "User migration steps are needed!"
+ fi
+
+ if [ -f /etc/ushare.conf -a -f /etc/conf.d/ushare ]; then
+ ewarn "Old configuration file /etc/conf.d/ushare detected!"
+ ewarn "Please migrate your settings to the new /etc/ushare.conf file"
+ ewarn "and then delete the old one."
+ eerror "User migration steps are needed!"
+ fi
+
+ start-stop-daemon --start --quiet -u ushare \
+ --exec /usr/bin/ushare -- -D --cfg=/etc/ushare.conf
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping uShare"
+ start-stop-daemon --stop --quiet --exec /usr/bin/ushare
+ eend $?
+}
diff --git a/media-video/ushare/files/ushare.service b/media-video/ushare/files/ushare.service
new file mode 100644
index 000000000000..a1ea1080fce6
--- /dev/null
+++ b/media-video/ushare/files/ushare.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Ushare Media Server
+Requires=network.target
+
+[Service]
+Type=forking
+User=ushare
+ExecStart=/usr/bin/ushare -D --cfg=/etc/ushare.conf
+
+[Install]
+WantedBy=multi-user.target