diff --git a/README.md b/README.md new file mode 100644 index 0000000..8217195 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +Heroku Buildpack: Optipng +======================= + +This is a [Heroku buildpack](http://devcenter.heroku.com/articles/buildpacks) for using [optipng](http://optipng.sourceforge.net/) in your application. + +It is designed to be used with [heroku-buildpack-multi](https://github.com/ddollar/heroku-buildpack-multi) to combine it with the appropriate real buildpack for your app. + +This is based on http://github.com/jayzes/heroku-buildpack-ffmpeg, which was in turn based on https://github.com/shunjikonishi/heroku-buildpack-ffmpeg + +Usage +----- +Add a `.buildpacks` file to the root of your repo that contains this buildpack URL and your real buildpack URL: + + https://github.com/jayzes/heroku-buildpack-optipng + https://github.com/heroku/heroku-buildpack-ruby + +Then create an application using the multi buildpack: + + $ heroku create --buildpack https://github.com/ddollar/heroku-buildpack-multi + +or configure an existing application: + + $ heroku config BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi + +You can verify that everything is properly installed by running the following command: + + $ heroku run "optipng -v" + diff --git a/bin/compile b/bin/compile new file mode 100755 index 0000000..2cfc7a3 --- /dev/null +++ b/bin/compile @@ -0,0 +1,23 @@ +#!/bin/sh + +indent() { + sed -u 's/^/ /' +} + +echo "-----> Installing optipng" +BUILD_DIR=$1 +VENDOR_DIR="vendor" +OPTIPNG_DOWNLOAD_URL="https://github.com/jayzes/heroku-buildpack-optipng/releases/download/v0.7.4/optipng" + +echo "OPTIPNG_DOWNLOAD_URL = " $PNGQUANT_DOWNLOAD_URL | indent + +cd $BUILD_DIR +mkdir -p $VENDOR_DIR/optipng/bin +cd $VENDOR_DIR +curl -L --silent -o optipng/bin/optipng $OPTIPNG_DOWNLOAD_URL +chmod +x optipng/bin/optipng + +echo "exporting PATH" | indent +PROFILE_PATH="$BUILD_DIR/.profile.d/optipng" +mkdir -p $(dirname $PROFILE_PATH) +echo 'export PATH="$PATH:vendor/optipng/bin"' >> $PROFILE_PATH diff --git a/bin/detect b/bin/detect new file mode 100755 index 0000000..4225d70 --- /dev/null +++ b/bin/detect @@ -0,0 +1,5 @@ +#!/bin/sh + +# this pack is valid for all apps +echo "optipng" +exit 0 diff --git a/bin/release b/bin/release new file mode 100755 index 0000000..df2858b --- /dev/null +++ b/bin/release @@ -0,0 +1,2 @@ +#!/bin/sh +echo "--- {}"