1

I have already installed ImageMagick on my server which is running centos 6.4

yum install ImageMagick

Version is very old : 6.5.4-7 2012-05-07 Q16

I discussed about this with ImageMagick's official forum. They told i am running older version of ImageMagick.

With yum, we generally don't need to worry about dependencies. I created few scripts which are using the ImageMagick's latest version. But my server is running the older version to support those scripts.

1) So, If i remove the yum version of ImageMagick, which dependencies should be installed before compiling ImageMagick? The scripts which are running properly shouldn't get affected by this update.

2) Right now, /usr/bin/convert is the path. How do i compile keeping the same path?

--prefix="/usr" (is it right?)

I don't have any test server. So, I need your help. I am windows(7) user!

Kamini
  • 21
  • 4

2 Answers2

3
  1. Install rpmbuild: yum install rpmbuild -y

  2. Install src.rpm from Fedora repo:

    rpm -Uvh "http://mirror.switch.ch/ftp/mirror/fedora/linux/releases/19/Fedora/source/SRPMS/i/ImageMagick-6.7.8.9-5.fc19.src.rpm"

  3. cd ~/rpmbuild/SPECS

  4. Build package for your platform (replace x86_64 with i686 if you are running i686):

    rpmbuild --target x86_64 -ba ImageMagick.spec

  5. If there are any dependencies - rpmbuild will tell you about that, so install these packages with yum install

  6. Try to build it again:

    rpmbuild --target x86_64 -ba ImageMagick.spec

Result will be:

Wrote: /root/rpmbuild/SRPMS/ImageMagick-6.7.8.9-5.el6.src.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-6.7.8.9-5.el6.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-devel-6.7.8.9-5.el6.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-djvu-6.7.8.9-5.el6.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-doc-6.7.8.9-5.el6.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-perl-6.7.8.9-5.el6.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-c++-6.7.8.9-5.el6.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-c++-devel-6.7.8.9-5.el6.x86_64.rpm

Install built packages with rpm -Uvh

I do this way and I don't have any problems so far. If you will encounter any problems - there will be deprecated functions or you need to rebuild packages which contain components built with ImageMagick-devel, not the ImageMagick.

Expected configuration will look like this:

                  Option                        Value
-------------------------------------------------------------------------------
Shared libraries  --enable-shared=yes           yes
Static libraries  --enable-static=no            no
Module support    --with-modules=yes            yes
GNU ld            --with-gnu-ld=yes             yes
Quantum depth     --with-quantum-depth=16       16
High Dynamic Range Imagery
                  --enable-hdri=no              no

Delegate Configuration:
BZLIB             --with-bzlib=yes              yes
Autotrace         --with-autotrace=no           no
Dejavu fonts      --with-dejavu-font-dir=default        /usr/share/fonts/dejavu/
DJVU              --with-djvu=yes               yes
DPS               --with-dps=no         no
FFTW              --with-fftw=yes               no
FlashPIX          --with-fpx=yes                no
FontConfig        --with-fontconfig=yes         yes
FreeType          --with-freetype=yes           yes
GhostPCL          None                          pcl6 (unknown)
GhostXPS          None                          gxps (unknown)
Ghostscript       None                          gs (8.70)
Ghostscript fonts --with-gs-font-dir=default    /usr/share/fonts/default/Type1/
Ghostscript lib   --with-gslib=yes              yes
Graphviz          --with-gvc=no
JBIG              --with-jbig=yes               no
JPEG v1           --with-jpeg=yes               yes
JPEG-2000         --with-jp2=yes                yes
LCMS v1           --with-lcms=yes               yes
LCMS v2           --with-lcms2=yes              no
LQR               --with-lqr=yes                no
LZMA              --with-lzma=yes               no
Magick++          --with-magick-plus-plus=yes   yes
OpenEXR           --with-openexr=yes            yes
PERL              --with-perl=yes               /usr/bin/perl
PANGO             --with-pango=yes              yes
PNG               --with-png=yes                yes
RSVG              --with-rsvg=yes               yes
TIFF              --with-tiff=yes               yes
WEBP              --with-webp=yes               no
Windows fonts     --with-windows-font-dir=      none
WMF               --with-wmf=yes                yes
X11               --with-x=yes                  yes
XML               --with-xml=yes                yes
ZLIB              --with-zlib=yes               yes

So, everything is built according to current system.

For the same (just rebuild), it's possible to run rpmbuild --rebuild --target x86_64 ImageMagick-6.7.8.9-5.fc19.src.rpm - result will be same if you don't want to make any changes in the future.

ALex_hha
  • 7,025
  • 1
  • 23
  • 39
GioMac
  • 4,444
  • 3
  • 24
  • 41
  • `yum remove ImageMagick` `yum remove ImageMagick-devel` - are those important before i do the build? `whereis convert` -> will it be /usr/share/convert? --> I need it to be in `/usr/bin/convert` – Kamini Aug 30 '13 at 12:27
  • No, it's not required - both will be upgraded anyway. `convert` will be in the `PATH` (`/usr/bin/convert`) :) – GioMac Aug 30 '13 at 12:29
  • how do i update the version in future? | Can i use http://www.imagemagick.org/download/linux/CentOS/x86_64/ImageMagick-6.8.6-9.x86_64.rpm (Redhat / CentOS 5.8 x86_64 RPM) – Kamini Aug 30 '13 at 13:14
  • yes, but I'm not sure yet about changes – GioMac Aug 30 '13 at 13:21
  • Better to use `mock` because it will handle all of the dependencies automatically (provided CentOS actually has them) and keep the build free of contamination from the host system. – Michael Hampton Aug 30 '13 at 15:09
  • rpmbuild in 6.x does it anyway, automatically. – GioMac Aug 30 '13 at 15:13
0

I think this thread explains your requirements. Although the procedure is for CentOS 6.3 I wouldn't expect any serious problems to rebuild it on 6.4.

dsmsk80
  • 5,757
  • 17
  • 22
  • I saw this thread already. It is RPM. I don't know how has it been compiled. – Kamini Aug 30 '13 at 11:59
  • Yep, download the SRPM package from http://imagemagick.mirrorcatalogs.com/linux/SRPMS/ and continue with yum install and rpmbuid commands as written in that thread. – dsmsk80 Aug 30 '13 at 12:03