Skip to content

Commit

Permalink
hammer scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dzuelke committed Mar 12, 2014
1 parent aeb510f commit f87588b
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
support/build/*/builds
40 changes: 40 additions & 0 deletions support/build/libmemcached/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

# fail hard
set -o pipefail
# fail harder
set -eux

#
#./configure --prefix=/tmp/foo1
#https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz
#

PREFIX=/app/.heroku/php
mkdir -p $PREFIX

curl -LO ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-2.1.26.tar.gz
tar xzf cyrus-sasl-2.1.26.tar.gz
pushd cyrus-sasl-2.1.26
./configure --prefix=$PREFIX
make
make install
popd

# Take care of vendoring
dep_version=${VERSION:-1.0.16}
dep_dirname=libmemcached-${dep_version}
dep_archive_name=${dep_dirname}.tar.gz

curl -LO https://launchpad.net/libmemcached/1.0/${dep_version}/+download/${dep_archive_name}

tar xzf $dep_archive_name
pushd $dep_dirname
CPPFLAGS=-I$PREFIX/include LDFLAGS=-L$PREFIX/lib ./configure --prefix=$PREFIX --without-memcached
make
make install
popd

mv $PREFIX/* $2/

echo "Done packaging $dep_dirname"
87 changes: 87 additions & 0 deletions support/build/php/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#!/bin/bash

# fail hard
set -o pipefail
# fail harder
set -eux

PREFIX=/app/.heroku/php
mkdir -p $PREFIX/bin
export PATH=$PREFIX/bin:$PATH

curl -L https://dl.dropboxusercontent.com/u/26887866/heroku/zlib-1.2.8.tgz | tar xz -C $PREFIX

# Take care of vendoring
dep_version=${VERSION:-5.5.10}
dep_dirname=php-$dep_version
dep_archive_name=$dep_dirname.tar.bz2

# Download PHP if necessary.
if [ ! -f $dep_archive_name ]
then
curl -Lo $dep_archive_name http://us1.php.net/get/$dep_archive_name/from/www.php.net/mirror
fi



# fetch mcrypt
if [ -z MCRYPT_URL ]
then
MCRYPT_URL="https://heroku-buildpack-php.s3.amazonaws.com/mcrypt-2.5.8-2.tar.gz"
fi
#curl --silent --max-time 60 --location "$MCRYPT_URL" | tar xz

# Clean and extract PHP.
rm -rf $dep_dirname
tar jxf $dep_archive_name

# Compile PHP
pushd $dep_dirname
./configure \
--prefix=$PREFIX \
--with-config-file-path=/app/.heroku/php/etc \
--with-config-file-scan-dir=/app/.heroku/php/etc/php/conf.d \
--with-openssl \
--enable-fpm \
--enable-soap=shared \
--enable-sockets \
--enable-zip \
--with-zlib=$PREFIX \
--with-pgsql \
--with-pdo-pgsql
make -s
make install -s
popd

curl -L https://dl.dropboxusercontent.com/u/26887866/heroku/libmemcached-1.0.16.tgz | tar xz -C $PREFIX
curl -L https://github.com/php-memcached-dev/php-memcached/archive/2.2.0b1.tar.gz | tar xz
pushd php-memcached-2.2.0b1
phpize
./configure \
--enable-memcached \
--with-libmemcached-dir=$PREFIX
make -s
make install -s
popd

# Copy in MySQL client library.
# mkdir -p $PREFIX/lib/phpls
# cp /usr/lib/libmysqlclient.so.16 $PREFIX/lib/php

# $PATH manipulation Necessary for 'pecl install', which relies on
# PHP binaries relative to $PATH.

$PREFIX/bin/pecl channel-update pecl.php.net

# bundle composer
curl -sS https://getcomposer.org/installer | php -- --install-dir=$PREFIX/bin
mv $PREFIX/bin/composer.phar $PREFIX/bin/composer

# Use defaults for apc build prompts.
# yes '' | $PREFIX/bin/pecl install apc

# echo $dep_version > $PREFIX/.heroku/dep_version

mv $PREFIX/* $2/

echo "Done building $dep_dirname"
27 changes: 27 additions & 0 deletions support/build/zlib/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# fail hard
set -o pipefail
# fail harder
set -eux

PREFIX=/app/.heroku/php
mkdir -p $PREFIX

# Take care of vendoring
dep_version=${VERSION:-1.2.8}
dep_dirname=zlib-${dep_version}
dep_archive_name=${dep_dirname}.tar.gz

curl -Lo $dep_archive_name http://zlib.net/${dep_archive_name}

tar xzf $dep_archive_name
pushd $dep_dirname
./configure --prefix=$PREFIX
make
make install
popd

mv $PREFIX/* $2/

echo "Done packaging $dep_dirname"

0 comments on commit f87588b

Please sign in to comment.