Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nathenharvey/2634212 to your computer and use it in GitHub Desktop.
Save nathenharvey/2634212 to your computer and use it in GitHub Desktop.
i can has ruby-1.9.2 package with fpm
#!/bin/sh
rubyversion=1.9.2-p320
rubysrc=ruby-$rubyversion.tar.bz2
checksum=b226dfe95d92750ee7163e899b33af00
destdir=/tmp/install-$rubyversion
sudo apt-get -y install libssl-dev
gem list -i fpm || sudo gem install fpm --no-ri --no-rdoc
if [ ! -f $rubysrc ]; then
wget -q ftp://ftp.ruby-lang.org/pub/ruby/1.9/$rubysrc
fi
if [ "$(md5sum $rubysrc | cut -b1-32)" != "$checksum" ]; then
echo "Checksum mismatch!"
exit 1
fi
echo "Unpacking $rubysrc"
tar -jxf $rubysrc
cd ruby-$rubyversion
./configure --prefix=/usr && make && make install DESTDIR=$destdir
cd ..
fpm -s dir -t deb -n ruby-$rubyversion -v $rubyversion -C $destdir \
-p ruby-VERSION_ARCH.deb -d "libstdc++6 (>= 4.4.3)" \
-d "libc6 (>= 2.6)" -d "libffi5 (>= 3.0.4)" -d "libgdbm3 (>= 1.8.3)" \
-d "libncurses5 (>= 5.7)" -d "libreadline6 (>= 6.1)" \
-d "libssl0.9.8 (>= 0.9.8)" -d "zlib1g (>= 1:1.2.2)" \
usr/bin usr/lib usr/share/man usr/include
rm -r $destdir
#!/bin/sh
rubyversion=1.9.3-p194
rubysrc=ruby-$rubyversion.tar.gz
checksum=bc0c715c69da4d1d8bd57069c19f6c0e
destdir=/tmp/install-$rubyversion
sudo apt-get -y install libssl-dev
if [ ! -f yaml-0.1.4.tar.gz ]; then
wget -q http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
fi
tar xzvf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure --prefix=/usr && make && make install DESTDIR=/tmp/libyaml
cd ..
if [ ! -f $rubysrc ]; then
wget -q ftp://ftp.ruby-lang.org/pub/ruby/1.9/$rubysrc
fi
if [ "$(md5sum $rubysrc | cut -b1-32)" != "$checksum" ]; then
echo "Checksum mismatch!"
exit 1
fi
echo "Unpacking $rubysrc"
tar --xzvf $rubysrc
cd ruby-$rubyversion
./configure --prefix=/usr --disable-install-doc --with-opt-dir=/tmp/libyaml/usr && make && make install DESTDIR=$destdir
cd ..
gem list -i fpm || sudo gem install fpm --no-ri --no-rdoc
fpm -s dir -t deb -n ruby-$rubyversion -v $rubyversion -C $destdir \
-p ruby-VERSION_ARCH.deb -d "libstdc++6 (>= 4.4.3)" \
-d "libc6 (>= 2.6)" -d "libffi5 (>= 3.0.4)" -d "libgdbm3 (>= 1.8.3)" \
-d "libncurses5 (>= 5.7)" -d "libreadline6 (>= 6.1)" \
-d "libssl0.9.8 (>= 0.9.8)" -d "zlib1g (>= 1:1.2.2)" \
usr/bin usr/lib usr/share/man usr/include
rm -r $destdir
rm -r /tmp/libyaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment