From af57095cc6f0e35932772a8947612a2255419a5d Mon Sep 17 00:00:00 2001 From: Simon Shi Date: Wed, 15 Mar 2017 22:49:18 +0800 Subject: [PATCH] Readme refine (#1360) * Readme refine 1. update libsodium version 2. remove some duplicate information 3. move some building suggestion to other part of document Signed-off-by: Simon * mbedtls * fix 1. distributions 2. usage 3. typo --- README.md | 119 +++++++++++++++++++++++++++--------------------------- 1 file changed, 59 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index 7e62b2bc..bbac94b5 100644 --- a/README.md +++ b/README.md @@ -33,34 +33,9 @@ cd shadowsocks-libev git submodule update --init --recursive ``` -### Build and install with recent mbedTLS and libsodium +### Build and install with recent libsodium -You have to install libsodium 1.0.8 or later before building. - -If your system is too old to provide libmbedtls and libsodium (later than **v1.0.8**), -you will need to either install those libraries manually or upgrade your system. - -If your system provides with those libraries, you **should** **not** install them -from source. You should jump this section and install them from distribution -repository instead. - -```bash -export LIBSODIUM_VER=1.0.11 -export MBEDTLS_VER=2.4.0 -wget https://github.com/jedisct1/libsodium/releases/download/1.0.11/libsodium-$LIBSODIUM_VER.tar.gz -tar xvf libsodium-$LIBSODIUM_VER.tar.gz -pushd libsodium-$LIBSODIUM_VER -./configure --prefix=/usr && make -sudo make install -popd -wget https://tls.mbed.org/download/mbedtls-$MBEDTLS_VER-gpl.tgz -tar xvf mbedtls-$MBEDTLS_VER-gpl.tgz -pushd mbedtls-$MBEDTLS_VER -make SHARED=1 CFLAGS=-fPIC -sudo make DESTDIR=/usr install -popd -sudo ldconfig -``` +You have to install libsodium 1.0.8 or later before building. See [Directly build and install on UNIX-like system](#Linux). ## Installation @@ -93,16 +68,21 @@ try `configure --help`. #### Install from repository -**Note: The repositories doesn't always contain the latest version. Please build from source if you want the latest version (see below)** +**Note: The repositories doesn't always contain the latest version. Please build from source if you want the latest version. (see below)** + +Shadowsocks-libev is available in the official repository for following distributions: -Shadowsocks-libev is available in the official repository for Debian 9("Stretch"), unstable, Ubuntu 16.10 and later derivatives: +* Debian 9 or higher (including testing and unstable/sid) +* Ubuntu 16.10 or higher ```bash sudo apt update sudo apt install shadowsocks-libev ``` -For Debian Jessie users, please install it from `jessie-backports`: +For **Debian 8 (Jessie)** users, please install it from `jessie-backports`: +We strongly encourage you to install shadowsocks-libev from `jessie-backports`. +Please follow instructions on [Debian Backports](https://backports.debian.org). ```bash sudo sh -c 'printf "deb http://httpredir.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list' @@ -112,26 +92,13 @@ sudo apt -t jessie-backports install shadowsocks-libev #### Build deb package from source -Supported Platforms: - -* Debian 8 (see below), 9, unstable -* Ubuntu 16.04 or higher - -For older systems, building `.deb` packages is not supported. -Please directly install from source. -You may need to resolve library dependencies by yourself. +Supported distributions: -**Note for Debian 8.x users**: -We strongly encourage you to install shadowsocks-libev from `jessie-backports`. -Please follow instructions on [Debian Backports](https://backports.debian.org). +* Debian 8, 9 or higher +* Ubuntu 14.04 LTS, 16.04 LTS, 16.10 or higher -If you insist on building from source, you will need to manually install libsodium -from `jessie-backports`, **NOT** libsodium in main repository. -Please follow the instructions on [Debian Backports Website](https://backports.debian.org). +For older systems, building `.deb` packages is not supported. Please directly install it from source. -You can also use the same build script for Ubuntu LTS as below. - -**Note for Debian (>=8) / Ubuntu 14.04 (Trusty) / 16.04 (Xenial) users**: You can build shadowsocks-libev and all its dependencies by script: ```bash @@ -141,8 +108,13 @@ cd ~/build-area ./build_deb.sh ``` -Otherwise, try to build and install directly from source. See the [Linux](#linux) -section below. +Otherwise, try to build and install directly from source. See the [Linux](#linux) section below. + +**Note for Debian 8 (Jessie) users**: + +We strongly encourage you to install shadowsocks-libev from `jessie-backports`. If you insist on building from source, you will need to manually install libsodium from `jessie-backports`, **NOT** libsodium in main repository. + +Please follow the instructions on [Debian Backports Website](https://backports.debian.org). ``` bash cd shadowsocks-libev @@ -169,13 +141,14 @@ sudo systemctl start shadowsocks-libev # for systemd ### Fedora & RHEL -Supported distributions include -- Fedora 22, 23, 24 -- RHEL 6, 7 and derivatives (including CentOS, Scientific Linux) +Supported distributions: + +* Fedora 22, 23, 24 +* RHEL 6, 7 and derivatives (including CentOS, Scientific Linux) #### Build from source with centos -If you are using CentOS 7, you need to install these prequirement to build from source code +If you are using CentOS 7, you need to install these prequirement to build from source code: ```bash yum install epel-release -y @@ -241,16 +214,42 @@ In general, you need the following build dependencies: * asciidoc (for documentation only) * xmlto (for documentation only) -For Unix-like systems, especially Debian-based systems, -e.g. Ubuntu, Debian or Linux Mint, you might install build dependencies like this: +If your system is too old to provide libmbedtls and libsodium (later than **v1.0.8**), you will need to either install those libraries manually or upgrade your system. + +If your system provides with those libraries, you **should not** install them from source. You should jump this section and install them from distribution repository instead. + +For some of the distributions, you might install build dependencies like this: ```bash -# Debian / Ubuntu +# Installation of basic build dependencies +## Debian / Ubuntu sudo apt-get install --no-install-recommends gettext build-essential autoconf libtool libpcre3-dev asciidoc xmlto libev-dev libudns-dev automake libmbedtls-dev libsodium-dev -# CentOS / Fedora / RHEL +## CentOS / Fedora / RHEL sudo yum install gettext gcc autoconf libtool automake make asciidoc xmlto udns-devel libev-devel -# Arch +## Arch sudo pacman -S gettext gcc autoconf libtool automake make asciidoc xmlto udns libev + +# Installation of Libsodium +export LIBSODIUM_VER=1.0.12 +wget https://download.libsodium.org/libsodium/releases/libsodium-$LIBSODIUM_VER.tar.gz +tar xvf libsodium-$LIBSODIUM_VER.tar.gz +pushd libsodium-$LIBSODIUM_VER +./configure --prefix=/usr && make +sudo make install +popd +sudo ldconfig + +# Installation of MbedTLS +export MBEDTLS_VER=2.4.2 +wget https://tls.mbed.org/download/mbedtls-$MBEDTLS_VER-gpl.tgz +tar xvf mbedtls-$MBEDTLS_VER-gpl.tgz +pushd mbedtls-$MBEDTLS_VER +make SHARED=1 CFLAGS=-fPIC +sudo make DESTDIR=/usr install +popd +sudo ldconfig + +# Start building ./autogen.sh && ./configure && make sudo make install ``` @@ -300,8 +299,8 @@ brew install shadowsocks-libev ## Usage -For a detailed and complete list of all supported arguments, you may refer to the -man pages of the applications, respectively. +For a detailed and complete list of all supported arguments, +you may refer to the man pages of the applications, respectively. ```    ss-[local|redir|server|tunnel|manager]