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
+29 -36
View File
@@ -1,57 +1,50 @@
#!/bin/sh #!/bin/sh
# Tested with: # Current version tested with:
# - Ubuntu: #
# - 12.04 (x64, Travis) # - Ubuntu
# - 14.04 (x64, Vagrant) # - 14.04 (x64)
# - 14.10 (x64) # - 15.04 (x64)
# - Debian: # - Debian
# - 6.0.10 "squeeze" (x64) # - 7.9 "wheezy" (x64)
# - 7.8 "wheezy" (x64) # - sid (2015-10-21) (x64)
# - 8.0 "jessie" (x64)
# - Raspbian:
# - 7.8 (armhf)
# Past versions tested with:
#
# - Debian 8.0 "jessie" (x64)
# - Raspbian 7.8 (armhf)
# virtualenv binary can be found in different packages depending on # Believed not to work:
# distro version (#346) #
newer () { # - Debian 6.0.10 "squeeze" (x64)
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
}
apt-get update apt-get update
# you can force newer if lsb_release is not available (e.g. Docker # virtualenv binary can be found in different packages depending on
# debian:jessie base image) # distro version (#346)
if [ "$1" = "newer" ] || newer
then virtualenv=
if apt-cache show virtualenv > /dev/null ; then
virtualenv="virtualenv" virtualenv="virtualenv"
else
virtualenv="python-virtualenv"
fi fi
if apt-cache show python-virtualenv > /dev/null ; then
virtualenv="$virtualenv python-virtualenv"
fi
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
git-core \ git-core \
python \ python \
python-dev \ python-dev \
"$virtualenv" \ $virtualenv \
gcc \ gcc \
dialog \ dialog \
libaugeas0 \ libaugeas0 \
libssl-dev \ libssl-dev \
libffi-dev \ libffi-dev \
ca-certificates \ ca-certificates \
if ! which virtualenv > /dev/null ; then
echo Failed to install a working \"virtualenv\" command, exiting
exit 1
fi