mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
package support arm package
This commit is contained in:
parent
0e54967fb8
commit
7431c110fe
2 changed files with 30 additions and 7 deletions
|
@ -109,7 +109,7 @@ function Ubuntu_prepare()
|
||||||
echo "Ubuntu install tools success"
|
echo "Ubuntu install tools success"
|
||||||
return 0
|
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
|
# for Centos, auto install tools by yum
|
||||||
#####################################################################################
|
#####################################################################################
|
||||||
|
@ -193,7 +193,7 @@ function Centos_prepare()
|
||||||
echo "Centos install tools success"
|
echo "Centos install tools success"
|
||||||
return 0
|
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
|
# st-1.9
|
||||||
|
|
|
@ -1,11 +1,20 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Usage:
|
||||||
|
# bash package.sh [arm]
|
||||||
|
# option arm, whether build for arm, requires ubuntu12.
|
||||||
|
|
||||||
# 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.
|
||||||
|
ARM=NO
|
||||||
|
|
||||||
##################################################################################
|
##################################################################################
|
||||||
##################################################################################
|
##################################################################################
|
||||||
##################################################################################
|
##################################################################################
|
||||||
|
# parse options.
|
||||||
|
if [[ $1 == "arm" ]]; then ARM=YES; 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"
|
||||||
if [[ ! -f $0 ]]; then
|
if [[ ! -f $0 ]]; then
|
||||||
|
@ -34,11 +43,19 @@ 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"
|
ok_msg "start build srs"
|
||||||
(
|
if [ $ARM = YES ]; then
|
||||||
cd $work_dir &&
|
(
|
||||||
./configure --with-ssl --with-hls --with-nginx --with-ffmpeg --with-http-callback --prefix=$INSTALL &&
|
cd $work_dir &&
|
||||||
make && rm -rf $package_dir && make DESTDIR=$package_dir install
|
./configure --with-ssl --with-arm-ubuntu12 --prefix=$INSTALL &&
|
||||||
) >> $log 2>&1
|
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
|
ret=$?; if [[ 0 -ne ${ret} ]]; then failed_msg "build srs failed"; exit $ret; fi
|
||||||
ok_msg "build srs success"
|
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
|
ret=$?; if [[ 0 -ne ${ret} ]]; then failed_msg "copy extra files failed"; exit $ret; fi
|
||||||
ok_msg "copy extra files success"
|
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
|
# generate zip dir and zip filename
|
||||||
srs_version=`${build_objs}/srs -v 2>/dev/stdout 1>/dev/null` &&
|
srs_version=`${build_objs}/srs -v 2>/dev/stdout 1>/dev/null` &&
|
||||||
zip_dir="SRS-${os_name}${os_major_version}-${os_machine}-${srs_version}"
|
zip_dir="SRS-${os_name}${os_major_version}-${os_machine}-${srs_version}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue