winlin

package support arm package

... ... @@ -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
... ...
#!/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"
(
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
) >> $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}"
... ...