Browse Source

Add simple-obfs support to build_deb.sh script

pull/1307/head
Roger Shimizu 8 years ago
committed by Max Lv
parent
commit
e9c1116f0f
1 changed files with 34 additions and 4 deletions
  1. 38
      scripts/build_deb.sh

38
scripts/build_deb.sh

@ -40,11 +40,13 @@ apt_init() {
# Cleanup # Cleanup
apt_clean() { apt_clean() {
sudo apt-get purge -y $DEPS $DEPS_BPO shadowsocks-libev-build-deps \
libcork-dev libcorkipset-dev debhelper
sudo apt-get purge -y $DEPS $DEPS_BPO debhelper \
libbloom-dev libcork-dev libcorkipset-dev libmbedtls-dev \
libsodium-dev libbloom-build-deps simple-obfs-build-deps \
shadowsocks-libev-build-deps
sudo apt-get purge -y libcork-build-deps libcorkipset-build-deps sudo apt-get purge -y libcork-build-deps libcorkipset-build-deps
sudo apt-get purge -y mbedtls-build-deps libmbedtls-dev
sudo apt-get purge -y libsodium-build-deps libsodium-dev
sudo apt-get purge -y libsodium-build-deps
sudo apt-get purge -y mbedtls-build-deps
sudo apt-get autoremove -y sudo apt-get autoremove -y
} }
@ -63,6 +65,21 @@ gbp_build() {
cd - cd -
} }
git_build() {
REPO=$1
BRANCH=$2
PROJECT_NAME=$(basename $1|sed s/\.git$//)
git clone $REPO
cd $PROJECT_NAME
git checkout $BRANCH
mk-build-deps --root-cmd sudo --install --tool "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y"
rm ${PROJECT_NAME}-build-deps_*.deb
gbp buildpackage -us -uc --git-ignore-branch
git clean -fdx
git reset --hard HEAD
cd -
}
dsc_build() { dsc_build() {
DSC=$1 DSC=$1
DSC_FILE=$(basename $1) DSC_FILE=$(basename $1)
@ -129,6 +146,14 @@ build_install_sslibev() {
sudo apt-get install -fy sudo apt-get install -fy
} }
# Build and install simple-obfs
build_install_simpleobfs() {
BRANCH=$1
git_build https://github.com/rogers0/simple-obfs $BRANCH
sudo dpkg -i simple-obfs_*.deb
sudo apt-get install -fy
}
OSID=$(grep ^ID= /etc/os-release|cut -d= -f2) OSID=$(grep ^ID= /etc/os-release|cut -d= -f2)
case "$OSID" in case "$OSID" in
debian) debian)
@ -150,12 +175,14 @@ jessie)
apt_init "git-buildpackage equivs" "debhelper libsodium-dev" apt_init "git-buildpackage equivs" "debhelper libsodium-dev"
build_install_libbloom exp1 build_install_libbloom exp1
build_install_sslibev exp1 build_install_sslibev exp1
build_install_simpleobfs exp1
apt_clean apt_clean
;; ;;
stretch|unstable|sid) stretch|unstable|sid)
apt_init "git-buildpackage equivs" apt_init "git-buildpackage equivs"
build_install_libbloom exp1 build_install_libbloom exp1
build_install_sslibev exp1 build_install_sslibev exp1
build_install_simpleobfs exp1
apt_clean apt_clean
;; ;;
trusty) trusty)
@ -167,6 +194,7 @@ trusty)
build_install_libbloom exp1_trusty build_install_libbloom exp1_trusty
patch_sslibev_dh9 patch_sslibev_dh9
build_install_sslibev exp1 build_install_sslibev exp1
build_install_simpleobfs exp1_trusty
apt_clean apt_clean
;; ;;
xenial) xenial)
@ -175,6 +203,7 @@ xenial)
build_install_libcorkipset debian build_install_libcorkipset debian
build_install_libbloom exp1 build_install_libbloom exp1
build_install_sslibev exp1 build_install_sslibev exp1
build_install_simpleobfs exp1
apt_clean apt_clean
;; ;;
yakkety) yakkety)
@ -183,6 +212,7 @@ yakkety)
build_install_libcorkipset debian build_install_libcorkipset debian
build_install_libbloom exp1 build_install_libbloom exp1
build_install_sslibev exp1 build_install_sslibev exp1
build_install_simpleobfs exp1
apt_clean apt_clean
;; ;;
*) *)

Loading…
Cancel
Save