39 lines
1.2 KiB
Bash
39 lines
1.2 KiB
Bash
#!/bin/bash
|
|
|
|
build_ss_libev(){
|
|
SS_DIR = $BUILD_DIR/shadowsocks-libev
|
|
set -ex && \
|
|
apk add --no-cache --virtual .build-deps git autoconf automake libtool build-base libev-dev linux-headers libsodium-dev mbedtls-dev pcre-dev c-ares-dev
|
|
git clone https://github.com/shadowsocks/shadowsocks-libev $SS_DIR
|
|
cd $SS_DIR
|
|
./autogen.sh
|
|
./configure --prefix=/usr --disable-documentation
|
|
make install
|
|
|
|
runDeps="$( \
|
|
scanelf --needed --nobanner /usr/bin/ss-* \
|
|
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
|
|
| xargs -r apk info --installed \
|
|
| sort -u \
|
|
)"
|
|
apk add --no-cache --virtual .run-deps rng-tools $runDeps
|
|
apk del .build-deps
|
|
rm -rf $SS_DIR/*
|
|
}
|
|
|
|
build_obfs(){
|
|
OBFS_DIR = $BUILD_DIR/simple-obfs
|
|
apk add gcc autoconf make libtool automake zlib-devel openssl asciidoc xmlto libpcre32 libev-dev g++ linux-headers
|
|
git clone https://github.com/shadowsocks/simple-obfs.git $OBFS_DIR
|
|
cd $OBFS_DIR
|
|
git submodule update --init --recursive
|
|
./autogen.sh && ./configure
|
|
make && make install
|
|
}
|
|
mkdir $ASSETS_DIR/.build_dir
|
|
BUILD_DIR = $ASSETS_DIR/.build_dir
|
|
apk update
|
|
build_ss_libev
|
|
build_obfs
|
|
rm -rf $BUILD_DIR/*
|