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 = < 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 + +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/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/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/bootstrap/ubuntu.sh b/bootstrap/ubuntu.sh deleted file mode 100755 index 1acde595a..000000000 --- a/bootstrap/ubuntu.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -# Tested with: -# - 12.04 (x64, Travis) -# - 14.04 (x64, Vagrant) -# - 14.10 (x64) - -# 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 \ - 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 diff --git a/docs/using.rst b/docs/using.rst index 463b6524b..3a7940993 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``. @@ -46,7 +44,7 @@ Mac OSX .. code-block:: shell - ./bootstrap/mac.sh + sudo ./bootstrap/mac.sh Installation