Skip to content

Instantly share code, notes, and snippets.

@weavenet
Created January 11, 2012 22:20
Show Gist options
  • Save weavenet/1597127 to your computer and use it in GitHub Desktop.
Save weavenet/1597127 to your computer and use it in GitHub Desktop.
Build Ruby 1.8.7p174 RPM on RHEL5u6 using FPM
#!/bin/bash
# Fucking umask!!!
umask 022
# Install epel yum repo
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
# Install deps for ruby build
yum install -y gcc rpm-build readline-devel.x86_64 libffi-devel.x86_64 libyaml-devel.x86_64 zlib-devel.x86_64 openssl-devel.x86_64 wget
# Get ruby source
wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p174.tar.gz
tar -zxvf ruby-1.8.7-p174.tar.gz
cd ruby-1.8.7-p174
# Build ruby and install in system & temporary build dir
./configure --prefix=/usr --disable-install-doc && make && make install && make install DESTDIR=/tmp/ruby_install
# Build ruby gems rpm
cd /var/tmp
wget http://production.cf.rubygems.org/rubygems/rubygems-1.7.2.tgz
tar zxvf rubygems-1.7.2.tgz
cd rubygems-1.7.2
# Build gem for installing fpm and rpm
ruby setup.rb && ruby setup.rb --destdir /tmp/rubygems_install
# Install fpm
gem install fpm
# Exeucte rpm build. Updat ethe below as appropriate
fpm --prefix=/ -s dir -t rpm -n intu-ruby -v 1.8.7-p174 -C /tmp/ruby_install -p /tmp/intu-ruby-1.8.7-p174.rpm \
-d "libstdc++ >= 4.1.2" \
-d "glibc >= 2.5" \
-d "libffi >= 3.0.5" \
-d "zlib >= 1.2.3" \
-d "readline >= 5.1" \
-d "libyaml >= 0.1.2" \
-d "openssl >= 0.9.8"
# Execute rpm build for gem.
fpm --prefix=/ -s dir -t rpm -n intu-rubygems -v 1.7.2 -C /tmp/rubygems_install -p /tmp/intu-rubygems-VERSION_ARCH.rpm \
-d "intu-ruby = 1.8.7_p174"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment