From 6de5d27e7dcd7c1f86acd5af989268014ebfcb24 Mon Sep 17 00:00:00 2001 From: Nicolas Thill Date: Tue, 30 Aug 2005 12:49:43 +0000 Subject: [PATCH] add gmediaserver package SVN-Revision: 1796 --- openwrt/package/Config.in | 1 + openwrt/package/Makefile | 2 + openwrt/package/gmediaserver/Config.in | 15 +++ openwrt/package/gmediaserver/Makefile | 75 +++++++++++++ .../gmediaserver/files/gmediaserver.default | 1 + .../gmediaserver/files/gmediaserver.init | 21 ++++ .../gmediaserver/ipkg/gmediaserver.conffiles | 1 + .../gmediaserver/ipkg/gmediaserver.control | 7 ++ .../gmediaserver/patches/no_iconv.patch | 106 ++++++++++++++++++ 9 files changed, 229 insertions(+) create mode 100644 openwrt/package/gmediaserver/Config.in create mode 100644 openwrt/package/gmediaserver/Makefile create mode 100644 openwrt/package/gmediaserver/files/gmediaserver.default create mode 100644 openwrt/package/gmediaserver/files/gmediaserver.init create mode 100644 openwrt/package/gmediaserver/ipkg/gmediaserver.conffiles create mode 100644 openwrt/package/gmediaserver/ipkg/gmediaserver.control create mode 100644 openwrt/package/gmediaserver/patches/no_iconv.patch diff --git a/openwrt/package/Config.in b/openwrt/package/Config.in index 921db87fb61..4cd7c031656 100644 --- a/openwrt/package/Config.in +++ b/openwrt/package/Config.in @@ -162,6 +162,7 @@ source "package/zlib/Config.in" source "package/irssi/Config.in" comment "Multimedia ---" +source "package/gmediaserver/Config.in" source "package/mt-daapd/Config.in" comment "Serial communications & terminal emulation ---" diff --git a/openwrt/package/Makefile b/openwrt/package/Makefile index d74547af353..22bd757ce66 100644 --- a/openwrt/package/Makefile +++ b/openwrt/package/Makefile @@ -42,6 +42,7 @@ package-$(BR2_PACKAGE_FRICKIN) += frickin package-$(BR2_PACKAGE_FUSE) += fuse package-$(BR2_PACKAGE_GDBSERVER) += gdbserver package-$(BR2_PACKAGE_GLIB) += glib +package-$(BR2_PACKAGE_GMEDIASERVER) += gmediaserver package-$(BR2_PACKAGE_GMP) += gmp package-$(BR2_COMPILE_GNUTLS) += gnutls package-$(BR2_PACKAGE_HASERL) += haserl @@ -194,6 +195,7 @@ dsniff-compile: libnids-compile openssl-compile libgdbm-compile freetype-compile: zlib-compile fprobe-compile: libpcap-compile gdbserver-compile: ncurses-compile +gmediaserver-compile: id3lib-compile libupnp-compile gnutls-compile: libgcrypt-compile opencdk-compile libtasn1-compile id3lib-compile: uclibc++-compile zlib-compile irssi-compile: glib-compile ncurses-compile diff --git a/openwrt/package/gmediaserver/Config.in b/openwrt/package/gmediaserver/Config.in new file mode 100644 index 00000000000..ddab10abfab --- /dev/null +++ b/openwrt/package/gmediaserver/Config.in @@ -0,0 +1,15 @@ +config BR2_PACKAGE_GMEDIASERVER + prompt "gmediaserver - An UPnP music media server" + tristate +# default m if CONFIG_DEVEL + default n + select BR2_PACKAGE_ID3LIB + select BR2_PACKAGE_LIBUPNP + help + An UPnP music media server. + + http://www.nongnu.org/gmediaserver/ + + Depends: id3lib, libupnp + + diff --git a/openwrt/package/gmediaserver/Makefile b/openwrt/package/gmediaserver/Makefile new file mode 100644 index 00000000000..c5c19369515 --- /dev/null +++ b/openwrt/package/gmediaserver/Makefile @@ -0,0 +1,75 @@ +# $Id$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=gmediaserver +PKG_VERSION:=0.7.0 +PKG_RELEASE:=1 +PKG_MD5SUM:=08d3d0274ff7b37b135d6f21b47cb3c5 + +PKG_SOURCE_URL:=http://savannah.nongnu.org/download/gmediaserver/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install + +BR2_PACKAGE_GMEDIASERVER=m + +include $(TOPDIR)/package/rules.mk + +$(eval $(call PKG_template,GMEDIASERVER,gmediaserver,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) + +$(PKG_BUILD_DIR)/.configured: + (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \ + LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \ + LIBS=" -lixml -lthreadutil -lupnp -luClibc++ -lz" \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --program-prefix="" \ + --program-suffix="" \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --datadir=/usr/share \ + --includedir=/usr/include \ + --infodir=/usr/share/info \ + --libdir=/usr/lib \ + --libexecdir=/usr/lib \ + --localstatedir=/var \ + --mandir=/usr/share/man \ + --sbindir=/usr/sbin \ + --sysconfdir=/etc \ + $(DISABLE_LARGEFILE) \ + $(DISABLE_NLS) \ + --enable-shared \ + --disable-static \ + --disable-rpath \ + --with-id3lib="$(STAGING_DIR)/usr" \ + --with-libupnp="$(STAGING_DIR)/usr" \ + ) + touch $@ + +$(PKG_BUILD_DIR)/.built: + rm -rf $(PKG_INSTALL_DIR) + mkdir -p $(PKG_INSTALL_DIR) + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install + touch $@ + +$(IPKG_GMEDIASERVER): + install -m0755 -d $(IDIR_GMEDIASERVER)/etc/default + install -m0644 ./files/gmediaserver.default $(IDIR_GMEDIASERVER)/etc/default/gmediaserver + install -m0755 -d $(IDIR_GMEDIASERVER)/etc/init.d + install -m0755 ./files/gmediaserver.init $(IDIR_GMEDIASERVER)/etc/init.d/gmediaserver + install -m0755 -d $(IDIR_GMEDIASERVER)/usr/sbin + cp -fpR $(PKG_INSTALL_DIR)/usr/bin/gmediaserver $(IDIR_GMEDIASERVER)/usr/sbin/ + $(RSTRIP) $(IDIR_GMEDIASERVER) + $(IPKG_BUILD) $(IDIR_GMEDIASERVER) $(PACKAGE_DIR) + diff --git a/openwrt/package/gmediaserver/files/gmediaserver.default b/openwrt/package/gmediaserver/files/gmediaserver.default new file mode 100644 index 00000000000..d130f912d53 --- /dev/null +++ b/openwrt/package/gmediaserver/files/gmediaserver.default @@ -0,0 +1 @@ +OPTIONS="--background --interface=br0 --pid-file=$PID_F" diff --git a/openwrt/package/gmediaserver/files/gmediaserver.init b/openwrt/package/gmediaserver/files/gmediaserver.init new file mode 100644 index 00000000000..1582b37cc95 --- /dev/null +++ b/openwrt/package/gmediaserver/files/gmediaserver.init @@ -0,0 +1,21 @@ +#!/bin/sh + +BIN=gmediaserver +DEFAULT=/etc/default/$BIN +RUN_D=/var/run +PID_F=$RUN_D/$BIN.pid +[ -f $DEFAULT ] && . $DEFAULT + +case $1 in + start) + $BIN $OPTIONS + ;; + stop) + [ -f $PID_F ] && kill $(cat $PID_F) + ;; + *) + echo "usage: $0 (start|stop)" + exit 1 +esac + +exit $? diff --git a/openwrt/package/gmediaserver/ipkg/gmediaserver.conffiles b/openwrt/package/gmediaserver/ipkg/gmediaserver.conffiles new file mode 100644 index 00000000000..d915334a35d --- /dev/null +++ b/openwrt/package/gmediaserver/ipkg/gmediaserver.conffiles @@ -0,0 +1 @@ +/etc/default/gmediaserver diff --git a/openwrt/package/gmediaserver/ipkg/gmediaserver.control b/openwrt/package/gmediaserver/ipkg/gmediaserver.control new file mode 100644 index 00000000000..c8c2784ffb6 --- /dev/null +++ b/openwrt/package/gmediaserver/ipkg/gmediaserver.control @@ -0,0 +1,7 @@ +Package: gmediaserver +Priority: optional +Section: net +Maintainer: OpenWrt Developers Team +Source: http://openwrt.org/cgi-bin/viewcvs.cgi/openwrt/package/gmediaserver/ +Depends: id3lib, libupnp +Description: An UPnP music media server. diff --git a/openwrt/package/gmediaserver/patches/no_iconv.patch b/openwrt/package/gmediaserver/patches/no_iconv.patch new file mode 100644 index 00000000000..735b3111a9a --- /dev/null +++ b/openwrt/package/gmediaserver/patches/no_iconv.patch @@ -0,0 +1,106 @@ +--- gmediaserver-0.7.0/src/main.c.orig 2005-08-29 21:15:01.000000000 +0200 ++++ gmediaserver-0.7.0/src/main.c 2005-08-30 12:37:40.000000000 +0200 +@@ -31,8 +31,10 @@ + #include /* C89 */ + #include /* Gnulib, C99 */ + #include /* ? */ ++#ifdef HAVE_ICONV + #include /* Gnulib, POSIX */ + #include "iconvme.h" /* Gnulib */ ++#endif + #ifdef HAVE_NL_LANGINFO + #include + #endif +@@ -70,8 +72,10 @@ + #ifdef HAVE_ID3LIB + { "disable-id3", no_argument, NULL, OPT_DISABLE_ID3 }, + #endif ++#ifdef HAVE_ICONV + { "in-charset", required_argument, NULL, OPT_IN_CHARSET }, + { "device-charset", required_argument, NULL, OPT_DEVICE_CHARSET }, ++#endif + { "friendly-name", required_argument, NULL, OPT_FRIENDLY_NAME }, + { "pid-file", required_argument, NULL, OPT_PIDFILE }, + { "profile", required_argument, NULL, OPT_PROFILE, }, +@@ -89,15 +93,21 @@ + { NULL, 0, NULL, 0 } + }; + ++#ifdef HAVE_ICONV + iconv_t charset_convert = (iconv_t) -1; ++#endif + const char version_etc_copyright[] = "Copyright (C) 2005 Oskar Liljeblad."; + + char * + convert_string(const char *str) + { ++#ifdef HAVE_ICONV + if (charset_convert == (iconv_t) -1) + return xstrdup(str); + return iconv_alloc(charset_convert, str); ++#else ++ return xstrdup(str); ++#endif + } + + static void +@@ -139,13 +149,17 @@ + char *logfilename = NULL; + char *timestamp_format = NULL; + uint32_t expire_time; ++#ifdef HAVE_ICONV + char *in_charset = NULL; + char *device_charset = NULL; ++#endif + + set_program_name(argv[0]); + ++#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); +@@ -173,12 +187,14 @@ + id3_enabled = false; + break; + #endif ++#ifdef HAVE_ICONV + case OPT_IN_CHARSET: + in_charset = optarg; + break; + case OPT_DEVICE_CHARSET: + device_charset = optarg; + break; ++#endif + case OPT_FRIENDLY_NAME: + if (optarg[0] == '\0') + die(_("friendly name cannot be empty\n")); +@@ -319,6 +335,7 @@ + + init_logging(logfilename, timestamp_format); + ++#ifdef HAVE_ICONV + if (device_charset != NULL) { + if (in_charset == NULL) { + #ifdef HAVE_NL_LANGINFO +@@ -335,6 +352,7 @@ + if (charset_convert == (iconv_t) -1) + die(_("cannot create character set convertor\nTry using another value for --in-charset or --device-charset\n")); + } ++#endif + + /* We could write pid before initiating logging too. + */ +@@ -396,8 +414,10 @@ + if (pidfilename != NULL) + unlink(pidfilename); /* ignore errors */ + ++#ifdef HAVE_ICONV + if (charset_convert != (iconv_t) -1) + iconv_close(charset_convert); /* ignore errors (only EINVAL) */ ++#endif + + finish_logging(true); +