Skip to content

Instantly share code, notes, and snippets.

@weavenet
Created January 12, 2012 16:09
Show Gist options
  • Save weavenet/1601349 to your computer and use it in GitHub Desktop.
Save weavenet/1601349 to your computer and use it in GitHub Desktop.
Build Image Magick RPM on RHEL5 using FPM
#!/bin/bash
# Fucking umask!!!
umask 022
# Get image magic source
cd /var/tmp
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
# Extract source
tar -xzvf ImageMagick.tar.gz
# Build image magic in temp dir
cd ImageMagick-*
./configure --prefix=/ ; make ; make install DESTDIR=/tmp/imagemagick_install
# 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 compilation
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
# 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
ruby setup.rb && ruby setup.rb
# Install fpm
gem install fpm
# Exeucte rpm build. Update the below as appropriate
fpm --prefix=/ -s dir -t rpm -n intu-imagemagick -v 6.7.4-6 -C /tmp/imagemagick_install -p /tmp/intu-rhel5-imagemagick-6.7.4-6.rpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment