2012-10-12 14:53:55 +00:00
|
|
|
|
#!/bin/bash
|
2012-10-23 08:47:00 +00:00
|
|
|
|
|
2012-12-12 08:55:22 +00:00
|
|
|
|
# Installs Homebrew, Git, git-extras, git-friendly, hub, Node.js, configures Apache, PHP, MySQL, etc.
|
2012-10-23 08:47:00 +00:00
|
|
|
|
|
2012-11-09 08:33:54 +00:00
|
|
|
|
# Ask for the administrator password upfront
|
|
|
|
|
sudo -v
|
2012-10-12 14:53:55 +00:00
|
|
|
|
|
2012-10-26 13:55:57 +00:00
|
|
|
|
# Install Homebrew
|
2012-10-19 11:54:20 +00:00
|
|
|
|
command -v brew >/dev/null 2>&1 || ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
|
|
|
|
|
|
2012-10-12 14:53:55 +00:00
|
|
|
|
# Make sure we’re using the latest Homebrew
|
|
|
|
|
brew update
|
|
|
|
|
|
|
|
|
|
# Upgrade any already-installed formulae
|
|
|
|
|
brew upgrade
|
|
|
|
|
|
2012-10-25 14:31:00 +00:00
|
|
|
|
# GNU core utilities (those that come with OS X are outdated)
|
2012-10-12 14:53:55 +00:00
|
|
|
|
brew install coreutils
|
2012-10-25 14:31:00 +00:00
|
|
|
|
# GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
|
2012-10-12 14:53:55 +00:00
|
|
|
|
brew install findutils
|
2012-12-12 08:55:22 +00:00
|
|
|
|
brew install tree
|
2012-10-12 14:53:55 +00:00
|
|
|
|
|
2012-10-25 14:31:00 +00:00
|
|
|
|
# More recent versions of some OS X tools
|
2012-10-12 14:53:55 +00:00
|
|
|
|
brew tap homebrew/dupes
|
|
|
|
|
brew install homebrew/dupes/grep
|
|
|
|
|
|
2012-10-25 14:31:00 +00:00
|
|
|
|
# Git
|
2012-10-12 14:53:55 +00:00
|
|
|
|
brew install git
|
|
|
|
|
brew install git-extras
|
2012-12-12 08:55:22 +00:00
|
|
|
|
brew install hub
|
2012-10-23 08:56:16 +00:00
|
|
|
|
sudo bash < <( curl https://raw.github.com/jamiew/git-friendly/master/install.sh)
|
|
|
|
|
|
2012-10-25 14:31:00 +00:00
|
|
|
|
# MySQL
|
|
|
|
|
brew install mysql
|
|
|
|
|
unset TMPDIR
|
|
|
|
|
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
|
|
|
|
|
/usr/local/opt/mysql/bin/mysqladmin -u root password 'root'
|
|
|
|
|
|
2013-02-07 04:21:08 +00:00
|
|
|
|
# PHP
|
|
|
|
|
cd /etc
|
|
|
|
|
sudo cp php.ini.default php.ini
|
|
|
|
|
sudo sed -i '' "s^/var/mysql/mysql.sock^/tmp/mysql.sock^" php.ini
|
|
|
|
|
|
2012-10-26 13:55:57 +00:00
|
|
|
|
# Apache: enable PHP, .htaccess files, virtual hosts and set it to run as current user
|
|
|
|
|
cd /etc/apache2
|
|
|
|
|
sudo cp httpd.conf httpd.conf.bak
|
|
|
|
|
sudo cp extra/httpd-vhosts.conf extra/httpd-vhosts.conf.bak
|
|
|
|
|
sudo sed -i '' "s^#\(LoadModule php5_module\)^\1^" httpd.conf
|
|
|
|
|
sudo sed -i '' "s^#\(Include /private/etc/apache2/extra/httpd-vhosts.conf\)^\1^" httpd.conf
|
|
|
|
|
sudo sed -i '' "s^<IfDefine WEBSHARING_ON>^<IfDefine !0>^" httpd.conf
|
|
|
|
|
sudo sed -i '' "s^User _www^User `whoami`^" httpd.conf
|
|
|
|
|
sudo sed -i '' "s^Group _www^Group staff^" httpd.conf
|
|
|
|
|
echo -e "NameVirtualHost *:80\n\n<Directory />\n AllowOverride All\n Allow from all\n</Directory>\n" | sudo tee extra/httpd-vhosts.conf
|
|
|
|
|
cd -
|
|
|
|
|
|
2012-10-25 14:31:00 +00:00
|
|
|
|
# Everything else
|
2012-10-19 11:16:29 +00:00
|
|
|
|
brew install unrar
|
2013-02-11 20:21:51 +00:00
|
|
|
|
brew install ack
|
2012-10-26 13:55:57 +00:00
|
|
|
|
|
|
|
|
|
# Node.js
|
|
|
|
|
brew install node
|
2012-11-28 07:13:30 +00:00
|
|
|
|
brew install casperjs
|
2012-12-12 08:55:22 +00:00
|
|
|
|
npm install -g grunt-cli
|
2013-02-11 20:22:00 +00:00
|
|
|
|
npm install -g grunt-init
|
2012-10-26 13:55:57 +00:00
|
|
|
|
npm install -g jshint
|
|
|
|
|
npm install -g bower
|
2012-11-09 08:33:54 +00:00
|
|
|
|
|
|
|
|
|
# Python
|
2013-02-10 20:14:51 +00:00
|
|
|
|
brew install python
|
2012-11-28 07:13:30 +00:00
|
|
|
|
sudo pip install fabric
|
|
|
|
|
|
|
|
|
|
# Remove outdated versions from the cellar
|
|
|
|
|
brew cleanup
|