From e597d791ecae83ffaf5b658bd775b8d7c477deec Mon Sep 17 00:00:00 2001 From: Max Lapshin Date: Sun, 17 Apr 2011 23:14:02 +0400 Subject: [PATCH] ems:rebuild back working in console --- Emakefile | 12 ++++ Makefile | 34 ++------- apps/erlyvideo/src/erlyvideo.erl | 3 + contrib/erlyctl | 114 ------------------------------- contrib/update | 61 ----------------- contrib/vlc-grabb | 4 -- reltool.config | 6 +- 7 files changed, 27 insertions(+), 207 deletions(-) create mode 100644 Emakefile delete mode 100755 contrib/erlyctl delete mode 100755 contrib/update delete mode 100755 contrib/vlc-grabb diff --git a/Emakefile b/Emakefile new file mode 100644 index 00000000..f0e33412 --- /dev/null +++ b/Emakefile @@ -0,0 +1,12 @@ +{"apps/amf/src/*", [debug_info, {outdir, "apps/amf/ebin"}, {i, "apps/amf/src"}]}. +{"apps/erlmedia/src/gen_format.erl", [debug_info, {outdir, "apps/erlmedia/ebin"}, {i, "apps/erlmedia/src"}]}. +{"apps/erlmedia/src/*", [debug_info, {outdir, "apps/erlmedia/ebin"}, {i, "apps/erlmedia/src"}]}. +{"apps/erlyvideo/src/*", [debug_info, {outdir, "apps/erlyvideo/ebin"}, {i, "apps/erlyvideo/include"}, {i, ".."}]}. +{"apps/erlyvideo/src/*/*", [debug_info, {outdir, "apps/erlyvideo/ebin"}, {i, "apps/erlyvideo/include"}, {i, ".."}]}. +{"apps/ibrowse/src/*", [debug_info, {outdir, "apps/ibrowse/ebin"}, {i, "apps/ibrowse/src"}, {i, "deps"}]}. +{"apps/log4erl/src/*", [debug_info, {outdir, "apps/log4erl/ebin"}, {i, "apps/log4erl/include"}]}. +{"apps/mpegts/src/*", [debug_info, {outdir, "apps/mpegts/ebin"}, {i, "apps/mpegts/src"}, {i, "deps"},native,{hipe,o3}]}. +{"apps/rtmp/src/*", [debug_info, {outdir, "apps/rtmp/ebin"}, {i, "apps/rtmp/src"},{i,"deps"}]}. +{"apps/rtp/src/*", [debug_info, {outdir, "apps/rtp/ebin"}, {i, "apps/rtp/src"}, {i, "apps/rtp/include"}, {i, "deps"}]}. +{"apps/rtsp/src/*", [debug_info, {outdir, "apps/rtsp/ebin"}, {i, "apps/rtsp/src"}, {i, "deps"}]}. +% , bin_opt_info, diff --git a/Makefile b/Makefile index 7f0db9f0..761e57c7 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ update: compile: ./rebar compile -release: +release: compile ./rebar generate force=1 chmod +x erlyvideo/bin/erlyvideo @@ -41,6 +41,10 @@ ebin/mmap.so: src/core/mmap.c archive: git archive --prefix=erlyvideo-$(VERSION)/ v$(VERSION) | gzip -9 > ../erlyvideo-$(VERSION).tar.gz +tgz: release + tar zcvf erlyvideo-$(VERSION).tar.gz erlyvideo + + clean: ./rebar clean rm -fv plugins/*/ebin/*.beam @@ -52,8 +56,8 @@ clean-doc: rm -fv doc/*.css -run: priv/erlyvideo.conf priv/log4erl.conf - contrib/erlyctl run +run: priv/erlyvideo.conf priv/log4erl.conf compile + ERL_LIBS=apps:.. erl -boot start_sasl -s erlyvideo priv/log4erl.conf: priv/log4erl.conf.sample [ -f priv/log4erl.conf ] || cp priv/log4erl.conf.sample priv/log4erl.conf @@ -61,30 +65,6 @@ priv/log4erl.conf: priv/log4erl.conf.sample priv/erlyvideo.conf: priv/erlyvideo.conf.sample [ -f priv/erlyvideo.conf ] || cp priv/erlyvideo.conf.sample priv/erlyvideo.conf -start: priv/erlyvideo.conf - contrib/erlyctl start - -install: compile - mkdir -p $(DESTROOT)/var/lib/erlyvideo/movies - mkdir -p $(DESTROOT)/var/lib/erlyvideo/plugins - mkdir -p $(DESTROOT)$(ERLDIR) - cp -r ebin src include Emakefile $(DESTROOT)$(ERLDIR)/ - mkdir -p $(DESTROOT)/usr/bin/ - cp contrib/reverse_mpegts $(DESTROOT)/usr/bin/reverse_mpegts - cp contrib/erlyctl.debian $(DESTROOT)/usr/bin/erlyctl - mkdir -p $(DESTROOT)/etc/init.d/ - ln -s /usr/bin/erlyctl $(DESTROOT)/etc/init.d/erlyvideo - cp -r wwwroot $(DESTROOT)/var/lib/erlyvideo/ - mkdir -p $(DESTROOT)/var/log/erlyvideo - mkdir -p $(DESTROOT)/etc/erlyvideo - cp priv/erlyvideo.conf.debian $(DESTROOT)/etc/erlyvideo/erlyvideo.conf - cp priv/log4erl.conf.debian $(DESTROOT)/etc/erlyvideo/log4erl.conf - cp priv/production.config.debian $(DESTROOT)/etc/erlyvideo/production.config - mkdir -p $(DESTROOT)/var/cache/erlyvideo/licensed - chown erlyvideo.erlyvideo $(DESTROOT)/var/lib/erlyvideo/movies - chown erlyvideo.erlyvideo $(DESTROOT)/var/cache/erlyvideo/licensed - for i in deps/amf deps/log4erl deps/erlmedia deps/mpegts deps/rtmp deps/rtp deps/rtsp deps/ibrowse ; do (cd $$i; make DESTROOT=$(DESTROOT) ERLANG_ROOT=$(ERLANG_ROOT) VERSION=$(VERSION) install) ; done - .PHONY: doc debian compile diff --git a/apps/erlyvideo/src/erlyvideo.erl b/apps/erlyvideo/src/erlyvideo.erl index 554d8cb1..9e35eeb2 100644 --- a/apps/erlyvideo/src/erlyvideo.erl +++ b/apps/erlyvideo/src/erlyvideo.erl @@ -124,6 +124,9 @@ vhosts() -> %%-------------------------------------------------------------------- start() -> + application:load(erlyvideo), + {ok, Apps} = application:get_key(erlyvideo, applications), + [application:start(App) || App <- Apps], application:start(erlyvideo). start_http() -> diff --git a/contrib/erlyctl b/contrib/erlyctl deleted file mode 100755 index 0622d11e..00000000 --- a/contrib/erlyctl +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: erlyvideo -# Required-Start: $network -# Required-Stop: $network -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Start erlyvideo at boot time and control it in runtime -# Description: Enable service provided by erlyvideo. -### END INIT INFO - - - -NODE=ems -HOST=`hostname` -DOTTED=`hostname | grep '\.'` -if [ "" = "$DOTTED" ] ;then - TYPE="sname" -else - TYPE="name" -fi - - -ERL="erl +A 4 +K true" - -start() -{ - export ERL_LIBS=deps:lib:plugins:.. - EBIN=`erl -eval 'io:format("~s", [code:lib_dir(erlyvideo,ebin)])' -s init stop -noshell` - if [ -f "/etc/erlyvideo/production.config" ] ; then - CONFIG="-config /etc/erlyvideo/production.config" - else if [ -f "priv/production.config" ] ; then - CONFIG="-config priv/production.config" - else - CONFIG="" - fi - fi - $ERL -noinput -detached -pa ebin -pa "$EBIN" -pa /var/lib/erlyvideo/plugins $CONFIG \ - -kernel error_logger false \ - -boot start_sasl \ - -s erlyvideo \ - -$TYPE $NODE@$HOST -} - -run() -{ - if [ -f "priv/dev.config" ] ; then - CONFIG="-config priv/dev.config" - else if [ -f "/etc/erlyvideo/dev.config" ] ; then - CONFIG="-config /etc/erlyvideo/dev.config" - else - CONFIG="" - fi - fi - ERL_LIBS=apps:.. $ERL -pa apps/erlyvideo/ebin -pa /var/lib/erlyvideo/plugins $CONFIG \ - -boot start_sasl \ - -s erlyvideo \ - -$TYPE $NODE@$HOST - exit -} - -shell() -{ - $ERL \ - -$TYPE debug$NODE@$HOST \ - -pa ebin \ - -hidden \ - -remsh $NODE@$HOST -} - -ctl() -{ - $ERL \ - -$TYPE ctl$NODE@$HOST \ - -pa ebin \ - -noinput \ - -hidden \ - -s erlyvideo_ctl -extra $NODE@$HOST $@ -} - -usage() -{ - cat <<-EOF -erlyctl run (in foreground) -erlyctl start (in background) -erlyctl shell (remote shell) -erlyctl stop (shutdown server) -erlyctl reload (validate and reload config file) -erlyctl restart (reload config file and restart whole server) -EOF - exit -} - -stop() -{ - ctl stop -} - -reload() -{ - ctl restart -} - -restart() -{ - ctl restart -} - - -[ $# -lt 1 ] && usage - -$@ - diff --git a/contrib/update b/contrib/update deleted file mode 100755 index 8714f184..00000000 --- a/contrib/update +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -Package() -{ -echo $1 -cd $1 -if [ -d binary ] ; then -dpkg-scanpackages -m binary > binary/Packages -gzip -9c binary/Packages > binary/Packages.gz -Sign binary Packages -fi - -if [ -d testing-binary ] ; then -dpkg-scanpackages -m testing-binary > testing-binary/Packages -gzip -9c testing-binary/Packages > testing-binary/Packages.gz -Sign testing-binary Packages -fi - -if [ -d source ] ; then -dpkg-scansources source > source/Sources -gzip -c source/Sources > source/Sources.gz -#Sign source Sources -fi - -if [ -d testing-source ] ; then -dpkg-scansources testing-source > testing-source/Sources -gzip -c testing-source/Sources > testing-source/Sources.gz -#Sign testing-source Sources -fi -} - -Sign() { -cd $1 -echo "Origin: Erlyvideo repositories -Label: Erlyvideo -Archive: stable -Architectures: i386 amd64 all source -Components: net -Suite: binary -Version: 9.10 -Description: Erlyvideo streaming server http://erlyvideo.org/ -MD5Sum:" > Release - -#ls Packages* Sources* Release | while read ln -ls $2* Release | while read ln -do -md=`md5sum $ln |awk {' print $1 '}` -sz=`du -sb $ln` -echo " $md $sz" >> Release.tmp -done -cat Release.tmp >> Release -rm -f Release.tmp - -rm -f Release.gpg -gpg -sbao Release.gpg Release -cd .. -} - -Package /apps/erlyvideo/debian/public -Package /apps/erlyvideo/debian/closed - diff --git a/contrib/vlc-grabb b/contrib/vlc-grabb deleted file mode 100755 index 2e286892..00000000 --- a/contrib/vlc-grabb +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - - -/Applications/VLC.app/Contents/MacOS/VLC -vvv qtcapture:// --no-drop-late-frames --no-skip-frames --no-ffmpeg-hurry-up '--sout=#transcode{vcodec=h264,venc=x264{cabac=yes,bframes=0,keyint=125,ref=5,merange=24,mixed-refs=yes,direct=auto,me=umh,subme=7,trellis=2,weightb=yes,partitions=all,non-deterministic=yes,vbv-maxrate=1000,vbv-bufsize=9000,ratetol=1000.0,scenecut=60},vb=1000,deinterlace=yes,nohurry-up,acodec=mp4a,ab=64,channels=2,width=320,height=240}:std{access=http,mux=ts{pid-video=101,pid-audio=100},dst=:8090}' \ No newline at end of file diff --git a/reltool.config b/reltool.config index 9e13c5b6..566aabd3 100644 --- a/reltool.config +++ b/reltool.config @@ -30,5 +30,9 @@ {copy, "files/vm.args", "etc/vm.args"}, {copy, "wwwroot"}, {copy, "priv/erlyvideo.conf.sample", "etc/erlyvideo.conf.sample"}, - {copy, "priv/log4erl.conf.sample", "etc/log4erl.conf.sample"} + {copy, "priv/log4erl.conf.sample", "etc/log4erl.conf.sample"}, + {copy, "contrib/reverse_mpegts", "bin/reverse_mpegts"}, + {copy, "contrib/rtmp_bench", "bin/rtmp_bench"}, + {copy, "contrib/rtmp_proxy", "bin/rtmp_proxy"}, + {copy, "contrib/rtsp_test_client", "bin/rtsp_test_client"} ]}.