Fresh pull from upstream (stable) package feed
[librecmc/package-feed.git] / multimedia / crtmpserver / Makefile
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:=b6fdcdb953d1e99c48a0c37a8c80f2cad2db443b
12 PKG_VERSION:=2012-07-18+git-$(PKG_REV)
13 PKG_RELEASE:=2
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:=https://github.com/j0sh/crtmpserver.git
21 PKG_SOURCE_SUBDIR:=crtmpserver-$(PKG_VERSION)
22 PKG_SOURCE_VERSION:=$(PKG_REV)
23 PKG_SOURCE_PROTO:=git
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         (cd $(PKG_BUILD_DIR)/sources/common/include/; \
70                 echo '#define CRTMPSERVER_VERSION_RELEASE_NUMBER "$(PKG_VERSION)\n"' > version.h; \
71                 echo '#define CRTMPSERVER_VERSION_CODE_NAME "Git\n"'                >> version.h)
72 endef
73
74 define Build/Compile
75         +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/builders/make \
76                 PLATFORM=linux-openwrt-uclibc -Wno-error -j6
77 endef
78
79 define Package/crtmpserver/install
80         $(INSTALL_DIR) $(1)/usr/bin
81         $(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/crtmpserver $(1)/usr/bin/
82         $(INSTALL_DIR) $(1)/usr/lib/crtmpserver
83         $(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/*.so $(1)/usr/lib/crtmpserver/
84         $(foreach app,flvplayback samplefactory admin stresstest appselector vptests applestreamingclient proxypublish, \
85                 $(INSTALL_DIR) $(1)/usr/lib/crtmpserver/$(app); \
86                 $(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/applications/$(app)/lib$(app).so \
87                         $(1)/usr/lib/crtmpserver/$(app)/; \
88         )
89         $(INSTALL_DIR) $(1)/etc
90         $(INSTALL_CONF) $(PKG_BUILD_DIR)/builders/make/output/dynamic/crtmpserver.lua $(1)/etc/
91         $(INSTALL_DIR) $(1)/usr/share/crtmpserver/appselector
92         $(INSTALL_DIR) $(1)/usr/share/crtmpserver/media
93         $(INSTALL_DIR) $(1)/etc/init.d
94         $(INSTALL_BIN) ./files/crtmpserver.init $(1)/etc/init.d/crtmpserver
95 endef
96
97 $(eval $(call BuildPackage,crtmpserver))
98