mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix bug of typo of readme. update package to support --help and options
This commit is contained in:
parent
41f5217360
commit
917f1ea9e1
2 changed files with 60 additions and 17 deletions
|
@ -81,7 +81,7 @@ cd simple-rtmp-server/trunk
|
||||||
## System Requirements
|
## System Requirements
|
||||||
Supported operating systems and hardware:
|
Supported operating systems and hardware:
|
||||||
* All Linux , both 32 and 64 bits
|
* All Linux , both 32 and 64 bits
|
||||||
* All handware.
|
* All hardware.
|
||||||
|
|
||||||
## Summary
|
## Summary
|
||||||
01. Simple: also stable enough.<br/>
|
01. Simple: also stable enough.<br/>
|
||||||
|
|
|
@ -7,13 +7,46 @@
|
||||||
# user can config the following configs, then package.
|
# user can config the following configs, then package.
|
||||||
INSTALL=/usr/local/srs
|
INSTALL=/usr/local/srs
|
||||||
# whether build for arm, only for ubuntu12.
|
# whether build for arm, only for ubuntu12.
|
||||||
|
help=NO
|
||||||
ARM=NO
|
ARM=NO
|
||||||
|
DO_BUILD=YES
|
||||||
|
|
||||||
##################################################################################
|
##################################################################################
|
||||||
##################################################################################
|
##################################################################################
|
||||||
##################################################################################
|
##################################################################################
|
||||||
# parse options.
|
# parse options.
|
||||||
if [[ $1 == "arm" ]]; then ARM=YES; fi
|
for option
|
||||||
|
do
|
||||||
|
case "$option" in
|
||||||
|
-*=*)
|
||||||
|
value=`echo "$option" | sed -e 's|[-_a-zA-Z0-9/]*=||'`
|
||||||
|
option=`echo "$option" | sed -e 's|=[-_a-zA-Z0-9/]*||'`
|
||||||
|
;;
|
||||||
|
*) value="" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "$option" in
|
||||||
|
--help) help=yes ;;
|
||||||
|
|
||||||
|
--arm) ARM=YES ;;
|
||||||
|
--no-build) DO_BUILD=NO ;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "$0: error: invalid option \"$option\""
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
if [ $help = yes ]; then
|
||||||
|
cat << END
|
||||||
|
|
||||||
|
--help print this message
|
||||||
|
|
||||||
|
--arm configure with arm and make srs. use arm tools to get info.
|
||||||
|
--no-build donot build srs, user has builded. only make install.
|
||||||
|
END
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# discover the current work dir, the log and access.
|
# discover the current work dir, the log and access.
|
||||||
echo "argv[0]=$0"
|
echo "argv[0]=$0"
|
||||||
|
@ -36,28 +69,38 @@ ret=$?; if [[ $ret -ne 0 ]]; then exit $ret; fi
|
||||||
os_name=`lsb_release --id|awk '{print $3}'` &&
|
os_name=`lsb_release --id|awk '{print $3}'` &&
|
||||||
os_release=`lsb_release --release|awk '{print $2}'` &&
|
os_release=`lsb_release --release|awk '{print $2}'` &&
|
||||||
os_major_version=`echo $os_release|awk -F '.' '{print $1}'` &&
|
os_major_version=`echo $os_release|awk -F '.' '{print $1}'` &&
|
||||||
os_machine=`uname -i`
|
os_machine=`uname -i`; if [[ "unknown" == $os_machine ]]; then os_machine=`uname -m`; fi
|
||||||
ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "lsb_release get os info failed."; exit $ret; fi
|
ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "lsb_release get os info failed."; exit $ret; fi
|
||||||
ok_msg "target os is ${os_name}-${os_major_version} ${os_release} ${os_machine}"
|
ok_msg "target os is ${os_name}-${os_major_version} ${os_release} ${os_machine}"
|
||||||
|
|
||||||
# build srs
|
# build srs
|
||||||
# @see https://github.com/winlinvip/simple-rtmp-server/wiki/Build
|
# @see https://github.com/winlinvip/simple-rtmp-server/wiki/Build
|
||||||
ok_msg "start build srs"
|
if [ $DO_BUILD = YES ]; then
|
||||||
if [ $ARM = YES ]; then
|
ok_msg "start build srs"
|
||||||
|
if [ $ARM = YES ]; then
|
||||||
(
|
(
|
||||||
cd $work_dir &&
|
cd $work_dir &&
|
||||||
./configure --with-ssl --with-arm-ubuntu12 --prefix=$INSTALL &&
|
./configure --with-ssl --with-arm-ubuntu12 --prefix=$INSTALL && make
|
||||||
make && rm -rf $package_dir && make DESTDIR=$package_dir install
|
|
||||||
) >> $log 2>&1
|
) >> $log 2>&1
|
||||||
|
else
|
||||||
|
(
|
||||||
|
cd $work_dir &&
|
||||||
|
./configure --with-ssl --with-hls --with-nginx --with-ffmpeg --with-http-callback --prefix=$INSTALL && make
|
||||||
|
) >> $log 2>&1
|
||||||
|
fi
|
||||||
|
ret=$?; if [[ 0 -ne ${ret} ]]; then failed_msg "build srs failed"; exit $ret; fi
|
||||||
|
ok_msg "build srs success"
|
||||||
else
|
else
|
||||||
(
|
ok_msg "user skip build, directly install"
|
||||||
cd $work_dir &&
|
|
||||||
./configure --with-ssl --with-hls --with-nginx --with-ffmpeg --with-http-callback --prefix=$INSTALL &&
|
|
||||||
make && rm -rf $package_dir && make DESTDIR=$package_dir install
|
|
||||||
) >> $log 2>&1
|
|
||||||
fi
|
fi
|
||||||
ret=$?; if [[ 0 -ne ${ret} ]]; then failed_msg "build srs failed"; exit $ret; fi
|
|
||||||
ok_msg "build srs success"
|
# install srs
|
||||||
|
ok_msg "start install srs"
|
||||||
|
(
|
||||||
|
cd $work_dir && rm -rf $package_dir && make DESTDIR=$package_dir install
|
||||||
|
) >> $log 2>&1
|
||||||
|
ret=$?; if [[ 0 -ne ${ret} ]]; then failed_msg "install srs failed"; exit $ret; fi
|
||||||
|
ok_msg "install srs success"
|
||||||
|
|
||||||
# copy extra files to package.
|
# copy extra files to package.
|
||||||
ok_msg "start copy extra files to package"
|
ok_msg "start copy extra files to package"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue