Created
June 4, 2013 12:20
-
-
Save yawn/5705502 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VARNISH_VERSION=3.0.3 | |
VMOD_REPOSITORY=https://github.com/nand2/libvmod-throttle.git | |
VMOD_NAME=libvmod-throttle | |
VMOD_VERSION='0.1' | |
VMOD_LICENSE='Simplified BSD License' | |
VMOD_VENDOR='Nicolas Deschildre' | |
VMOD_DESCRIPTION='Rate limiting in Varnish, on different time windows and keys' | |
sudo yum install -y pcre-devel python-docutils | |
sudo gem install fpm | |
pushd /tmp | |
if [ ! -d varnish ]; then | |
git clone --progress --recursive git://github.com/varnish/Varnish-Cache.git varnish | |
fi | |
cd varnish | |
git fetch | |
git checkout varnish-$VARNISH_VERSION | |
sed -i '' 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g' configure.ac | |
make clean | |
nice ./autogen.sh | |
nice ./configure | |
nice make | |
cd /tmp | |
if [ ! -d $VMOD_NAME ]; then | |
git clone --progress --recursive $VMOD_REPOSITORY $VMOD_NAME | |
fi | |
cd $VMOD_NAME | |
git fetch | |
git checkout master | |
mkdir -p build | |
export VARNISHSRC=/tmp/varnish | |
export VMODDIR=/tmp/$VMOD_NAME/build | |
sed -i '' 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g' configure.ac | |
make clean | |
nice ./autogen.sh | |
nice ./configure | |
nice make | |
make install | |
cd build | |
fpm -f \ | |
-t rpm \ | |
-s dir \ | |
--prefix=/usr/lib64/varnish/vmods \ | |
-n $VMOD_NAME \ | |
-v $VMOD_VERSION \ | |
--iteration `git rev-parse --short HEAD` \ | |
--epoch `date +"%s"` \ | |
-a noarch \ | |
-d 'varnish' \ | |
--license "$VMOD_LICENSE" \ | |
--vendor "$VMOD_VENDOR" \ | |
--description "$VMOD_DESCRIPTION" \ | |
--url "`echo $VMOD_REPOSITORY | sed 's/\.git$//'`" \ | |
* | |
popd | |
mv -f $VMODDIR/*.rpm . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment