Skip to content

Instantly share code, notes, and snippets.

@rcrowley
Created March 28, 2011 22:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save rcrowley/891447 to your computer and use it in GitHub Desktop.
Save rcrowley/891447 to your computer and use it in GitHub Desktop.
VERSION="1.9.2"
PATCH="180"
DPKG_BUILD_ARCH="$(dpkg --print-architecture)"
set -e
DESTDIR="$(mktemp -d)"
debra create "$DESTDIR"
trap "debra destroy \"$DESTDIR\"" EXIT
apt-get -y install libssl-dev libreadline5-dev zlib1g-dev
debra sourceinstall "$DESTDIR" \
"ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-$VERSION-p$PATCH.tar.gz" \
-b"sh -c 'echo fcntl\\\nopenssl\\\nreadline\\\nzlib >ext/Setup'" \
-p/usr -f"--program-suffix=-$VERSION"
cat >$DESTDIR/DEBIAN/control <<EOF
Package: ruby-$VERSION
Version: $VERSION-p$PATCH
Section: devel
Priority: optional
Essential: no
Architecture: $DPKG_BUILD_ARCH
Depends: libc6, libssl0.9.8, libreadline5, zlib1g
Maintainer: Richard Crowley <r@rcrowley.org>
Description: Ruby $VERSION.
EOF
debra build "$DESTDIR" "ruby-${VERSION}_${VERSION}-p${PATCH}_${DPKG_BUILD_ARCH}.deb"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment