本文主要描述如何使用自定義git分支製作穩定deb安裝包.
一、準備bugfix後的git分支:
1. 從FreeSWITCH主站fork到自己的git站點 https://github.com/signalwire/freeswitch.git
2. 自己的特性分支修復bug,然後合併到 v1.10分支
3. 打出自己的release穩定tag v1.10.1-we
二、編譯deb包(參考:https://freeswitch.org/confluence/display/FREESWITCH/Debian+9+Stretch)
wget -O - https://files.freeswitch.org/repo/deb/debian-unstable/freeswitch_archive_g0.pub | apt-key add -
echo "deb http://files.freeswitch.org/repo/deb/debian-unstable/ stretch main" > /etc/apt/sources.list.d/freeswitch.list
echo "deb-src http://files.freeswitch.org/repo/deb/debian-unstable/ stretch main" >> /etc/apt/sources.list.d/freeswitch.list
apt-get update && apt-get install -y xz-utils devscripts cowbuilder git screen
# nonstandard packages from freeswitch repo are not trusted by pbuilder !!
echo "ALLOWUNTRUSTED=yes" >> /etc/pbuilderrc
# get the latest master. Use the -b flag to get a specific branch
mkdir /usr/src/freeswitch-debs
git clone https://github.com/yine-studio/freeswitch.git -bv1.10.1-we /usr/src/freeswitch-debs/freeswitch-v1.10.1-we
cd /usr/src/freeswitch-debs
# here it's good to run screen with logging, so that you can detach from the shell prompt
screen -L
cd freeswitch
./debian/util.sh build-all -aamd64 -cstretch
# here you can detach by Ctrl-a Ctrl-d and see the log files in /usr/src/freeswitch-debs/log/ folder.
# The build may last about an hour, depending on your CPU speed.
# If the build is successful, you will have a bunch of .deb files in /usr/src/freeswitch-debs
1. 如果報錯執行:git clean -fdx && git reset --hard origin/v1.10 (你的具體分支)
三、安裝測試
1. sudo dpkg -i package_file.deb
2. sudo dpkg -r package_name