diff options
Diffstat (limited to 'package/gmediaserver')
-rw-r--r-- | package/gmediaserver/Config.in | 13 | ||||
-rw-r--r-- | package/gmediaserver/Makefile | 37 | ||||
-rw-r--r-- | package/gmediaserver/files/gmediaserver.init | 25 | ||||
-rw-r--r-- | package/gmediaserver/ipkg/gmediaserver.control | 5 | ||||
-rw-r--r-- | package/gmediaserver/ipkg/gmediaserver.postinst | 4 | ||||
-rw-r--r-- | package/gmediaserver/patches/patch-src_main_c | 158 |
6 files changed, 242 insertions, 0 deletions
diff --git a/package/gmediaserver/Config.in b/package/gmediaserver/Config.in new file mode 100644 index 000000000..fc256a0cd --- /dev/null +++ b/package/gmediaserver/Config.in @@ -0,0 +1,13 @@ +config ADK_PACKAGE_GMEDIASERVER + prompt "gmediaserver...................... An UPnP music media server" + tristate + default n + depends on ADK_CXX + select ADK_PACKAGE_ID3LIB + select ADK_PACKAGE_LIBUPNP + help + An UPnP music media server. + + http://www.nongnu.org/gmediaserver/ + + Depends: id3lib, libupnp diff --git a/package/gmediaserver/Makefile b/package/gmediaserver/Makefile new file mode 100644 index 000000000..8fda74940 --- /dev/null +++ b/package/gmediaserver/Makefile @@ -0,0 +1,37 @@ +# $Id$ +#- +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include ${TOPDIR}/rules.mk + +PKG_NAME:= gmediaserver +PKG_VERSION:= 0.13.0 +PKG_RELEASE:= 1 +PKG_MD5SUM:= c422de386331e2a1a859d45f6fa270a3 +MASTER_SITES:= http://savannah.nongnu.org/download/gmediaserver/ + +include ${TOPDIR}/mk/package.mk + +$(eval $(call PKG_template,GMEDIASERVER,gmediaserver,${PKG_VERSION}-${PKG_RELEASE},${ARCH})) + +CONFIGURE_STYLE= gnu +CONFIGURE_ENV+= LIBS=" -lixml -lthreadutil -lupnp -lz" \ + am_cv_func_iconv=no +CONFIGURE_ARGS+= --with-id3lib="${STAGING_DIR}/usr" \ + --with-libupnp="${STAGING_DIR}/usr" +BUILD_STYLE= auto +INSTALL_STYLE= auto + +ifeq ($(ADK_TARGET_LIB_UCLIBCXX),y) +CONFIGURE_ENV+= LIBS=" -lixml -lthreadutil -lupnp -luClibc++ -lz" +endif + +post-install: + ${INSTALL_DIR} ${IDIR_GMEDIASERVER}/etc/init.d + ${INSTALL_BIN} ./files/gmediaserver.init \ + ${IDIR_GMEDIASERVER}/etc/init.d/gmediaserver + ${INSTALL_DIR} ${IDIR_GMEDIASERVER}/usr/sbin + ${INSTALL_BIN} ${WRKINST}/usr/bin/gmediaserver ${IDIR_GMEDIASERVER}/usr/sbin/ + +include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/gmediaserver/files/gmediaserver.init b/package/gmediaserver/files/gmediaserver.init new file mode 100644 index 000000000..3ce0ac09d --- /dev/null +++ b/package/gmediaserver/files/gmediaserver.init @@ -0,0 +1,25 @@ +#!/bin/sh +#FWINIT 60 +. /etc/rc.conf + +case $1 in +autostop) ;; + autostart) + test x"${gmediaserver:-NO}" = x"NO" && exit 0 + exec sh $0 start + ;; + start) + gmediaserver $gmediaserver_flags + ;; + stop) + killall gmediaserver + ;; + restart) + sh $0 stop + sh $0 start + ;; + *) + echo "usage: $0 (start | stop | restart)" + exit 1 +esac +exit $? diff --git a/package/gmediaserver/ipkg/gmediaserver.control b/package/gmediaserver/ipkg/gmediaserver.control new file mode 100644 index 000000000..6ba003f5a --- /dev/null +++ b/package/gmediaserver/ipkg/gmediaserver.control @@ -0,0 +1,5 @@ +Package: gmediaserver +Priority: optional +Section: net +Depends: id3lib, libupnp +Description: An UPnP music media server. diff --git a/package/gmediaserver/ipkg/gmediaserver.postinst b/package/gmediaserver/ipkg/gmediaserver.postinst new file mode 100644 index 000000000..1d2338cb0 --- /dev/null +++ b/package/gmediaserver/ipkg/gmediaserver.postinst @@ -0,0 +1,4 @@ +#!/bin/sh +. $IPKG_INSTROOT/etc/functions.sh +add_rcconf gmediaserver gmediaserver NO +add_rcconf gmediaserver_flags gmediaserver_flags "--background --interface=eth0.0" diff --git a/package/gmediaserver/patches/patch-src_main_c b/package/gmediaserver/patches/patch-src_main_c new file mode 100644 index 000000000..1348a67c8 --- /dev/null +++ b/package/gmediaserver/patches/patch-src_main_c @@ -0,0 +1,158 @@ +$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ +--- gmediaserver-0.13.0.orig/src/main.c 2007-10-20 11:41:37.000000000 +0200 ++++ gmediaserver-0.13.0/src/main.c 2008-10-28 12:14:59.000000000 +0100 +@@ -32,8 +32,10 @@ + #include <stdbool.h> /* Gnulib, C99 */ + #include <signal.h> /* ? */ + #include <locale.h> /* ? */ ++#ifdef HAVE_ICONV + #include <iconv.h> /* Gnulib, POSIX */ + #include "striconv.h" /* Gnulib */ ++#endif + #ifdef HAVE_NL_LANGINFO + #include <langinfo.h> + #endif +@@ -72,9 +74,11 @@ enum { + static const char *short_options = "bv::i:o:p:"; + static struct option long_options[] = { + { "disable-tags", no_argument, NULL, OPT_DISABLE_TAGS }, ++#ifdef HAVE_ICONV + { "fs-charset", required_argument, NULL, OPT_FS_CHARSET }, + { "device-charset", required_argument, NULL, OPT_DEVICE_CHARSET }, + { "log-charset", required_argument, NULL, OPT_LOG_CHARSET }, ++#endif + { "friendly-name", required_argument, NULL, OPT_FRIENDLY_NAME }, + { "pid-file", required_argument, NULL, OPT_PIDFILE }, + { "profile", required_argument, NULL, OPT_PROFILE, }, +@@ -92,14 +96,17 @@ static struct option long_options[] = { + { NULL, 0, NULL, 0 } + }; + ++#ifdef HAVE_ICONV + static iconv_t utf8_to_device = (iconv_t) -1; + static iconv_t utf8_to_log = (iconv_t) -1; + static iconv_t fs_to_utf8 = (iconv_t) -1; ++#endif + const char version_etc_copyright[] = "Copyright (C) 2005, 2006 Oskar Liljeblad."; + + char * + convert_string_to_device(const char *str) + { ++#ifdef HAVE_ICONV + char *out; + if (utf8_to_device == (iconv_t) -1) + return xstrdup(str); +@@ -107,12 +114,15 @@ convert_string_to_device(const char *str + if (out != NULL) + return out; + warn(_("%s: cannot convert to device character set: %s\n"), quotearg(str), errstr); ++#else + return xstrdup(str); ++#endif + } + + char * + convert_string_to_log(const char *str) + { ++#ifdef HAVE_ICONV + char *out; + + if (utf8_to_log == (iconv_t) -1) +@@ -121,7 +131,9 @@ convert_string_to_log(const char *str) + if (out != NULL) + return out; + /* Cannot warn here - would deadlock! */ ++#else + return xstrdup(str); ++#endif + } + + static char *cache_fs_str = NULL; +@@ -129,6 +141,7 @@ static char *cache_fs_str = NULL; + char * + conv_filename(const char *str) + { ++#ifdef HAVE_ICONV + free(cache_fs_str); + if (fs_to_utf8 == (iconv_t) -1) { + cache_fs_str = xstrdup(str); +@@ -140,6 +153,9 @@ conv_filename(const char *str) + } + } + return cache_fs_str; ++#else ++ return xstrdup(str); ++#endif + } + + static void +@@ -188,8 +204,10 @@ main(int argc, char **argv) + set_program_name(argv[0]); + set_quoting_style(0, escape_quoting_style); + ++#ifdef LOCALE + if (setlocale(LC_ALL, "") == NULL) + warn(_("cannot set locale: %s\n"), errstr); ++#endif + #ifdef ENABLE_NLS + if (bindtextdomain(PACKAGE, LOCALEDIR) == NULL) + warn(_("cannot bind message domain: %s\n"), errstr); +@@ -215,6 +233,7 @@ main(int argc, char **argv) + case OPT_DISABLE_TAGS: + tags_enabled = false; + break; ++#ifdef HAVE_ICONV + case OPT_FS_CHARSET: + fs_charset = optarg; + break; +@@ -224,6 +243,7 @@ main(int argc, char **argv) + case OPT_LOG_CHARSET: + log_charset = optarg; + break; ++#endif + case OPT_FRIENDLY_NAME: + if (optarg[0] == '\0') + die(_("friendly name cannot be empty\n")); +@@ -294,9 +314,11 @@ main(int argc, char **argv) + printf(_("Run the UPnP media server.\n\n")); + printf(_(" --friendly-name=NAME set display name for media server\n")); + printf(_(" --disable-tags do not scan files for tags\n")); ++#ifdef HAVE_ICONV + printf(_(" --fs-charset=CHARSET character set used in file names\n")); + printf(_(" --device-charset=CHARSET character set used in the player device\n")); + printf(_(" --log-charset=CHARSET character set used in logs and display\n")); ++#endif + printf(_(" -v, --verbose[=LEVEL] set verbosity level (0-4)\n")); + printf(_(" --pid-file=FILE write pid to FILE when up and running\n")); + printf(_(" -i, --interface=NAME listen on a specific interface\n")); +@@ -371,6 +393,7 @@ main(int argc, char **argv) + if (fs_charset == NULL && getenv("G_BROKEN_FILENAMES") != NULL) + fs_charset = nl_langinfo(CODESET); + #endif ++#ifdef HAVE_ICONV + if (fs_charset != NULL) { + fs_to_utf8 = iconv_open("UTF-8", fs_charset); + if (fs_to_utf8 == (iconv_t) -1) +@@ -395,6 +418,7 @@ main(int argc, char **argv) + die(_("cannot create character set convertor from %s to %s\n"), "UTF-8", quotearg(log_charset)); + } + say(4, _("Using log character set %s\n"), quote(log_charset == NULL ? "UTF-8" : log_charset)); ++#endif + + init_logging(logfilename, timestamp_format); + +@@ -478,12 +502,14 @@ main(int argc, char **argv) + + finish_logging(true); + ++#ifdef HAVE_ICONV + if (fs_to_utf8 != (iconv_t) -1) + iconv_close(fs_to_utf8); /* ignore errors (only EINVAL) */ + if (utf8_to_device != (iconv_t) -1) + iconv_close(utf8_to_device); /* ignore errors (only EINVAL) */ + if (utf8_to_log != (iconv_t) -1) + iconv_close(utf8_to_log); /* ignore errors (only EINVAL) */ ++#endif + + free(cache_fs_str); + |