1
0
mirror of https://github.com/certbot/certbot.git synced 2026-01-23 07:20:55 +03:00

Merge pull request #1070 from letsencrypt/debian-venv

Make debian bootstrap script more agnostic about package names
This commit is contained in:
Peter Eckersley
2015-10-21 17:21:59 -07:00

View File

@@ -1,57 +1,50 @@
#!/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)
# - Raspbian:
# - 7.8 (armhf)
# Current version tested with:
#
# - Ubuntu
# - 14.04 (x64)
# - 15.04 (x64)
# - Debian
# - 7.9 "wheezy" (x64)
# - sid (2015-10-21) (x64)
# Past versions tested with:
#
# - Debian 8.0 "jessie" (x64)
# - Raspbian 7.8 (armhf)
# virtualenv binary can be found in different packages depending on
# distro version (#346)
newer () {
apt-get install -y lsb-release --no-install-recommends
distro=$(lsb_release -si)
# 6.0.10 => 60, 14.04 => 1404
# TODO: in sid version==unstable
version=$(lsb_release -sr | awk -F '.' '{print $1 $2}')
if [ "$distro" = "Ubuntu" -a "$version" -ge 1410 ]
then
return 0;
elif [ "$distro" = "Debian" -a "$version" -ge 80 ]
then
return 0;
else
return 1;
fi
}
# Believed not to work:
#
# - Debian 6.0.10 "squeeze" (x64)
apt-get update
# you can force newer if lsb_release is not available (e.g. Docker
# debian:jessie base image)
if [ "$1" = "newer" ] || newer
then
# virtualenv binary can be found in different packages depending on
# distro version (#346)
virtualenv=
if apt-cache show virtualenv > /dev/null ; then
virtualenv="virtualenv"
else
virtualenv="python-virtualenv"
fi
if apt-cache show python-virtualenv > /dev/null ; then
virtualenv="$virtualenv python-virtualenv"
fi
apt-get install -y --no-install-recommends \
git-core \
python \
python-dev \
"$virtualenv" \
$virtualenv \
gcc \
dialog \
libaugeas0 \
libssl-dev \
libffi-dev \
ca-certificates \
if ! which virtualenv > /dev/null ; then
echo Failed to install a working \"virtualenv\" command, exiting
exit 1
fi