--- /dev/null
+#
+# Copyright (C) 2007 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gmediaserver
+PKG_VERSION:=0.13.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://savannah.nongnu.org/download/gmediaserver/
+PKG_MD5SUM:=c422de386331e2a1a859d45f6fa270a3
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/gmediaserver
+ SECTION:=multimedia
+ CATEGORY:=Multimedia
+ DEPENDS:=+id3lib +libmagic +file +libupnp +libuuid +uclibcxx +zlib $(ICONV_DEPENDS)
+ TITLE:=An UPnP music media server
+ URL:=http://www.nongnu.org/gmediaserver/
+endef
+
+define Package/gmediaserver/description
+ GMediaServer is a server for UPnP media players like the
+ Netgear MP101, Linksys WMLS11B etc. It exports one or more
+ directories using the UPnP protocol so the mediaserver can
+ browse through them and play audio or video files.
+endef
+
+CONFIGURE_ARGS += \
+ --disable-rpath \
+ --enable-threads=posix \
+ --with-libiconv-prefix="$(ICONV_PREFIX)" \
+ --without-libintl-prefix \
+ --with-id3lib="$(STAGING_DIR)/usr" \
+ --with-libupnp="$(STAGING_DIR)/usr" \
+ , \
+ LIBS=" -luClibc++ -lz" \
+
+MAKE_FLAGS += \
+ AR="$(TARGET_CROSS)ar" \
+ LTLIBICONV="" \
+ DESTDIR="$(PKG_INSTALL_DIR)"
+
+define Package/gmediaserver/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/sbin/
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
+endef
+
+$(eval $(call BuildPackage,gmediaserver))
--- /dev/null
+config gmediaserver
+ option content_directory '/tmp'
+ option interface 'br-lan'
--- /dev/null
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+START=50
+
+BIN=gmediaserver
+DEFAULT=/etc/default/$BIN
+RUN_D=/var/run
+PID_F=$RUN_D/$BIN.pid
+
+start() {
+ mkdir -p $RUN_D
+ config_load gmediaserver
+ config_foreach start_service gmediaserver
+}
+
+start_service() {
+ local cfg="$1"
+ config_get content_directory "$cfg" content_directory
+ config_get interface "$cfg" interface
+
+ $BIN --background --interface=${interface:-br-lan} --pid-file=$PID_F ${content_directory:-/tmp}
+}
+
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
+
--- /dev/null
+--- a/src/upnp.c
++++ b/src/upnp.c
+@@ -36,6 +36,7 @@
+ #include <uuid/uuid.h>
+ #include "intutil.h"
+ #include "gmediaserver.h"
++#include "webserver.h"
+ #include "schemas/MediaServer.h"
+
+ #define GMEDIASERVER_SSDP_PAUSE 100
+@@ -265,7 +266,7 @@ handle_get_var_request(struct Upnp_State
+ say(3, _("Event device UDN: %s\n"), quotearg(request->DevUDN));
+ say(3, _("Event service ID: %s\n"), quotearg(request->ServiceID));
+ say(3, _("Event variable name: %s\n"), quotearg(request->StateVarName));
+- say(3, _("Event source: %s\n"), inet_ntoa(request->CtrlPtIPAddr));
++ say(3, _("Event source: %s\n"), inet_ntoa((*(struct sockaddr_in *)&request->CtrlPtIPAddr).sin_addr));
+
+ if (strcmp(request->DevUDN, device_udn) != 0) {
+ say(1, _("Discarding event - event device UDN (%s) not recognized\n"), quotearg(request->DevUDN));
+@@ -306,7 +307,7 @@ handle_action_request(struct Upnp_Action
+ say(3, _("Event device UDN: %s\n"), quotearg(request->DevUDN));
+ say(3, _("Event service ID: %s\n"), quotearg(request->ServiceID));
+ say(3, _("Event action name: %s\n"), quotearg(request->ActionName));
+- say(3, _("Event source: %s\n"), inet_ntoa(request->CtrlPtIPAddr));
++ say(3, _("Event source: %s\n"), inet_ntoa((*(struct sockaddr_in *)&request->CtrlPtIPAddr).sin_addr));
+ say_document(4, _("Event action request:\n"), request->ActionRequest);
+
+ if (strcmp(request->DevUDN, device_udn) != 0) {
+@@ -502,9 +503,24 @@ init_upnp(const char *listenip, uint16_t
+ res = UpnpEnableWebserver(TRUE);
+ if (res != UPNP_E_SUCCESS)
+ die(_("cannot enable UPnP web server - %s\n"), upnp_errmsg(res));
+- res = UpnpSetVirtualDirCallbacks(&virtual_dir_callbacks);
+- if (res != UPNP_E_SUCCESS)
+- die(_("cannot set virtual directory callbacks - %s\n"), upnp_errmsg(res));
++
++#define upnp_set_callback(cb, func) \
++ do { \
++ res = UpnpVirtualDir_set_##cb##Callback(func); \
++ if (res != UPNP_E_SUCCESS) \
++ { \
++ die(_("cannot set virtual directory callbacks - %s\n"), \
++ upnp_errmsg(res)); \
++ } \
++ } while(0)
++
++ upnp_set_callback(GetInfo, webserver_get_info);
++ upnp_set_callback(Open, webserver_open);
++ upnp_set_callback(Read, webserver_read);
++ upnp_set_callback(Seek, webserver_seek);
++ upnp_set_callback(Write, webserver_write);
++ upnp_set_callback(Close, webserver_close);
++
+ res = UpnpAddVirtualDir("/files");
+ if (res != UPNP_E_SUCCESS)
+ die(_("cannot add virtual directory for web server - %s\n"), upnp_errmsg(res));
+--- a/src/webserver.c
++++ b/src/webserver.c
+@@ -83,7 +83,7 @@ get_entry_from_url(const char *filename)
+ return get_entry_by_id(id);
+ }
+
+-static int
++int
+ webserver_get_info(const char *filename, struct File_Info *info)
+ {
+ Entry *entry;
+@@ -180,7 +180,7 @@ webserver_get_info(const char *filename,
+ return -1;
+ }
+
+-static UpnpWebFileHandle
++UpnpWebFileHandle
+ webserver_open(const char *filename, enum UpnpOpenFileMode mode)
+ {
+ Entry *entry;
+@@ -277,7 +277,7 @@ webserver_open(const char *filename, enu
+ return NULL;
+ }
+
+-static int
++int
+ webserver_read(UpnpWebFileHandle fh, char *buf, size_t buflen)
+ {
+ WebServerFile *file = (WebServerFile *) fh;
+@@ -307,7 +307,7 @@ webserver_read(UpnpWebFileHandle fh, cha
+ return len;
+ }
+
+-static int
++int
+ webserver_write(UpnpWebFileHandle fh, char *buf, size_t buflen)
+ {
+ WebServerFile *file = (WebServerFile *) fh;
+@@ -317,7 +317,7 @@ webserver_write(UpnpWebFileHandle fh, ch
+ return -1;
+ }
+
+-static int
++int
+ webserver_seek(UpnpWebFileHandle fh, off_t offset, int origin)
+ {
+ WebServerFile *file = (WebServerFile *) fh;
+@@ -396,7 +396,7 @@ webserver_seek(UpnpWebFileHandle fh, off
+ return 0;
+ }
+
+-static int
++int
+ webserver_close(UpnpWebFileHandle fh)
+ {
+ WebServerFile *file = (WebServerFile *) fh;
+@@ -419,12 +419,3 @@ webserver_close(UpnpWebFileHandle fh)
+
+ return 0;
+ }
+-
+-struct UpnpVirtualDirCallbacks virtual_dir_callbacks = {
+- webserver_get_info,
+- webserver_open,
+- webserver_read,
+- webserver_write,
+- webserver_seek,
+- webserver_close
+-};
+--- /dev/null
++++ b/src/webserver.h
+@@ -0,0 +1,6 @@
++int webserver_get_info(const char *filename, struct File_Info *info);
++UpnpWebFileHandle webserver_open(const char *filename, enum UpnpOpenFileMode mode);
++int webserver_read(UpnpWebFileHandle fh, char *buf, size_t buflen);
++int webserver_write(UpnpWebFileHandle fh, char *buf, size_t buflen);
++int webserver_seek(UpnpWebFileHandle fh, off_t offset, int origin);
++int webserver_close(UpnpWebFileHandle fh);
+--- a/src/contentdir.c
++++ b/src/contentdir.c
+@@ -22,6 +22,7 @@
+ #include <stdint.h> /* Gnulib/C99 */
+ #include <inttypes.h> /* ? */
+ #include <sys/stat.h> /* POSIX */
++#include <assert.h>
+ #include "gettext.h" /* Gnulib/gettext */
+ #define _(s) gettext(s)
+ #define N_(s) gettext_noop(s)
--- /dev/null
+#
+# Copyright (C) 2006-2010 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=icecast
+PKG_VERSION:=2.3.2
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://downloads.us.xiph.org/releases/icecast/
+PKG_MD5SUM:=ff516b3ccd2bcc31e68f460cd316093f
+
+PKG_FIXUP:=libtool
+
+include $(INCLUDE_DIR)/package.mk
+
+TREMOR_BUILD_DIR=$(PKG_BUILD_DIR)/libvorbisidec-1.2.0-dave
+TREMOR_DIR=$(TREMOR_BUILD_DIR)/ipkg-install/usr
+
+define Package/icecast
+ SECTION:=multimedia
+ CATEGORY:=Multimedia
+ DEPENDS:=+libcurl +libxml2 +libxslt +libogg
+ TITLE:=A streaming media server for Ogg/Vorbis and MP3 audio streams
+ URL:=http://www.icecast.org/
+endef
+
+define Package/icecast/description
+ Icecast is a streaming media server which currently supports Ogg
+ Vorbis and MP3 audio streams. It can be used to create an Internet
+ radio station or a privately running jukebox and many things in
+ between. It is very versatile in that new formats can be added
+ relatively easily and supports open standards for commuincation and
+ interaction.
+endef
+
+define Build/Prepare
+ $(Build/Prepare/Default)
+ $(SUBMAKE) -f libvorbisidec.mk \
+ BUILD_DIR="$(PKG_BUILD_DIR)" \
+ V=99 \
+ prepare
+endef
+
+define Build/Configure
+ $(MAKE) -f libvorbisidec.mk \
+ BUILD_DIR="$(PKG_BUILD_DIR)" \
+ V=99 \
+ compile
+ $(SED) 's,-lvorbis ,$(TREMOR_DIR)/lib/libvorbisidec.a -logg ,g' $(PKG_BUILD_DIR)/configure
+ $(call Build/Configure/Default, \
+ --enable-yp \
+ --with-curl="yes" \
+ --with-curl-config="$(STAGING_DIR)/usr/bin/curl-config" \
+ --with-ogg="$(STAGING_DIR)/usr" \
+ --with-speex="no" \
+ --with-theora="no" \
+ --with-vorbis="$(TREMOR_DIR)" \
+ --with-xslt-config="$(STAGING_DIR)/usr/bin/xslt-config" \
+ , \
+ CPPFLAGS="-I$(TREMOR_DIR)/include -I$(STAGING_DIR)/usr/include/libxml2 $(TARGET_CPPFLAGS)" \
+ )
+endef
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ DESTDIR="$(PKG_INSTALL_DIR)" \
+ INCLUDES="-I$(PKG_BUILD_DIR)/src -I$(TREMOR_DIR)/include" \
+ all install
+endef
+
+define Package/icecast/install
+ $(INSTALL_DIR) $(1)/etc
+ $(CP) $(PKG_INSTALL_DIR)/etc/icecast.xml $(1)/etc/
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/icecast $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/usr/share/icecast
+ $(CP) $(PKG_INSTALL_DIR)/usr/share/icecast/admin $(1)/usr/share/icecast/
+ $(CP) $(PKG_INSTALL_DIR)/usr/share/icecast/web $(1)/usr/share/icecast/
+endef
+
+$(eval $(call BuildPackage,icecast))
--- /dev/null
+#
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=icecast-libvorbisidec
+PKG_VERSION:=1.2.0-dave
+PKG_RELEASE:=1
+
+PKG_SOURCE:=libvorbisidec-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://users.tpg.com.au/davico/openwrt/
+PKG_MD5SUM:=cb8e51aab92ef164f8e0e8853f7164fa
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/libvorbisidec-$(PKG_VERSION)
+PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+PATCH_DIR=./patches-libvorbisidec
+
+include $(INCLUDE_DIR)/package.mk
+
+define Build/Configure
+ $(call Build/Configure/Default, \
+ --disable-shared \
+ --enable-static \
+ )
+endef
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ DESTDIR="$(PKG_INSTALL_DIR)" \
+ all install
+endef
+
+define Build/InstallDev
+ true
+endef
+
+$(eval $(call Build/DefaultTargets))
--- /dev/null
+diff -urN icecast-2.3.2/src/format_flac.c icecast-2.3.2.new/src/format_flac.c
+--- icecast-2.3.2/src/format_flac.c 2006-09-21 03:49:16.000000000 +0200
++++ icecast-2.3.2.new/src/format_flac.c 2008-09-29 19:43:54.000000000 +0200
+@@ -18,7 +18,7 @@
+ #endif
+
+ #include <stdlib.h>
+-#include <ogg/ogg.h>
++#include <tremor/ogg.h>
+ #include <string.h>
+
+ typedef struct source_tag source_t;
+diff -urN icecast-2.3.2/src/format_midi.c icecast-2.3.2.new/src/format_midi.c
+--- icecast-2.3.2/src/format_midi.c 2006-09-21 03:49:16.000000000 +0200
++++ icecast-2.3.2.new/src/format_midi.c 2008-09-29 19:44:15.000000000 +0200
+@@ -18,7 +18,7 @@
+ #endif
+
+ #include <stdlib.h>
+-#include <ogg/ogg.h>
++#include <tremor/ogg.h>
+ #include <string.h>
+
+ typedef struct source_tag source_t;
+diff -urN icecast-2.3.2/src/format_ogg.c icecast-2.3.2.new/src/format_ogg.c
+--- icecast-2.3.2/src/format_ogg.c 2008-04-19 15:45:30.000000000 +0200
++++ icecast-2.3.2.new/src/format_ogg.c 2008-09-29 19:44:32.000000000 +0200
+@@ -24,7 +24,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+
+-#include <ogg/ogg.h>
++#include <tremor/ogg.h>
+
+ #include "refbuf.h"
+ #include "source.h"
+diff -urN icecast-2.3.2/src/format_ogg.h icecast-2.3.2.new/src/format_ogg.h
+--- icecast-2.3.2/src/format_ogg.h 2006-09-21 03:49:16.000000000 +0200
++++ icecast-2.3.2.new/src/format_ogg.h 2008-09-29 19:44:38.000000000 +0200
+@@ -18,7 +18,7 @@
+ #ifndef __FORMAT_OGG_H__
+ #define __FORMAT_OGG_H__
+
+-#include <ogg/ogg.h>
++#include <tremor/ogg.h>
+ #include "refbuf.h"
+ #include "format.h"
+
+diff -urN icecast-2.3.2/src/format_speex.c icecast-2.3.2.new/src/format_speex.c
+--- icecast-2.3.2/src/format_speex.c 2007-10-04 04:07:57.000000000 +0200
++++ icecast-2.3.2.new/src/format_speex.c 2008-09-29 19:44:56.000000000 +0200
+@@ -18,7 +18,7 @@
+ #endif
+
+ #include <stdlib.h>
+-#include <ogg/ogg.h>
++#include <tremor/ogg.h>
+ #include <speex/speex_header.h>
+
+ typedef struct source_tag source_t;
+diff -urN icecast-2.3.2/src/format_theora.c icecast-2.3.2.new/src/format_theora.c
+--- icecast-2.3.2/src/format_theora.c 2006-09-21 03:49:16.000000000 +0200
++++ icecast-2.3.2.new/src/format_theora.c 2008-09-29 19:46:36.000000000 +0200
+@@ -18,7 +18,7 @@
+ #endif
+
+ #include <stdlib.h>
+-#include <ogg/ogg.h>
++#include <tremor/ogg.h>
+ #include <theora/theora.h>
+
+ typedef struct source_tag source_t;
+diff -urN icecast-2.3.2/src/format_vorbis.c icecast-2.3.2.new/src/format_vorbis.c
+--- icecast-2.3.2/src/format_vorbis.c 2007-09-13 00:40:55.000000000 +0200
++++ icecast-2.3.2.new/src/format_vorbis.c 2008-09-29 19:47:25.000000000 +0200
+@@ -18,8 +18,8 @@
+ #endif
+
+ #include <stdlib.h>
+-#include <ogg/ogg.h>
+-#include <vorbis/codec.h>
++#include <tremor/ogg.h>
++#include <tremor/ivorbiscodec.h>
+ #include <memory.h>
+ #include <string.h>
+
+diff -urN icecast-2.3.2/src/source.c icecast-2.3.2.new/src/source.c
+--- icecast-2.3.2/src/source.c 2008-05-15 15:25:04.000000000 +0200
++++ icecast-2.3.2.new/src/source.c 2008-09-29 19:47:40.000000000 +0200
+@@ -19,7 +19,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/types.h>
+-#include <ogg/ogg.h>
++#include <tremor/ogg.h>
+ #include <errno.h>
+
+ #ifndef _WIN32
+--- icecast-2.3.2/configure 2008-05-27 02:21:57.000000000 +0200
++++ icecast-2.3.2.new/configure 2008-09-29 20:05:43.000000000 +0200
+@@ -22199,7 +22199,7 @@
+ if test "${xt_cv_lib_ogg+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- OGG_LIBS="-logg"
++ OGG_LIBS="-lvorbisidec"
+
+ #
+ # check if the installed Ogg is sufficiently new.
+@@ -22261,7 +22261,7 @@
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+-#include <ogg/ogg.h>
++#include <tremor/ogg.h>
+ int
+ main ()
+ {
+@@ -22410,9 +22410,9 @@
+
+ fi
+
+-VORBIS_LIBS="-lvorbis"
+-VORBISFILE_LIBS="-lvorbisfile"
+-VORBISENC_LIBS="-lvorbisenc"
++VORBIS_LIBS="-lvorbisidec"
++VORBISFILE_LIBS="-lvorbisidec"
++VORBISENC_LIBS="-lvorbisidec"
+
+ xt_save_LIBS="$LIBS"
+ xt_save_LDFLAGS="$LDFLAGS"
+@@ -22537,14 +22537,13 @@
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+
+-#include <vorbis/codec.h>
+-#include <vorbis/vorbisenc.h>
++#include <tremor/ivorbiscodec.h>
+
+ int
+ main ()
+ {
+
+-struct ovectl_ratemanage_arg a;
++/*struct ovectl_ratemanage_arg a;*/
+
+ ;
+ return 0;
+--- icecast-2.3.2/src/format_kate.c 2008-04-18 18:29:28.000000000 +0200
++++ icecast-2.3.2.new/src/format_kate.c 2008-10-01 08:27:00.000000000 +0200
+@@ -19,7 +19,7 @@
+
+ #include <stdlib.h>
+ #include <string.h>
+-#include <ogg/ogg.h>
++#include <tremor/ogg.h>
+ #ifdef HAVE_KATE
+ #include <kate/oggkate.h>
+ #endif
--- /dev/null
+--- a/m4/xiph_curl.m4
++++ b/m4/xiph_curl.m4
+@@ -52,7 +52,7 @@
+ AC_MSG_CHECKING(for libcurl)
+ if test "$curl_ok" = "yes"
+ then
+- AC_RUN_IFELSE(AC_LANG_SOURCE([
++ AC_COMPILE_IFELSE(AC_LANG_SOURCE([
+ #include <curl/curl.h>
+ int main()
+ {
+++ /dev/null
-#
-# Copyright (C) 2007 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=gmediaserver
-PKG_VERSION:=0.13.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://savannah.nongnu.org/download/gmediaserver/
-PKG_MD5SUM:=c422de386331e2a1a859d45f6fa270a3
-
-PKG_INSTALL:=1
-PKG_BUILD_PARALLEL:=1
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-
-define Package/gmediaserver
- SECTION:=net
- CATEGORY:=Network
- DEPENDS:=+id3lib +libmagic +file +libupnp +libuuid +uclibcxx +zlib $(ICONV_DEPENDS)
- TITLE:=An UPnP music media server
- URL:=http://www.nongnu.org/gmediaserver/
- SUBMENU:=multimedia
-endef
-
-define Package/gmediaserver/description
- GMediaServer is a server for UPnP media players like the
- Netgear MP101, Linksys WMLS11B etc. It exports one or more
- directories using the UPnP protocol so the mediaserver can
- browse through them and play audio or video files.
-endef
-
-CONFIGURE_ARGS += \
- --disable-rpath \
- --enable-threads=posix \
- --with-libiconv-prefix="$(ICONV_PREFIX)" \
- --without-libintl-prefix \
- --with-id3lib="$(STAGING_DIR)/usr" \
- --with-libupnp="$(STAGING_DIR)/usr" \
- , \
- LIBS=" -luClibc++ -lz" \
-
-MAKE_FLAGS += \
- AR="$(TARGET_CROSS)ar" \
- LTLIBICONV="" \
- DESTDIR="$(PKG_INSTALL_DIR)"
-
-define Package/gmediaserver/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/sbin/
- $(INSTALL_DIR) $(1)/etc/config
- $(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
- $(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
-endef
-
-$(eval $(call BuildPackage,gmediaserver))
+++ /dev/null
-config gmediaserver
- option content_directory '/tmp'
- option interface 'br-lan'
+++ /dev/null
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006 OpenWrt.org
-START=50
-
-BIN=gmediaserver
-DEFAULT=/etc/default/$BIN
-RUN_D=/var/run
-PID_F=$RUN_D/$BIN.pid
-
-start() {
- mkdir -p $RUN_D
- config_load gmediaserver
- config_foreach start_service gmediaserver
-}
-
-start_service() {
- local cfg="$1"
- config_get content_directory "$cfg" content_directory
- config_get interface "$cfg" interface
-
- $BIN --background --interface=${interface:-br-lan} --pid-file=$PID_F ${content_directory:-/tmp}
-}
-
-stop() {
- [ -f $PID_F ] && kill $(cat $PID_F)
-}
-
+++ /dev/null
---- a/src/upnp.c
-+++ b/src/upnp.c
-@@ -36,6 +36,7 @@
- #include <uuid/uuid.h>
- #include "intutil.h"
- #include "gmediaserver.h"
-+#include "webserver.h"
- #include "schemas/MediaServer.h"
-
- #define GMEDIASERVER_SSDP_PAUSE 100
-@@ -265,7 +266,7 @@ handle_get_var_request(struct Upnp_State
- say(3, _("Event device UDN: %s\n"), quotearg(request->DevUDN));
- say(3, _("Event service ID: %s\n"), quotearg(request->ServiceID));
- say(3, _("Event variable name: %s\n"), quotearg(request->StateVarName));
-- say(3, _("Event source: %s\n"), inet_ntoa(request->CtrlPtIPAddr));
-+ say(3, _("Event source: %s\n"), inet_ntoa((*(struct sockaddr_in *)&request->CtrlPtIPAddr).sin_addr));
-
- if (strcmp(request->DevUDN, device_udn) != 0) {
- say(1, _("Discarding event - event device UDN (%s) not recognized\n"), quotearg(request->DevUDN));
-@@ -306,7 +307,7 @@ handle_action_request(struct Upnp_Action
- say(3, _("Event device UDN: %s\n"), quotearg(request->DevUDN));
- say(3, _("Event service ID: %s\n"), quotearg(request->ServiceID));
- say(3, _("Event action name: %s\n"), quotearg(request->ActionName));
-- say(3, _("Event source: %s\n"), inet_ntoa(request->CtrlPtIPAddr));
-+ say(3, _("Event source: %s\n"), inet_ntoa((*(struct sockaddr_in *)&request->CtrlPtIPAddr).sin_addr));
- say_document(4, _("Event action request:\n"), request->ActionRequest);
-
- if (strcmp(request->DevUDN, device_udn) != 0) {
-@@ -502,9 +503,24 @@ init_upnp(const char *listenip, uint16_t
- res = UpnpEnableWebserver(TRUE);
- if (res != UPNP_E_SUCCESS)
- die(_("cannot enable UPnP web server - %s\n"), upnp_errmsg(res));
-- res = UpnpSetVirtualDirCallbacks(&virtual_dir_callbacks);
-- if (res != UPNP_E_SUCCESS)
-- die(_("cannot set virtual directory callbacks - %s\n"), upnp_errmsg(res));
-+
-+#define upnp_set_callback(cb, func) \
-+ do { \
-+ res = UpnpVirtualDir_set_##cb##Callback(func); \
-+ if (res != UPNP_E_SUCCESS) \
-+ { \
-+ die(_("cannot set virtual directory callbacks - %s\n"), \
-+ upnp_errmsg(res)); \
-+ } \
-+ } while(0)
-+
-+ upnp_set_callback(GetInfo, webserver_get_info);
-+ upnp_set_callback(Open, webserver_open);
-+ upnp_set_callback(Read, webserver_read);
-+ upnp_set_callback(Seek, webserver_seek);
-+ upnp_set_callback(Write, webserver_write);
-+ upnp_set_callback(Close, webserver_close);
-+
- res = UpnpAddVirtualDir("/files");
- if (res != UPNP_E_SUCCESS)
- die(_("cannot add virtual directory for web server - %s\n"), upnp_errmsg(res));
---- a/src/webserver.c
-+++ b/src/webserver.c
-@@ -83,7 +83,7 @@ get_entry_from_url(const char *filename)
- return get_entry_by_id(id);
- }
-
--static int
-+int
- webserver_get_info(const char *filename, struct File_Info *info)
- {
- Entry *entry;
-@@ -180,7 +180,7 @@ webserver_get_info(const char *filename,
- return -1;
- }
-
--static UpnpWebFileHandle
-+UpnpWebFileHandle
- webserver_open(const char *filename, enum UpnpOpenFileMode mode)
- {
- Entry *entry;
-@@ -277,7 +277,7 @@ webserver_open(const char *filename, enu
- return NULL;
- }
-
--static int
-+int
- webserver_read(UpnpWebFileHandle fh, char *buf, size_t buflen)
- {
- WebServerFile *file = (WebServerFile *) fh;
-@@ -307,7 +307,7 @@ webserver_read(UpnpWebFileHandle fh, cha
- return len;
- }
-
--static int
-+int
- webserver_write(UpnpWebFileHandle fh, char *buf, size_t buflen)
- {
- WebServerFile *file = (WebServerFile *) fh;
-@@ -317,7 +317,7 @@ webserver_write(UpnpWebFileHandle fh, ch
- return -1;
- }
-
--static int
-+int
- webserver_seek(UpnpWebFileHandle fh, off_t offset, int origin)
- {
- WebServerFile *file = (WebServerFile *) fh;
-@@ -396,7 +396,7 @@ webserver_seek(UpnpWebFileHandle fh, off
- return 0;
- }
-
--static int
-+int
- webserver_close(UpnpWebFileHandle fh)
- {
- WebServerFile *file = (WebServerFile *) fh;
-@@ -419,12 +419,3 @@ webserver_close(UpnpWebFileHandle fh)
-
- return 0;
- }
--
--struct UpnpVirtualDirCallbacks virtual_dir_callbacks = {
-- webserver_get_info,
-- webserver_open,
-- webserver_read,
-- webserver_write,
-- webserver_seek,
-- webserver_close
--};
---- /dev/null
-+++ b/src/webserver.h
-@@ -0,0 +1,6 @@
-+int webserver_get_info(const char *filename, struct File_Info *info);
-+UpnpWebFileHandle webserver_open(const char *filename, enum UpnpOpenFileMode mode);
-+int webserver_read(UpnpWebFileHandle fh, char *buf, size_t buflen);
-+int webserver_write(UpnpWebFileHandle fh, char *buf, size_t buflen);
-+int webserver_seek(UpnpWebFileHandle fh, off_t offset, int origin);
-+int webserver_close(UpnpWebFileHandle fh);
---- a/src/contentdir.c
-+++ b/src/contentdir.c
-@@ -22,6 +22,7 @@
- #include <stdint.h> /* Gnulib/C99 */
- #include <inttypes.h> /* ? */
- #include <sys/stat.h> /* POSIX */
-+#include <assert.h>
- #include "gettext.h" /* Gnulib/gettext */
- #define _(s) gettext(s)
- #define N_(s) gettext_noop(s)
+++ /dev/null
-#
-# Copyright (C) 2006-2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=icecast
-PKG_VERSION:=2.3.2
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://downloads.us.xiph.org/releases/icecast/
-PKG_MD5SUM:=ff516b3ccd2bcc31e68f460cd316093f
-
-PKG_FIXUP:=libtool
-
-include $(INCLUDE_DIR)/package.mk
-
-TREMOR_BUILD_DIR=$(PKG_BUILD_DIR)/libvorbisidec-1.2.0-dave
-TREMOR_DIR=$(TREMOR_BUILD_DIR)/ipkg-install/usr
-
-define Package/icecast
- SECTION:=net
- CATEGORY:=Network
- DEPENDS:=+libcurl +libxml2 +libxslt +libogg
- TITLE:=A streaming media server for Ogg/Vorbis and MP3 audio streams
- URL:=http://www.icecast.org/
- SUBMENU:=multimedia
-endef
-
-define Package/icecast/description
- Icecast is a streaming media server which currently supports Ogg
- Vorbis and MP3 audio streams. It can be used to create an Internet
- radio station or a privately running jukebox and many things in
- between. It is very versatile in that new formats can be added
- relatively easily and supports open standards for commuincation and
- interaction.
-endef
-
-define Build/Prepare
- $(Build/Prepare/Default)
- $(SUBMAKE) -f libvorbisidec.mk \
- BUILD_DIR="$(PKG_BUILD_DIR)" \
- V=99 \
- prepare
-endef
-
-define Build/Configure
- $(MAKE) -f libvorbisidec.mk \
- BUILD_DIR="$(PKG_BUILD_DIR)" \
- V=99 \
- compile
- $(SED) 's,-lvorbis ,$(TREMOR_DIR)/lib/libvorbisidec.a -logg ,g' $(PKG_BUILD_DIR)/configure
- $(call Build/Configure/Default, \
- --enable-yp \
- --with-curl="yes" \
- --with-curl-config="$(STAGING_DIR)/usr/bin/curl-config" \
- --with-ogg="$(STAGING_DIR)/usr" \
- --with-speex="no" \
- --with-theora="no" \
- --with-vorbis="$(TREMOR_DIR)" \
- --with-xslt-config="$(STAGING_DIR)/usr/bin/xslt-config" \
- , \
- CPPFLAGS="-I$(TREMOR_DIR)/include -I$(STAGING_DIR)/usr/include/libxml2 $(TARGET_CPPFLAGS)" \
- )
-endef
-
-define Build/Compile
- $(MAKE) -C $(PKG_BUILD_DIR) \
- DESTDIR="$(PKG_INSTALL_DIR)" \
- INCLUDES="-I$(PKG_BUILD_DIR)/src -I$(TREMOR_DIR)/include" \
- all install
-endef
-
-define Package/icecast/install
- $(INSTALL_DIR) $(1)/etc
- $(CP) $(PKG_INSTALL_DIR)/etc/icecast.xml $(1)/etc/
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/icecast $(1)/usr/bin/
- $(INSTALL_DIR) $(1)/usr/share/icecast
- $(CP) $(PKG_INSTALL_DIR)/usr/share/icecast/admin $(1)/usr/share/icecast/
- $(CP) $(PKG_INSTALL_DIR)/usr/share/icecast/web $(1)/usr/share/icecast/
-endef
-
-$(eval $(call BuildPackage,icecast))
+++ /dev/null
-#
-# Copyright (C) 2006 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=icecast-libvorbisidec
-PKG_VERSION:=1.2.0-dave
-PKG_RELEASE:=1
-
-PKG_SOURCE:=libvorbisidec-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://users.tpg.com.au/davico/openwrt/
-PKG_MD5SUM:=cb8e51aab92ef164f8e0e8853f7164fa
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/libvorbisidec-$(PKG_VERSION)
-PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
-PATCH_DIR=./patches-libvorbisidec
-
-include $(INCLUDE_DIR)/package.mk
-
-define Build/Configure
- $(call Build/Configure/Default, \
- --disable-shared \
- --enable-static \
- )
-endef
-
-define Build/Compile
- $(MAKE) -C $(PKG_BUILD_DIR) \
- DESTDIR="$(PKG_INSTALL_DIR)" \
- all install
-endef
-
-define Build/InstallDev
- true
-endef
-
-$(eval $(call Build/DefaultTargets))
+++ /dev/null
-diff -urN icecast-2.3.2/src/format_flac.c icecast-2.3.2.new/src/format_flac.c
---- icecast-2.3.2/src/format_flac.c 2006-09-21 03:49:16.000000000 +0200
-+++ icecast-2.3.2.new/src/format_flac.c 2008-09-29 19:43:54.000000000 +0200
-@@ -18,7 +18,7 @@
- #endif
-
- #include <stdlib.h>
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
- #include <string.h>
-
- typedef struct source_tag source_t;
-diff -urN icecast-2.3.2/src/format_midi.c icecast-2.3.2.new/src/format_midi.c
---- icecast-2.3.2/src/format_midi.c 2006-09-21 03:49:16.000000000 +0200
-+++ icecast-2.3.2.new/src/format_midi.c 2008-09-29 19:44:15.000000000 +0200
-@@ -18,7 +18,7 @@
- #endif
-
- #include <stdlib.h>
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
- #include <string.h>
-
- typedef struct source_tag source_t;
-diff -urN icecast-2.3.2/src/format_ogg.c icecast-2.3.2.new/src/format_ogg.c
---- icecast-2.3.2/src/format_ogg.c 2008-04-19 15:45:30.000000000 +0200
-+++ icecast-2.3.2.new/src/format_ogg.c 2008-09-29 19:44:32.000000000 +0200
-@@ -24,7 +24,7 @@
- #include <stdlib.h>
- #include <string.h>
-
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
-
- #include "refbuf.h"
- #include "source.h"
-diff -urN icecast-2.3.2/src/format_ogg.h icecast-2.3.2.new/src/format_ogg.h
---- icecast-2.3.2/src/format_ogg.h 2006-09-21 03:49:16.000000000 +0200
-+++ icecast-2.3.2.new/src/format_ogg.h 2008-09-29 19:44:38.000000000 +0200
-@@ -18,7 +18,7 @@
- #ifndef __FORMAT_OGG_H__
- #define __FORMAT_OGG_H__
-
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
- #include "refbuf.h"
- #include "format.h"
-
-diff -urN icecast-2.3.2/src/format_speex.c icecast-2.3.2.new/src/format_speex.c
---- icecast-2.3.2/src/format_speex.c 2007-10-04 04:07:57.000000000 +0200
-+++ icecast-2.3.2.new/src/format_speex.c 2008-09-29 19:44:56.000000000 +0200
-@@ -18,7 +18,7 @@
- #endif
-
- #include <stdlib.h>
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
- #include <speex/speex_header.h>
-
- typedef struct source_tag source_t;
-diff -urN icecast-2.3.2/src/format_theora.c icecast-2.3.2.new/src/format_theora.c
---- icecast-2.3.2/src/format_theora.c 2006-09-21 03:49:16.000000000 +0200
-+++ icecast-2.3.2.new/src/format_theora.c 2008-09-29 19:46:36.000000000 +0200
-@@ -18,7 +18,7 @@
- #endif
-
- #include <stdlib.h>
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
- #include <theora/theora.h>
-
- typedef struct source_tag source_t;
-diff -urN icecast-2.3.2/src/format_vorbis.c icecast-2.3.2.new/src/format_vorbis.c
---- icecast-2.3.2/src/format_vorbis.c 2007-09-13 00:40:55.000000000 +0200
-+++ icecast-2.3.2.new/src/format_vorbis.c 2008-09-29 19:47:25.000000000 +0200
-@@ -18,8 +18,8 @@
- #endif
-
- #include <stdlib.h>
--#include <ogg/ogg.h>
--#include <vorbis/codec.h>
-+#include <tremor/ogg.h>
-+#include <tremor/ivorbiscodec.h>
- #include <memory.h>
- #include <string.h>
-
-diff -urN icecast-2.3.2/src/source.c icecast-2.3.2.new/src/source.c
---- icecast-2.3.2/src/source.c 2008-05-15 15:25:04.000000000 +0200
-+++ icecast-2.3.2.new/src/source.c 2008-09-29 19:47:40.000000000 +0200
-@@ -19,7 +19,7 @@
- #include <stdlib.h>
- #include <string.h>
- #include <sys/types.h>
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
- #include <errno.h>
-
- #ifndef _WIN32
---- icecast-2.3.2/configure 2008-05-27 02:21:57.000000000 +0200
-+++ icecast-2.3.2.new/configure 2008-09-29 20:05:43.000000000 +0200
-@@ -22199,7 +22199,7 @@
- if test "${xt_cv_lib_ogg+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-- OGG_LIBS="-logg"
-+ OGG_LIBS="-lvorbisidec"
-
- #
- # check if the installed Ogg is sufficiently new.
-@@ -22261,7 +22261,7 @@
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h. */
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
- int
- main ()
- {
-@@ -22410,9 +22410,9 @@
-
- fi
-
--VORBIS_LIBS="-lvorbis"
--VORBISFILE_LIBS="-lvorbisfile"
--VORBISENC_LIBS="-lvorbisenc"
-+VORBIS_LIBS="-lvorbisidec"
-+VORBISFILE_LIBS="-lvorbisidec"
-+VORBISENC_LIBS="-lvorbisidec"
-
- xt_save_LIBS="$LIBS"
- xt_save_LDFLAGS="$LDFLAGS"
-@@ -22537,14 +22537,13 @@
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h. */
-
--#include <vorbis/codec.h>
--#include <vorbis/vorbisenc.h>
-+#include <tremor/ivorbiscodec.h>
-
- int
- main ()
- {
-
--struct ovectl_ratemanage_arg a;
-+/*struct ovectl_ratemanage_arg a;*/
-
- ;
- return 0;
---- icecast-2.3.2/src/format_kate.c 2008-04-18 18:29:28.000000000 +0200
-+++ icecast-2.3.2.new/src/format_kate.c 2008-10-01 08:27:00.000000000 +0200
-@@ -19,7 +19,7 @@
-
- #include <stdlib.h>
- #include <string.h>
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
- #ifdef HAVE_KATE
- #include <kate/oggkate.h>
- #endif
+++ /dev/null
---- a/m4/xiph_curl.m4
-+++ b/m4/xiph_curl.m4
-@@ -52,7 +52,7 @@
- AC_MSG_CHECKING(for libcurl)
- if test "$curl_ok" = "yes"
- then
-- AC_RUN_IFELSE(AC_LANG_SOURCE([
-+ AC_COMPILE_IFELSE(AC_LANG_SOURCE([
- #include <curl/curl.h>
- int main()
- {