From 7dd72ceac15ecfa3cea7be3af1f1ae1ebb17eda7 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Tue, 14 Apr 2015 13:52:16 +0000 Subject: [PATCH 1/4] bootstrap: virtualenv for jessie+/utopic+ (fixes #346) --- bootstrap/ubuntu.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bootstrap/ubuntu.sh b/bootstrap/ubuntu.sh index 1acde595a..18c503e3a 100755 --- a/bootstrap/ubuntu.sh +++ b/bootstrap/ubuntu.sh @@ -5,11 +5,26 @@ # - 14.04 (x64, Vagrant) # - 14.10 (x64) +# virtualenv binary can be found in different packages depending on +# distro version (#346) +distro=$(lsb_release -si) +# 6.0.10 => 60, 14.04 => 1404 +version=$(lsb_release -sr | awk -F '.' '{print $1 $2}') +if [ "$distro" = "Ubuntu" -a "$version" -ge 1410 ] +then + virtualenv="virtualenv" +elif [ "$distro" = "Debian" -a "$version" -ge 80 ] +then + virtualenv="virtualenv" +else + virtualenv="python-virtualenv" +fi + # dpkg-dev: dpkg-architecture binary necessary to compile M2Crypto, c.f. # #276, https://github.com/martinpaljak/M2Crypto/issues/62, # M2Crypto setup.py:add_multiarch_paths sudo apt-get update sudo apt-get install -y --no-install-recommends \ - python python-setuptools python-virtualenv python-dev gcc swig \ + python python-setuptools "$virtualenv" python-dev gcc swig \ dialog libaugeas0 libssl-dev libffi-dev ca-certificates dpkg-dev From a3164ae2d9fbc681b7aebc5671086131108dec40 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Tue, 14 Apr 2015 14:12:41 +0000 Subject: [PATCH 2/4] bootstrap: _deb_common.sh --- bootstrap/_deb_common.sh | 35 +++++++++++++++++++++++++++++++++++ bootstrap/debian.sh | 2 +- bootstrap/ubuntu.sh | 31 +------------------------------ 3 files changed, 37 insertions(+), 31 deletions(-) create mode 100755 bootstrap/_deb_common.sh mode change 100755 => 120000 bootstrap/ubuntu.sh diff --git a/bootstrap/_deb_common.sh b/bootstrap/_deb_common.sh new file mode 100755 index 000000000..ccb4c4b2f --- /dev/null +++ b/bootstrap/_deb_common.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +# Tested with: +# - Ubuntu: +# - 12.04 (x64, Travis) +# - 14.04 (x64, Vagrant) +# - 14.10 (x64) +# - Debian: +# - 6.0.10 "squeeze" (x64) +# - 7.8 "wheezy" (x64) +# - 8.0 "jessie" (x64) + +# virtualenv binary can be found in different packages depending on +# distro version (#346) +distro=$(lsb_release -si) +# 6.0.10 => 60, 14.04 => 1404 +version=$(lsb_release -sr | awk -F '.' '{print $1 $2}') +if [ "$distro" = "Ubuntu" -a "$version" -ge 1410 ] +then + virtualenv="virtualenv" +elif [ "$distro" = "Debian" -a "$version" -ge 80 ] +then + virtualenv="virtualenv" +else + virtualenv="python-virtualenv" +fi + +# dpkg-dev: dpkg-architecture binary necessary to compile M2Crypto, c.f. +# #276, https://github.com/martinpaljak/M2Crypto/issues/62, +# M2Crypto setup.py:add_multiarch_paths + +sudo apt-get update +sudo apt-get install -y --no-install-recommends \ + python python-setuptools "$virtualenv" python-dev gcc swig \ + dialog libaugeas0 libssl-dev libffi-dev ca-certificates dpkg-dev diff --git a/bootstrap/debian.sh b/bootstrap/debian.sh index f215cf2e0..068a039cb 120000 --- a/bootstrap/debian.sh +++ b/bootstrap/debian.sh @@ -1 +1 @@ -ubuntu.sh \ No newline at end of file +_deb_common.sh \ No newline at end of file diff --git a/bootstrap/ubuntu.sh b/bootstrap/ubuntu.sh deleted file mode 100755 index 18c503e3a..000000000 --- a/bootstrap/ubuntu.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# Tested with: -# - 12.04 (x64, Travis) -# - 14.04 (x64, Vagrant) -# - 14.10 (x64) - -# virtualenv binary can be found in different packages depending on -# distro version (#346) -distro=$(lsb_release -si) -# 6.0.10 => 60, 14.04 => 1404 -version=$(lsb_release -sr | awk -F '.' '{print $1 $2}') -if [ "$distro" = "Ubuntu" -a "$version" -ge 1410 ] -then - virtualenv="virtualenv" -elif [ "$distro" = "Debian" -a "$version" -ge 80 ] -then - virtualenv="virtualenv" -else - virtualenv="python-virtualenv" -fi - -# dpkg-dev: dpkg-architecture binary necessary to compile M2Crypto, c.f. -# #276, https://github.com/martinpaljak/M2Crypto/issues/62, -# M2Crypto setup.py:add_multiarch_paths - -sudo apt-get update -sudo apt-get install -y --no-install-recommends \ - python python-setuptools "$virtualenv" python-dev gcc swig \ - dialog libaugeas0 libssl-dev libffi-dev ca-certificates dpkg-dev diff --git a/bootstrap/ubuntu.sh b/bootstrap/ubuntu.sh new file mode 120000 index 000000000..068a039cb --- /dev/null +++ b/bootstrap/ubuntu.sh @@ -0,0 +1 @@ +_deb_common.sh \ No newline at end of file From 578680285f400b71e28b096bb9e8ad8015bb43b4 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Tue, 14 Apr 2015 14:18:11 +0000 Subject: [PATCH 3/4] Take out sudo from bootstrap scripts --- bootstrap/_deb_common.sh | 8 ++++---- bootstrap/mac.sh | 2 +- docs/using.rst | 10 ++++------ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/bootstrap/_deb_common.sh b/bootstrap/_deb_common.sh index ccb4c4b2f..b09130d77 100755 --- a/bootstrap/_deb_common.sh +++ b/bootstrap/_deb_common.sh @@ -29,7 +29,7 @@ fi # #276, https://github.com/martinpaljak/M2Crypto/issues/62, # M2Crypto setup.py:add_multiarch_paths -sudo apt-get update -sudo apt-get install -y --no-install-recommends \ - python python-setuptools "$virtualenv" python-dev gcc swig \ - dialog libaugeas0 libssl-dev libffi-dev ca-certificates dpkg-dev +apt-get update +apt-get install -y --no-install-recommends \ + python python-setuptools "$virtualenv" python-dev gcc swig \ + dialog libaugeas0 libssl-dev libffi-dev ca-certificates dpkg-dev diff --git a/bootstrap/mac.sh b/bootstrap/mac.sh index a24590131..9f0f22a17 100755 --- a/bootstrap/mac.sh +++ b/bootstrap/mac.sh @@ -1,2 +1,2 @@ #!/bin/sh -sudo brew install augeas swig +brew install augeas swig diff --git a/docs/using.rst b/docs/using.rst index eb53fc54a..6fed67467 100644 --- a/docs/using.rst +++ b/docs/using.rst @@ -11,6 +11,7 @@ are provided mainly for the :ref:`developers ` reference. In general: +* ``sudo`` is required as a suggested way of running privileged process * `swig`_ is required for compiling `m2crypto`_ * `augeas`_ is required for the ``python-augeas`` bindings @@ -20,7 +21,7 @@ Ubuntu .. code-block:: shell - ./bootstrap/ubuntu.sh + sudo ./bootstrap/ubuntu.sh Debian @@ -28,13 +29,10 @@ Debian .. code-block:: shell - ./bootstrap/debian.sh + sudo ./bootstrap/debian.sh For squezze you will need to: -- Run ``apt-get install -y --no-install-recommends sudo`` as root - (``sudo`` is not installed by default) before running the bootstrap - script. - Use ``virtualenv --no-site-packages -p python`` instead of ``-p python2``. - Use text mode ``sudo ./venv/bin/letsencrypt --text`` (`#280`_) @@ -47,7 +45,7 @@ Mac OSX .. code-block:: shell - ./bootstrap/mac.sh + sudo ./bootstrap/mac.sh Installation From cd90df89208a7c30d8e9a6bde2bdbc5062d8566a Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Tue, 14 Apr 2015 14:57:53 +0000 Subject: [PATCH 4/4] Update Travis and Vagrantfile to use sudo --- .travis.yml | 2 +- Vagrantfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 803d76cbf..167d6ad74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: python # http://docs.travis-ci.com/user/ci-environment/#CI-environment-OS -before_install: travis_retry ./bootstrap/ubuntu.sh +before_install: travis_retry sudo ./bootstrap/ubuntu.sh install: "travis_retry pip install tox coveralls" script: "travis_retry tox" diff --git a/Vagrantfile b/Vagrantfile index 7fb5113f8..b4a06ea05 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -7,7 +7,7 @@ VAGRANTFILE_API_VERSION = "2" # Setup instructions from docs/using.rst $ubuntu_setup_script = <