Skip to content

Instantly share code, notes, and snippets.

@dynamicguy
Created September 17, 2014 18:08
Show Gist options
  • Save dynamicguy/4bd1da1c06a9e2fc9688 to your computer and use it in GitHub Desktop.
Save dynamicguy/4bd1da1c06a9e2fc9688 to your computer and use it in GitHub Desktop.
setup.sh
#!/usr/bin/env sh
#Build Dependences by Source Code
#openssl
wget http://www.openssl.org/source/openssl-1.0.1i.tar.gz
tar zxvf openssl-1.0.1i.tar.gz
cd openssl-1.0.1i
./Configure darwin64-x86_64-cc
make && make install
#cmake
wget http://www.cmake.org/files/v3.0/cmake-3.0.1.tar.gz
tar xzvf cmake-3.0.1.tar.gz
cd cmake-3.0.1
./bootstrap --prefix=/usr/local
make && sudo make install
#libevent
wget http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar zxvf libevent-2.0.17-stable.tar.gz
cd libevent-2.0.17-stable
./configure --prefix=/usr/local
make && sudo make install
#libjpeg-turbo ( recommended )
#To build libjpeg-turbo you must install nasm first.
wget https://downloads.sourceforge.net/project/libjpeg-turbo/1.3.1/libjpeg-turbo-1.3.1.tar.gz
tar zxvf libjpeg-turbo-1.3.1.tar.gz
cd libjpeg-turbo-1.3.1
./configure --prefix=/usr/local --with-jpeg8
make && sudo make install
#libjpeg, giflib and libpng
#Just using your system package. Source build is unnecessary.
#webp
wget http://downloads.webmproject.org/releases/webp/libwebp-0.4.1.tar.gz
tar zxvf libwebp-0.4.1.tar.gz
cd libwebp-0.4.1
./configure
make
sudo make install
#imagemagick
wget http://www.imagemagick.org/download/ImageMagick-6.8.9-7.tar.gz
tar xzvf ImageMagick-6.8.9-7.tar.gz
cd ImageMagick-6.8.9-7
./configure --prefix=/usr/local
make && sudo make install
#libmemcached
wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
tar zxvf libmemcached-1.0.18.tar.gz
cd libmemcached-1.0.18
./configure -prefix=/usr/local
make && sudo make install
#Build zimg
#zimg
#Now you can build zimg itself. If you want to gdb zimg, you can use make debug option.
git clone https://github.com/buaazp/zimg -b master --depth=1
cd zimg
make
#If you want to enable cache to improve performance, or you want to store the images to a distributed storage backend, the softwares below is optional.
#Build Optional Storage Backends
#memcached ( optional )
wget http://www.memcached.org/files/memcached-1.4.19.tar.gz
tar zxvf memcached-1.4.19.tar.gz
cd memcached-1.4.19
./configure --prefix=/usr/local
make
sudo make install
#beansdb ( optional )
git clone https://github.com/douban/beansdb
cd beansdb
./configure --prefix=/usr/local
make
#benseye ( optional )
git clone [email protected]:douban/beanseye.git
cd beanseye
make
#SSDB ( optional )
wget --no-check-certificate https://github.com/ideawu/ssdb/archive/master.zip
unzip master
cd ssdb-master
make
#twemproxy ( optional )
git clone [email protected]:twitter/twemproxy.git
cd twemproxy
autoreconf -fvi
./configure --enable-debug=log
make
src/nutcracker -h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment