diff --git a/README.md b/README.md index ffafac8c2..b1c63937f 100755 --- a/README.md +++ b/README.md @@ -155,6 +155,7 @@ For previous versions, please read: ## V4 changes +* v4.0, 2020-12-24, Support disable CherryPy. 4.0.57 * v4.0, 2020-11-12, For [#1998][bug #1998], Support Firefox, use PT in offer. 4.0.55 * v4.0, 2020-11-11, For [#1508][bug #1508], Transform http header name to upper camel case. 4.0.54 * v4.0, 2020-11-06, For [#1657][bug #1657], Read cached data first in SSL. 4.0.48 diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index d76c72106..9aaa645fd 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -430,36 +430,38 @@ echo "Nginx is ok." > ${SRS_OBJS}/nginx/html/nginx.html ##################################################################################### # cherrypy for http hooks callback, CherryPy-3.2.4 ##################################################################################### -# Detect python or python2 -python --version >/dev/null 2>&1 && SYS_PYTHON=python; -python2 --version >/dev/null 2>&1 && SYS_PYTHON=python2; -# Install cherrypy for api server. -if [[ -f ${SRS_OBJS}/${SRS_PLATFORM}/CherryPy-3.2.4/setup.py ]]; then - echo "CherryPy-3.2.4 is ok."; -else - echo "Installing CherryPy-3.2.4"; - ( - rm -rf ${SRS_OBJS}/CherryPy-3.2.4 && cd ${SRS_OBJS}/${SRS_PLATFORM} && - unzip -q ../../3rdparty/CherryPy-3.2.4.zip && cd CherryPy-3.2.4 && - $SYS_PYTHON setup.py install --user --prefix='' - ) +if [[ $SRS_CHERRYPY == YES ]]; then + # Detect python or python2 + python --version >/dev/null 2>&1 && SYS_PYTHON=python; + python2 --version >/dev/null 2>&1 && SYS_PYTHON=python2; + # Install cherrypy for api server. + if [[ -f ${SRS_OBJS}/${SRS_PLATFORM}/CherryPy-3.2.4/setup.py ]]; then + echo "CherryPy-3.2.4 is ok."; + else + echo "Installing CherryPy-3.2.4"; + ( + rm -rf ${SRS_OBJS}/CherryPy-3.2.4 && cd ${SRS_OBJS}/${SRS_PLATFORM} && + unzip -q ../../3rdparty/CherryPy-3.2.4.zip && cd CherryPy-3.2.4 && + $SYS_PYTHON setup.py install --user --prefix='' + ) + fi + # check status + ret=$?; if [[ $ret -ne 0 ]]; then echo "build CherryPy-3.2.4 failed, ret=$ret"; exit $ret; fi + if [ ! -f ${SRS_OBJS}/${SRS_PLATFORM}/CherryPy-3.2.4/setup.py ]; then echo "build CherryPy-3.2.4 failed."; exit -1; fi + + echo "Link players to cherrypy static-dir" + rm -rf research/api-server/static-dir/players && + ln -sf `pwd`/research/players research/api-server/static-dir/players && + rm -f research/api-server/static-dir/crossdomain.xml && + ln -sf `pwd`/research/players/crossdomain.xml research/api-server/static-dir/crossdomain.xml && + rm -rf research/api-server/static-dir/live && + mkdir -p `pwd`/${SRS_OBJS}/nginx/html/live && + ln -sf `pwd`/${SRS_OBJS}/nginx/html/live research/api-server/static-dir/live && + rm -rf research/api-server/static-dir/forward && + mkdir -p `pwd`/${SRS_OBJS}/nginx/html/forward && + ln -sf `pwd`/${SRS_OBJS}/nginx/html/forward research/api-server/static-dir/forward + ret=$?; if [[ $ret -ne 0 ]]; then echo "Warning: Ignore error to link players to cherrypy static-dir."; fi fi -# check status -ret=$?; if [[ $ret -ne 0 ]]; then echo "build CherryPy-3.2.4 failed, ret=$ret"; exit $ret; fi -if [ ! -f ${SRS_OBJS}/${SRS_PLATFORM}/CherryPy-3.2.4/setup.py ]; then echo "build CherryPy-3.2.4 failed."; exit -1; fi - -echo "Link players to cherrypy static-dir" -rm -rf research/api-server/static-dir/players && -ln -sf `pwd`/research/players research/api-server/static-dir/players && -rm -f research/api-server/static-dir/crossdomain.xml && -ln -sf `pwd`/research/players/crossdomain.xml research/api-server/static-dir/crossdomain.xml && -rm -rf research/api-server/static-dir/live && -mkdir -p `pwd`/${SRS_OBJS}/nginx/html/live && -ln -sf `pwd`/${SRS_OBJS}/nginx/html/live research/api-server/static-dir/live && -rm -rf research/api-server/static-dir/forward && -mkdir -p `pwd`/${SRS_OBJS}/nginx/html/forward && -ln -sf `pwd`/${SRS_OBJS}/nginx/html/forward research/api-server/static-dir/forward -ret=$?; if [[ $ret -ne 0 ]]; then echo "Warning: Ignore error to link players to cherrypy static-dir."; fi ##################################################################################### # openssl, for rtmp complex handshake and HLS encryption. diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index 3cfd64eb9..ed33b72fe 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -45,6 +45,7 @@ SRS_HTTP_API=YES SRS_HTTP_CORE=YES SRS_HLS=YES SRS_DVR=YES +SRS_CHERRYPY=YES # ################################################################ # FFmpeg stub is the stub code in SRS for ingester or encoder. @@ -317,6 +318,7 @@ function parse_user_option() { --with-utest) SRS_UTEST=YES ;; --without-utest) SRS_UTEST=NO ;; --utest) if [[ $value == off ]]; then SRS_UTEST=NO; else SRS_UTEST=YES; fi ;; + --cherrypy) if [[ $value == off ]]; then SRS_CHERRYPY=NO; else SRS_CHERRYPY=YES; fi ;; --with-srt) SRS_SRT=YES ;; --without-srt) SRS_SRT=NO ;; @@ -548,6 +550,7 @@ function regenerate_options() { if [ $SRS_STREAM_CASTER = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --stream-caster=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --stream-caster=off"; fi if [ $SRS_HTTP_API = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --http-api=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --http-api=off"; fi if [ $SRS_UTEST = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --utest=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --utest=off"; fi + if [ $SRS_CHERRYPY = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cherrypy=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cherrypy=off"; fi if [ $SRS_SRT = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --srt=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --srt=off"; fi if [ $SRS_RTC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --rtc=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --rtc=off"; fi if [ $SRS_SIMULATOR = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --simulator=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --simulator=off"; fi diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index 9fb9d1774..4b594c2df 100644 --- a/trunk/src/core/srs_core_version4.hpp +++ b/trunk/src/core/srs_core_version4.hpp @@ -24,6 +24,6 @@ #ifndef SRS_CORE_VERSION4_HPP #define SRS_CORE_VERSION4_HPP -#define SRS_VERSION4_REVISION 56 +#define SRS_VERSION4_REVISION 57 #endif