--- /dev/null
+#
+# Copyright (C) 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:=crtmpserver
+PKG_REV:=346
+PKG_VERSION:=r$(PKG_REV)
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=--username=anonymous --password= https://svn.rtmpd.com/crtmpserver/trunk
+PKG_SOURCE_SUBDIR:=crtmpserver-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=$(PKG_REV)
+PKG_SOURCE_PROTO:=svn
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/crtmpserver
+ SECTION:=multimedia
+ CATEGORY:=Multimedia
+ DEPENDS:=+libopenssl +libstdcpp
+ TITLE:=C++ RTMP Server
+ URL:=http://www.rtmpd.com/
+endef
+
+define Package/crtmpserver/description
+C++ RTMP Server it is a high performance streaming server able to
+stream (live or recorded) in the following technologies:
+ * To and from Flash (RTMP,RTMPE, RTMPS, RTMPT, RTMPTE)
+ * To and from embedded devices: iPhone, Android
+ * From surveillance cameras
+ * IP-TV using MPEG-TS and RTSP/RTCP/RTP protocols
+
+Also, crtmpserver can be used as a high performance rendes-vous
+server. For example, it enables you to do:
+ * Audio/Video conferencing
+ * Online gaming
+ * Online collaboration
+ * Simple/complex chat applications
+endef
+
+define Build/Configure
+ (cd $(PKG_BUILD_DIR)/builders/make; \
+ cp linux.mk linux-openwrt-uclibc.mk; \
+ $(SED) 's,^TOOLCHAIN_BASE[[:space:]]*=.*,TOOLCHAIN_BASE=$(TOOLCHAIN_DIR)/bin/,' \
+ -e 's,^TOOLCHAIN_PREFIX[[:space:]]*=.*,TOOLCHAIN_PREFIX=$(TARGET_CROSS),' \
+ -e 's,^OPTIMIZATIONS[[:space:]]*=.*,OPTIMIZATIONS=-O2,' \
+ -e 's,^SSL_BASE[[:space:]]*=.*,SSL_BASE=$(STAGING_DIR)/usr,' \
+ linux-openwrt-uclibc.mk)
+endef
+
+define Build/Compile
+ $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/builders/make \
+ PLATFORM=linux-openwrt-uclibc
+endef
+
+define Package/crtmpserver/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/rtmpserver $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/usr/lib/rtmpserver
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/*.so $(1)/usr/lib/rtmpserver/
+ $(foreach app,flvplayback samplefactory admin stresstest appselector vptests applestreamingclient proxypublish, \
+ $(INSTALL_DIR) $(1)/usr/lib/rtmpserver/$(app); \
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/applications/$(app)/lib$(app).so \
+ $(1)/usr/lib/rtmpserver/$(app)/; \
+ )
+ $(INSTALL_DIR) $(1)/etc
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/builders/make/output/dynamic/rtmpserver.lua $(1)/etc/
+ $(INSTALL_DIR) $(1)/usr/share/rtmpserver/appselector
+ $(INSTALL_DIR) $(1)/usr/share/rtmpserver/media
+endef
+
+$(eval $(call BuildPackage,crtmpserver))
+
--- /dev/null
+--- a/builders/make/compile.mk
++++ b/builders/make/compile.mk
+@@ -65,7 +65,7 @@ LUA_OBJS = $(LUA_SRCS:.c=.lua.o)
+
+ #common
+ COMMON_INCLUDE=$(LUA_INCLUDE) $(SSL_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/common/include
+-COMMON_LIBS=$(SSL_LIB) -L$(OUTPUT_DYNAMIC) -llua
++COMMON_LIBS=$(SSL_LIB) -L$(OUTPUT_DYNAMIC) -llua -lcrypt
+ COMMON_SRCS = $(shell find $(PROJECT_BASE_PATH)/sources/common/src -type f -name "*.cpp")
+ COMMON_OBJS = $(COMMON_SRCS:.cpp=.common.o)
+
--- /dev/null
+Index: crtmpserver-r219/builders/make/linux.mk
+===================================================================
+--- crtmpserver-r219.orig/builders/make/linux.mk
++++ crtmpserver-r219/builders/make/linux.mk
+@@ -29,8 +29,8 @@ OPTIMIZATIONS = -O3
+ COMPILE_FLAGS = $(FPIC) $(OPTIMIZATIONS)
+
+ #linking flags
+-dynamic_lib_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-soname,$(DYNAMIC_LIB_PREFIX)$(1)$(DYNAMIC_LIB_SUFIX) -Wl,-rpath,"\$$ORIGIN"
+-dynamic_exec_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-rpath,"\$$ORIGIN"
++dynamic_lib_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-soname,$(DYNAMIC_LIB_PREFIX)$(1)$(DYNAMIC_LIB_SUFIX) -Wl,-rpath,/usr/lib/rtmpserver
++dynamic_exec_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-rpath,/usr/lib/rtmpserver
+
+ #compile switches
+ PLATFORM_DEFINES = \
--- /dev/null
+--- a/builders/cmake/rtmpserver/rtmpserver.lua
++++ b/builders/cmake/rtmpserver/rtmpserver.lua
+@@ -4,7 +4,7 @@ configuration=
+ {
+ -- if true, the server will run as a daemon.
+ -- NOTE: all console appenders will be ignored if this is a daemon
+- daemon=false,
++ daemon=true,
+ -- the OS's path separator. Used in composing paths
+ pathSeparator="/",
+ -- this is the async DNS resolver. This is a "clinet" connection
+@@ -58,7 +58,7 @@ configuration=
+ {
+ -- this is the root directory of all applications
+ -- usually this is relative to the binary execuable
+- rootDirectory="applications",
++ rootDirectory="/usr/lib/rtmpserver",
+
+
+ --this is where the applications array starts
+@@ -82,7 +82,7 @@ configuration=
+ -- this is the folder from where the current application gets it's content.
+ -- It is optional. If not specified, it will be defaulted to:
+ -- <rootDirectory>/<name>/mediaFolder
+- -- mediaFolder="/some/directory/where/media/files/are/stored"
++ mediaFolder="/usr/share/rtmpserver/appselector",
+ -- the application will also be known by that names. It is optional
+ --aliases=
+ --{
+@@ -119,6 +119,7 @@ configuration=
+ description="FLV Playback Sample",
+ name="flvplayback",
+ protocol="dynamiclinklibrary",
++ mediaFolder="/usr/share/rtmpserver/media",
+ aliases=
+ {
+ "simpleLive",
--- /dev/null
+--- a/builders/make/linux.mk
++++ b/builders/make/linux.mk
+@@ -36,7 +36,7 @@ dynamic_exec_flags = $(FPIC) $(OPTIMIZAT
+ PLATFORM_DEFINES = \
+ -DLINUX \
+ -DLITTLE_ENDIAN_BYTE_ALIGNED \
+- -DNET_EPOLL
++ -DNET_SELECT
+
+ SSL_BASE=/usr/local
+