1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 03:41:55 +00:00

package support arm package

This commit is contained in:
winlin 2014-03-24 10:51:37 +08:00
parent 0e54967fb8
commit 7431c110fe
2 changed files with 30 additions and 7 deletions

View file

@ -109,7 +109,7 @@ function Ubuntu_prepare()
echo "Ubuntu install tools success"
return 0
}
Ubuntu_prepare; ret=$?; if [[ 0 -ne $ret ]]; then echo "Ubuntu perfapre failed, ret=$ret"; exit $ret; fi
Ubuntu_prepare; ret=$?; if [[ 0 -ne $ret ]]; then echo "Ubuntu prepare failed, ret=$ret"; exit $ret; fi
#####################################################################################
# for Centos, auto install tools by yum
#####################################################################################
@ -193,7 +193,7 @@ function Centos_prepare()
echo "Centos install tools success"
return 0
}
Centos_prepare; ret=$?; if [[ 0 -ne $ret ]]; then "CentOS perfapre failed, ret=$ret"; exit $ret; fi
Centos_prepare; ret=$?; if [[ 0 -ne $ret ]]; then echo "CentOS prepare failed, ret=$ret"; exit $ret; fi
#####################################################################################
# st-1.9

View file

@ -1,11 +1,20 @@
#!/bin/bash
# Usage:
# bash package.sh [arm]
# option arm, whether build for arm, requires ubuntu12.
# user can config the following configs, then package.
INSTALL=/usr/local/srs
# whether build for arm, only for ubuntu12.
ARM=NO
##################################################################################
##################################################################################
##################################################################################
# parse options.
if [[ $1 == "arm" ]]; then ARM=YES; fi
# discover the current work dir, the log and access.
echo "argv[0]=$0"
if [[ ! -f $0 ]]; then
@ -34,11 +43,19 @@ ok_msg "target os is ${os_name}-${os_major_version} ${os_release} ${os_machine}"
# build srs
# @see https://github.com/winlinvip/simple-rtmp-server/wiki/Build
ok_msg "start build srs"
(
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
if [ $ARM = YES ]; then
(
cd $work_dir &&
./configure --with-ssl --with-arm-ubuntu12 --prefix=$INSTALL &&
make && rm -rf $package_dir && make DESTDIR=$package_dir install
) >> $log 2>&1
else
(
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
ret=$?; if [[ 0 -ne ${ret} ]]; then failed_msg "build srs failed"; exit $ret; fi
ok_msg "build srs success"
@ -54,6 +71,12 @@ ok_msg "start copy extra files to package"
ret=$?; if [[ 0 -ne ${ret} ]]; then failed_msg "copy extra files failed"; exit $ret; fi
ok_msg "copy extra files success"
# detect for arm.
if [ $ARM = YES ]; then
arm_cpu=`arm-linux-gnueabi-readelf --arch-specific ${build_objs}/srs|grep Tag_CPU_arch:|awk '{print $2}'`
os_machine='arm${arm_cpu}cpu';
fi
# generate zip dir and zip filename
srs_version=`${build_objs}/srs -v 2>/dev/stdout 1>/dev/null` &&
zip_dir="SRS-${os_name}${os_major_version}-${os_machine}-${srs_version}"