Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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