From 06e4bbe22ab53f3060694907cfc8d693f128d1fc Mon Sep 17 00:00:00 2001 From: Bob Strecansky Date: Tue, 8 Dec 2015 12:59:06 -0500 Subject: [PATCH 1/2] Adding prereqs for Ubuntu --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index d6bfbfdea..8d7519b27 100644 --- a/README.rst +++ b/README.rst @@ -80,6 +80,10 @@ Usage Let's pretend you want to create a Django project called "redditclone". Rather than using `startproject` and then editing the results to include your name, email, and various configuration issues that always get forgotten until the worst possible moment, get cookiecutter_ to do all the work. +Install necessary dependencies (tested on ubuntu 14.04):: + $ apt-get update && apt-get upgrade && apt-get dist-upgrade && apt-get install build-essential git + $ pip install pyyaml markupsafe + First, get cookiecutter. Trust me, it's awesome:: $ pip install cookiecutter From 2417cc245a8b94bb73b2617a0d4aea4db0d1548d Mon Sep 17 00:00:00 2001 From: Bob Strecansky Date: Fri, 11 Dec 2015 10:53:13 -0500 Subject: [PATCH 2/2] Adding CentOS installation directives and warning of only CentOS / Ubuntu Compatibility --- .../install_os_dependencies.sh | 34 ++++++++++++++----- {{cookiecutter.repo_name}}/requirements.yum | 1 + 2 files changed, 26 insertions(+), 9 deletions(-) create mode 100755 {{cookiecutter.repo_name}}/requirements.yum diff --git a/{{cookiecutter.repo_name}}/install_os_dependencies.sh b/{{cookiecutter.repo_name}}/install_os_dependencies.sh index aea9dec45..1c55737e0 100755 --- a/{{cookiecutter.repo_name}}/install_os_dependencies.sh +++ b/{{cookiecutter.repo_name}}/install_os_dependencies.sh @@ -1,6 +1,14 @@ #!/bin/bash -OS_REQUIREMENTS_FILENAME="requirements.apt" +## Verify that we are running this script on Centos or Ubuntu +command -v lsb_release >/dev/null 2>&1 || { echo >&2 "This setup script only currently works on Centos and Ubuntu. Aborting."; exit 1; } + +## Get the Distribution type from lsb_release +OS=$(lsb_release -si) +case "$OS" in + CentOS) OS_REQUIREMENTS_FILENAME="requirements.yum";; + Ubuntu) OS_REQUIREMENTS_FILENAME="requirements.apt";; +esac # Handle call with wrong command function wrong_command() @@ -29,12 +37,18 @@ function list_packages(){ function install() { - list_packages | xargs apt-get --no-upgrade install -y; + case "$OS" in + CentOS) list_packages | xargs yum install -y;; + Ubuntu) list_packages | xargs apt-get --no-upgrade install -y;; + esac } function upgrade() { - list_packages | xargs apt-get install -y; + case "$OS" in + CentOS) list_packages | xargs yum install -y;; + Ubuntu) list_packages | xargs apt-get install -y;; + esac } @@ -51,8 +65,10 @@ function install_or_upgrade() exit 1 else - - apt-get update + case "$OS" in + CentOS) yum update;; + Ubuntu) apt-get clean;; + esac # Install the basic compilation dependencies and other required libraries of this project if [ "$PARAN" == "install" ]; then @@ -62,15 +78,16 @@ function install_or_upgrade() fi # cleaning downloaded packages from apt-get cache - apt-get clean - + case "$OS" in + CentOS) yum clean all;; + Ubuntu) apt-get clean;; + esac exit 0 fi } - # Handle command argument case "$1" in install) install_or_upgrade;; @@ -79,4 +96,3 @@ case "$1" in help) usage_message;; *) wrong_command $1;; esac - diff --git a/{{cookiecutter.repo_name}}/requirements.yum b/{{cookiecutter.repo_name}}/requirements.yum new file mode 100755 index 000000000..30da5abe1 --- /dev/null +++ b/{{cookiecutter.repo_name}}/requirements.yum @@ -0,0 +1 @@ +autoconf automake binutils bison flex gcc gcc-c++ gettext libtool make patch pkgconfig redhat-rpm-config rpm-build gettext python-devel zlib-devel nodejs-pg libtiff-devel libtiff libtiff-static libjpeg-turbo libjpeg-turbo-static libjpeg-turbo-devel graphviz-devel python-setuptools python-devel python-virtualenv python-pip firefox libreadline-java sqlite-devel libxml2-python libxml2-static libxml2 libxml2-devel openssl-devel bzip2 wget curl llvm postgresql-server