add gmediaserver package

SVN-Revision: 1796
This commit is contained in:
Nicolas Thill 2005-08-30 12:49:43 +00:00
parent 2adaa6a3d7
commit 6de5d27e7d
9 changed files with 229 additions and 0 deletions

View file

@ -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 ---"

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -0,0 +1 @@
OPTIONS="--background --interface=br0 --pid-file=$PID_F"

View file

@ -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 $?

View file

@ -0,0 +1 @@
/etc/default/gmediaserver

View file

@ -0,0 +1,7 @@
Package: gmediaserver
Priority: optional
Section: net
Maintainer: OpenWrt Developers Team <bugs@openwrt.org>
Source: http://openwrt.org/cgi-bin/viewcvs.cgi/openwrt/package/gmediaserver/
Depends: id3lib, libupnp
Description: An UPnP music media server.

View file

@ -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 <stdarg.h> /* C89 */
#include <stdbool.h> /* Gnulib, C99 */
#include <signal.h> /* ? */
+#ifdef HAVE_ICONV
#include <iconv.h> /* Gnulib, POSIX */
#include "iconvme.h" /* Gnulib */
+#endif
#ifdef HAVE_NL_LANGINFO
#include <langinfo.h>
#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);