This commit is contained in:
Bob Strecansky 2016-04-16 01:49:17 +00:00
commit c7375c44fd
3 changed files with 30 additions and 9 deletions

View File

@ -83,6 +83,10 @@ Usage
Let's pretend you want to create a Django project called "redditclone". Rather than using `startproject` 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. 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:: First, get cookiecutter. Trust me, it's awesome::
$ pip install cookiecutter $ pip install cookiecutter

View File

@ -1,6 +1,14 @@
#!/bin/bash #!/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 # Handle call with wrong command
function wrong_command() function wrong_command()
@ -29,12 +37,18 @@ function list_packages(){
function install() 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() 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 exit 1
else else
case "$OS" in
apt-get update CentOS) yum update;;
Ubuntu) apt-get clean;;
esac
# Install the basic compilation dependencies and other required libraries of this project # Install the basic compilation dependencies and other required libraries of this project
if [ "$PARAN" == "install" ]; then if [ "$PARAN" == "install" ]; then
@ -62,15 +78,16 @@ function install_or_upgrade()
fi fi
# cleaning downloaded packages from apt-get cache # cleaning downloaded packages from apt-get cache
apt-get clean case "$OS" in
CentOS) yum clean all;;
Ubuntu) apt-get clean;;
esac
exit 0 exit 0
fi fi
} }
# Handle command argument # Handle command argument
case "$1" in case "$1" in
install) install_or_upgrade;; install) install_or_upgrade;;
@ -79,4 +96,3 @@ case "$1" in
help) usage_message;; help) usage_message;;
*) wrong_command $1;; *) wrong_command $1;;
esac esac

View File

@ -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