Skip to content

Instantly share code, notes, and snippets.

@dpwiz
Created March 23, 2011 14:42
Show Gist options
  • Save dpwiz/883203 to your computer and use it in GitHub Desktop.
Save dpwiz/883203 to your computer and use it in GitHub Desktop.
Prepare baseline FreeBSD to host some python stuff
PORTS="editors/nano devel/git ftp/curl ftp/wget textproc/libxml2 www/nginx-devel"
EGGS="pip virtualenv mercurial"
if [ `pkg_info|grep python27|awk '{ print $1 }'` ]; then
echo Python 2.7 found.
if [ `pkg_info | grep py27-sqlite3 | awk '{ print $1 }'` ]; then
echo "sqlite3 is here, you're so cool!"
else
echo "sqlite3 would be installed"
PORTS="databases/py-sqlite3 ${PORTS}"
fi
else
echo Python 2.7 not found
if [ `pkg_info | grep python2 | awk '{ print $1 }'` ]; then
echo "... but older one is here and this sucks ):"
pkg_info | grep python2
echo
echo "remove it first"
exit 1
else
echo "... and would be installed"
PORTS="lang/python27 databases/py-sqlite3 ${PORTS}"
fi
fi
echo "Ready to install some stuff: ${PORTS}"
read -p "Hit ^C to abort..."
for port in ${PORTS}; do
cd /usr/ports/${port}
make config install clean
done
echo "Installing distribute"
cd /tmp
curl -s http://python-distribute.org/distribute_setup.py | sudo python2.7 -
echo "Installing packages"
sudo easy_install ${EGGS}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment