Skip to content

Instantly share code, notes, and snippets.

@rcrowley
Created March 28, 2011 22:34
Show Gist options
  • Select an option

  • Save rcrowley/891447 to your computer and use it in GitHub Desktop.

Select an option

Save rcrowley/891447 to your computer and use it in GitHub Desktop.

Revisions

  1. rcrowley created this gist Mar 28, 2011.
    30 changes: 30 additions & 0 deletions gistfile1.eclass
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    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 <[email protected]>
    Description: Ruby $VERSION.
    EOF

    debra build "$DESTDIR" "ruby-${VERSION}_${VERSION}-p${PATCH}_${DPKG_BUILD_ARCH}.deb"