Kaynağa Gözat

crtmpserver: import from packages, add myself as the maintainer

This adds the crtmpserver package from the old svn package tree. I adopt
the licensing information and will maintain the package in the future. I
also updated the package to the latest version and ensure that is
building on x86_64, ar71xx and avr32.

Signed-off-by: Thomas Heil <heil@terminal-consulting.de>
Thomas Heil 10 yıl önce
ebeveyn
işleme
e236613a49

+ 95
- 0
multimedia/crtmpserver/Makefile Dosyayı Görüntüle

@@ -0,0 +1,95 @@
1
+# 
2
+# Copyright (C) 2010 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=crtmpserver
11
+PKG_REV:=811
12
+PKG_VERSION:=r$(PKG_REV)
13
+PKG_RELEASE:=1
14
+PKG_BUILD_PARALLEL:=2
15
+PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
16
+PKG_LICENSE:=GPL-3.0
17
+
18
+
19
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
20
+PKG_SOURCE_URL:=--username=anonymous --password= https://svn.rtmpd.com/crtmpserver/branches/1.0
21
+PKG_SOURCE_SUBDIR:=crtmpserver-$(PKG_VERSION)
22
+PKG_SOURCE_VERSION:=$(PKG_REV)
23
+PKG_SOURCE_PROTO:=svn
24
+
25
+include $(INCLUDE_DIR)/package.mk
26
+
27
+define Package/crtmpserver
28
+  SECTION:=multimedia
29
+  CATEGORY:=Multimedia
30
+  DEPENDS:=+libopenssl +libstdcpp +liblua
31
+  TITLE:=C++ RTMP Server
32
+  URL:=http://www.rtmpd.com/
33
+endef
34
+
35
+define Package/crtmpserver/description
36
+C++ RTMP Server it is a high performance streaming server able to
37
+stream (live or recorded) in the following technologies:
38
+ * To and from Flash (RTMP,RTMPE, RTMPS, RTMPT, RTMPTE)
39
+ * To and from embedded devices: iPhone, Android
40
+ * From surveillance cameras
41
+ * IP-TV using MPEG-TS and RTSP/RTCP/RTP protocols
42
+                
43
+Also, crtmpserver can be used as a high performance rendes-vous
44
+server. For example, it enables you to do:
45
+ * Audio/Video conferencing
46
+ * Online gaming
47
+ * Online collaboration
48
+ * Simple/complex chat applications
49
+endef
50
+
51
+define Package/crtmpserver/conffiles
52
+/etc/crtmpserver.lua
53
+endef
54
+
55
+# XXX: this hack handles the usr/bin vs bin difference of backfire and trunk
56
+TS_BASE:=$(wildcard $(TOOLCHAIN_DIR)/bin/$(TARGET_CC))
57
+TS_BASE:=$(dir $(if $(TS_BASE),$(TS_BASE),$(wildcard $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CC))))
58
+
59
+define Build/Configure
60
+	(cd $(PKG_BUILD_DIR)/builders/make; \
61
+		cp linux.mk linux-openwrt-uclibc.mk; \
62
+		$(SED) 's,^TOOLCHAIN_BASE[[:space:]]*=.*,TOOLCHAIN_BASE=$(TS_BASE),' \
63
+			-e 's,^TOOLCHAIN_PREFIX[[:space:]]*=.*,TOOLCHAIN_PREFIX=$(TARGET_CROSS),' \
64
+			-e 's,^CCOMPILER[[:space:]]*=.*,CCOMPILER=$(TARGET_CC),' \
65
+			-e 's,^CXXCOMPILER[[:space:]]*=.*,CXXCOMPILER=$(TARGET_CXX),' \
66
+			-e 's,^OPTIMIZATIONS[[:space:]]*=.*,OPTIMIZATIONS=-O2,' \
67
+			-e 's,^SSL_BASE[[:space:]]*=.*,SSL_BASE=$(STAGING_DIR)/usr,' \
68
+			linux-openwrt-uclibc.mk)
69
+endef
70
+
71
+define Build/Compile
72
+	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/builders/make \
73
+		PLATFORM=linux-openwrt-uclibc -Wno-error -j6
74
+endef
75
+
76
+define Package/crtmpserver/install
77
+	$(INSTALL_DIR) $(1)/usr/bin
78
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/crtmpserver $(1)/usr/bin/
79
+	$(INSTALL_DIR) $(1)/usr/lib/crtmpserver
80
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/*.so $(1)/usr/lib/crtmpserver/
81
+	$(foreach app,flvplayback samplefactory admin stresstest appselector vptests applestreamingclient proxypublish, \
82
+		$(INSTALL_DIR) $(1)/usr/lib/crtmpserver/$(app); \
83
+		$(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/applications/$(app)/lib$(app).so \
84
+			$(1)/usr/lib/crtmpserver/$(app)/; \
85
+	)
86
+	$(INSTALL_DIR) $(1)/etc
87
+	$(INSTALL_CONF) $(PKG_BUILD_DIR)/builders/make/output/dynamic/crtmpserver.lua $(1)/etc/
88
+	$(INSTALL_DIR) $(1)/usr/share/crtmpserver/appselector
89
+	$(INSTALL_DIR) $(1)/usr/share/crtmpserver/media
90
+	$(INSTALL_DIR) $(1)/etc/init.d
91
+	$(INSTALL_BIN) ./files/crtmpserver.init $(1)/etc/init.d/crtmpserver
92
+endef
93
+
94
+$(eval $(call BuildPackage,crtmpserver))
95
+

+ 30
- 0
multimedia/crtmpserver/files/crtmpserver.init Dosyayı Görüntüle

@@ -0,0 +1,30 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2009-2010 OpenWrt.org
3
+
4
+START=99
5
+STOP=80
6
+
7
+SERVICE_USE_PID=1
8
+
9
+CRTMPSERVER_BIN="/usr/bin/crtmpserver"
10
+CRTMPSERVER_CONFIG="/etc/crtmpserver.lua"
11
+CRTMPSERVER_PID="/var/run/crtmpserver.pid"
12
+
13
+start()
14
+{
15
+        echo "start $CRTMPSERVER_BIN"
16
+        start-stop-daemon -S -x "$CRTMPSERVER_BIN" -- --daemon --pid="$CRTMPSERVER_PID" \
17
+                "$CRTMPSERVER_CONFIG"
18
+}
19
+stop() {
20
+
21
+        echo "stop $CRTMPSERVER_BIN"
22
+        start-stop-daemon  -K -x $CRTMPSERVER_BIN -p $CRTMPSERVER_PID
23
+}
24
+
25
+reload()
26
+{
27
+        stop
28
+        start
29
+}
30
+

+ 11
- 0
multimedia/crtmpserver/patches/010-link-crypt-for-lua.patch Dosyayı Görüntüle

@@ -0,0 +1,11 @@
1
+--- a/builders/make/compile.mk
2
++++ b/builders/make/compile.mk
3
+@@ -67,7 +67,7 @@ TINYXML_OBJS = $(TINYXML_SRCS:.cpp=.tiny
4
+ 
5
+ #common
6
+ COMMON_INCLUDE=$(LUA_INCLUDE) $(TINYXML_INCLUDE) $(SSL_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/common/include
7
+-COMMON_LIBS=$(SSL_LIB) -L$(OUTPUT_DYNAMIC) -llua -ltinyxml
8
++COMMON_LIBS=$(SSL_LIB) -L$(OUTPUT_DYNAMIC) -llua -ltinyxml -lcrypt
9
+ COMMON_SRCS = $(shell find $(PROJECT_BASE_PATH)/sources/common/src -type f -name "*.cpp")
10
+ COMMON_OBJS = $(COMMON_SRCS:.cpp=.common.o)
11
+ 

+ 13
- 0
multimedia/crtmpserver/patches/020-add-rpath.patch Dosyayı Görüntüle

@@ -0,0 +1,13 @@
1
+--- a/builders/make/linux.mk
2
++++ b/builders/make/linux.mk
3
+@@ -31,8 +31,8 @@ OPTIMIZATIONS = -O3
4
+ COMPILE_FLAGS = $(FPIC) $(OPTIMIZATIONS) $(CFLAGS)
5
+ 
6
+ #linking flags
7
+-dynamic_lib_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-soname,$(DYNAMIC_LIB_PREFIX)$(1)$(DYNAMIC_LIB_SUFIX) -Wl,-rpath,"\$$ORIGIN"
8
+-dynamic_exec_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-rpath,"\$$ORIGIN"
9
++dynamic_lib_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-soname,$(DYNAMIC_LIB_PREFIX)$(1)$(DYNAMIC_LIB_SUFIX) -Wl,-rpath,/usr/lib/crtmpserver
10
++dynamic_exec_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-rpath,/usr/lib/crtmpserver
11
+ 
12
+ #compile switches
13
+ PLATFORM_DEFINES = \

+ 60
- 0
multimedia/crtmpserver/patches/030-default-config.patch Dosyayı Görüntüle

@@ -0,0 +1,60 @@
1
+--- a/builders/cmake/crtmpserver/crtmpserver.lua
2
++++ b/builders/cmake/crtmpserver/crtmpserver.lua
3
+@@ -4,7 +4,7 @@ configuration=
4
+ {
5
+ 	-- if true, the server will run as a daemon.
6
+ 	-- NOTE: all console appenders will be ignored if this is a daemon
7
+-	daemon=false,
8
++	daemon=true,
9
+ 	-- the OS's path separator. Used in composing paths
10
+ 	pathSeparator="/",
11
+ 
12
+@@ -44,7 +44,7 @@ configuration=
13
+ 	{
14
+ 		-- this is the root directory of all applications
15
+ 		-- usually this is relative to the binary execuable
16
+-		rootDirectory="applications",
17
++		rootDirectory="/usr/lib/crtmpserver",
18
+ 		
19
+ 		
20
+ 		--this is where the applications array starts
21
+@@ -68,7 +68,7 @@ configuration=
22
+ 			-- this is the folder from where the current application gets it's content.
23
+ 			-- It is optional. If not specified, it will be defaulted to:
24
+ 			-- <rootDirectory>/<name>/mediaFolder
25
+-			-- mediaFolder="/some/directory/where/media/files/are/stored"
26
++			mediaFolder="/usr/share/crtmpserver/appselector",
27
+ 			-- the application will also be known by that names. It is optional
28
+ 			--aliases=
29
+ 			--{
30
+@@ -89,13 +89,6 @@ configuration=
31
+ 				},
32
+ 				{
33
+ 					ip="0.0.0.0",
34
+-					port=8081,
35
+-					protocol="inboundRtmps",
36
+-					sslKey="server.key",
37
+-					sslCert="server.crt"
38
+-				},
39
+-				{
40
+-					ip="0.0.0.0",
41
+ 					port=8080,
42
+ 					protocol="inboundRtmpt"
43
+                 },
44
+@@ -105,7 +98,7 @@ configuration=
45
+ 			description="FLV Playback Sample",
46
+ 			name="flvplayback",
47
+ 			protocol="dynamiclinklibrary",
48
+-			mediaFolder="/Volumes/android/backup/media/",
49
++			mediaFolder="/media/",
50
+ 			aliases=
51
+ 			{
52
+ 				"simpleLive",
53
+@@ -183,6 +176,7 @@ configuration=
54
+ 			name="samplefactory",
55
+ 			description="asdsadasdsa",
56
+ 			protocol="dynamiclinklibrary",
57
++			mediaFolder="/usr/share/ctmpserver/media",
58
+ 			aliases=
59
+ 			{
60
+ 				"httpOutboundTest"

+ 13
- 0
multimedia/crtmpserver/patches/040-use-select.patch Dosyayı Görüntüle

@@ -0,0 +1,13 @@
1
+Index: crtmpserver-r726/builders/make/linux.mk
2
+===================================================================
3
+--- crtmpserver-r726.orig/builders/make/linux.mk
4
++++ crtmpserver-r726/builders/make/linux.mk
5
+@@ -38,7 +38,7 @@ dynamic_exec_flags = $(FPIC) $(OPTIMIZAT
6
+ PLATFORM_DEFINES = \
7
+ 	-DLINUX \
8
+ 	-DLITTLE_ENDIAN_BYTE_ALIGNED \
9
+-	-DNET_EPOLL
10
++	-DNET_SELECT
11
+ 
12
+ SSL_BASE=/usr/local
13
+ 

+ 57
- 0
multimedia/crtmpserver/patches/050-add-missing-make-defines.patch Dosyayı Görüntüle

@@ -0,0 +1,57 @@
1
+--- a/builders/make/compile.mk
2
++++ b/builders/make/compile.mk
3
+@@ -43,17 +43,22 @@ FEATURES_DEFINES = \
4
+ 	-DHAS_PROTOCOL_RTP \
5
+ 	-DHAS_PROTOCOL_TS \
6
+ 	-DHAS_PROTOCOL_VAR \
7
++	-DHAS_PROTOCOL_CLI \
8
++	-DHAS_PROTOCOL_HLS \
9
++	-DHAS_PROTOCOL_RAWHTTPSTREAM \
10
+ 	-DHAS_LUA \
11
+ 	-DHAS_MEDIA_MP3 \
12
+ 	-DHAS_MEDIA_MP4 \
13
+-	-DHAS_MEDIA_FLV
14
++	-DHAS_MEDIA_FLV \
15
++	-DHAS_SYSLOG
16
++	
17
+ 
18
+ 
19
+ DEFINES = $(PLATFORM_DEFINES) $(FEATURES_DEFINES)
20
+ 
21
+ #library paths
22
+ SSL_INCLUDE=-I$(SSL_BASE)/include
23
+-SSL_LIB=-L$(SSL_BASE)/lib -lssl -lcrypto
24
++SSL_LIB=-L$(SSL_BASE)/lib -lssl -lcrypto -ldl
25
+ 
26
+ #lua
27
+ LUA_INCLUDE=-I$(PROJECT_BASE_PATH)/3rdparty/lua-dev
28
+@@ -67,25 +72,25 @@ TINYXML_OBJS = $(TINYXML_SRCS:.cpp=.tiny
29
+ 
30
+ #common
31
+ COMMON_INCLUDE=$(LUA_INCLUDE) $(TINYXML_INCLUDE) $(SSL_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/common/include
32
+-COMMON_LIBS=$(SSL_LIB) -L$(OUTPUT_DYNAMIC) -llua -ltinyxml -lcrypt
33
++COMMON_LIBS=$(SSL_LIB) -L$(OUTPUT_DYNAMIC) $(PROJECT_BASE_PATH)/builders/make/output/dynamic/liblua.so -ltinyxml -lcrypt -ldl
34
+ COMMON_SRCS = $(shell find $(PROJECT_BASE_PATH)/sources/common/src -type f -name "*.cpp")
35
+ COMMON_OBJS = $(COMMON_SRCS:.cpp=.common.o)
36
+ 
37
+ #thelib
38
+ THELIB_INCLUDE=$(COMMON_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/thelib/include
39
+-THELIB_LIBS=$(COMMON_LIBS) -L$(OUTPUT_DYNAMIC) -lcommon
40
++THELIB_LIBS=$(COMMON_LIBS) -L$(OUTPUT_DYNAMIC) -lcommon -ldl
41
+ THELIB_SRCS = $(shell find $(PROJECT_BASE_PATH)/sources/thelib/src -type f -name "*.cpp")
42
+ THELIB_OBJS = $(THELIB_SRCS:.cpp=.thelib.o)
43
+ 
44
+ #tests
45
+ TESTS_INCLUDE=$(THELIB_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/tests/include
46
+-TESTS_LIBS=$(THELIB_LIBS) -L$(OUTPUT_DYNAMIC) -lthelib
47
++TESTS_LIBS=$(THELIB_LIBS) -L$(OUTPUT_DYNAMIC) -lthelib -ldl
48
+ TESTS_SRCS=$(shell find $(PROJECT_BASE_PATH)/sources/tests/src -type f -name "*.cpp")
49
+ TESTS_OBJS=$(TESTS_SRCS:.cpp=.tests.o)
50
+ 
51
+ #crtmpserver
52
+ CRTMPSERVER_INCLUDE=$(THELIB_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/crtmpserver/include
53
+-CRTMPSERVER_LIBS=$(THELIB_LIBS) -L$(OUTPUT_DYNAMIC) -lthelib
54
++CRTMPSERVER_LIBS=$(THELIB_LIBS) -L$(OUTPUT_DYNAMIC) -lthelib -ldl
55
+ CRTMPSERVER_SRCS=$(shell find $(PROJECT_BASE_PATH)/sources/crtmpserver/src -type f -name "*.cpp")
56
+ CRTMPSERVER_OBJS_DYNAMIC=$(CRTMPSERVER_SRCS:.cpp=.crtmpserver_dynamic.o)
57
+ CRTMPSERVER_OBJS_STATIC=$(CRTMPSERVER_SRCS:.cpp=.crtmpserver_static.o)

+ 26
- 0
multimedia/crtmpserver/patches/060-add-missing-includes.patch Dosyayı Görüntüle

@@ -0,0 +1,26 @@
1
+--- a/sources/common/include/common.h
2
++++ b/sources/common/include/common.h
3
+@@ -20,6 +20,10 @@
4
+ #ifndef _COMMON_H
5
+ #define _COMMON_H
6
+ 
7
++#include <stdio.h>
8
++#include <unistd.h>
9
++#include <sys/types.h>
10
++
11
+ #include "defines.h"
12
+ #include "platform/platform.h"
13
+ #include "utils/utils.h"
14
+--- a/sources/common/src/utils/logging/fileloglocation.cpp
15
++++ b/sources/common/src/utils/logging/fileloglocation.cpp
16
+@@ -18,6 +18,10 @@
17
+  */
18
+ 
19
+ 
20
++#include <stdio.h>
21
++#include <unistd.h>
22
++#include <sys/types.h>
23
++
24
+ #include "utils/logging/fileloglocation.h"
25
+ #include "utils/lua/luautils.h"
26
+ 

+ 10
- 0
multimedia/crtmpserver/patches/070-missing-include-gcc-47.patch Dosyayı Görüntüle

@@ -0,0 +1,10 @@
1
+--- a/3rdparty/tinyxml/tinyxml.h
2
++++ b/3rdparty/tinyxml/tinyxml.h
3
+@@ -39,6 +39,7 @@ distribution.
4
+ #include <string>
5
+ #include <iostream>
6
+ #include <sstream>
7
++#include "lstate.h"
8
+ 
9
+ // Help out windows:
10
+ #if defined( _DEBUG ) && !defined( DEBUG )