@@ -17,8 +17,24 @@ if [ -d .git ]; then
17
17
fi
18
18
19
19
apt_init () {
20
- DEPS=" git-buildpackage equivs"
21
- sudo apt-get update
20
+ DEPS=" $1 "
21
+ DEPS_BPO=" $2 "
22
+ if [ -n " $DEPS_BPO " ]; then
23
+ BPO=${OSVER} -backports
24
+ case " $OSID " in
25
+ debian)
26
+ REPO=http://httpredir.debian.org/debian
27
+ ;;
28
+ ubuntu)
29
+ REPO=http://archive.ubuntu.com/ubuntu
30
+ ;;
31
+ esac
32
+ sudo sh -c " printf \" deb $REPO ${OSVER} -backports main\" > /etc/apt/sources.list.d/${OSVER} -backports.list"
33
+ sudo apt-get update
34
+ sudo apt-get install -y -t $BPO $DEPS_BPO
35
+ else
36
+ sudo apt-get update
37
+ fi
22
38
sudo apt-get install -y $DEPS
23
39
}
24
40
@@ -123,15 +139,17 @@ wheezy|precise)
123
139
echo Sorry, your system $OSID /$OSVER is not supported.
124
140
;;
125
141
jessie)
126
- echo Please install from official backports repository:
127
- echo " apt install -t jessie-backports shadowsocks-libev"
142
+ apt_init " git-buildpackage equivs" " debhelper libsodium-dev"
143
+ build_install_sslibev
144
+ apt_clean
128
145
;;
129
146
stretch|unstable|sid|yakkety)
130
- echo Please install from official repository:
131
- echo " apt install shadowsocks-libev"
147
+ apt_init " git-buildpackage equivs"
148
+ build_install_sslibev
149
+ apt_clean
132
150
;;
133
151
trusty)
134
- apt_init
152
+ apt_init " git-buildpackage equivs "
135
153
build_install_libcork trusty
136
154
build_install_libcorkipset trusty
137
155
build_install_libmbedtls
@@ -141,12 +159,7 @@ trusty)
141
159
apt_clean
142
160
;;
143
161
xenial)
144
- DEPS_BPO=" debhelper"
145
- BPO=xenial-backports
146
- sudo sh -c ' printf "deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse" > /etc/apt/sources.list.d/xenial-backports.list'
147
- sudo apt-get update
148
- sudo apt-get install -y -t $BPO $DEPS_BPO
149
- apt_init
162
+ apt_init " git-buildpackage equivs" debhelper
150
163
build_install_libcork debian
151
164
build_install_libcorkipset debian
152
165
build_install_sslibev
0 commit comments