http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=28937
diff --git a/ImageMagick.spec.in b/ImageMagick.spec.in
index 617efff..9117b45 100644
--- a/ImageMagick.spec.in
+++ b/ImageMagick.spec.in
@@ -21,6 +21,8 @@
 BuildRequires:  libX11-devel, libXext-devel, libXt-devel
 BuildRequires:  lcms2-devel, libxml2-devel, librsvg2-devel, OpenEXR-devel
 BuildRequires:  fftw-devel, OpenEXR-devel, libwebp-devel
+BuildRequires:  jbigkit-devel
+BuildRequires:  openjpeg2-devel >= 2.1.0
 
 %description
 ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, TIFF, DPX, EXR, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.
@@ -130,10 +132,7 @@
 
 %prep
 %setup -q -n %{name}-%{VERSION}-%{Patchlevel}
-sed -i 's/libltdl.la/libltdl.so/g' configure
-iconv -f ISO-8859-1 -t UTF-8 README.txt > README.txt.tmp
-touch -r README.txt README.txt.tmp
-mv README.txt.tmp README.txt
+
 # for %%doc
 mkdir Magick++/examples
 cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
@@ -148,24 +147,21 @@
         --with-magick_plus_plus \
         --with-gslib \
         --with-wmf \
-        --with-lcms2 \
         --with-webp \
         --with-openexr \
         --with-rsvg \
         --with-xml \
         --with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/MagickCore/.libs' LDDLFLAGS='-shared -L$PWD/MagickCore/.libs'" \
-        --without-dps 
+        --without-dps  \
+        --without-gcc-arch \
+        --with-jbig \
+        --with-openjp2
 
-# Disable rpath
-sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
-sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
 # Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
 make
 
 
 %install
-rm -rf %{buildroot}
-
 make %{?_smp_mflags} install DESTDIR=%{buildroot} INSTALL="install -p"
 cp -a www/source %{buildroot}%{_datadir}/doc/%{name}-%{VERSION}
 rm %{buildroot}%{_libdir}/*.la
@@ -194,13 +190,36 @@
     exit -1
 fi
 
+# fix multilib issues: Rename provided file with platform-bits in name.
+# Create platform independant file inplace of provided and conditionally include required.
+# $1 - filename.h to process.
+function multilibFileVersions(){
+mv $1 ${1%%.h}-%{__isa_bits}.h
+
+local basename=$(basename $1)
+
+cat >$1 <<EOF
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+# include "${basename%%.h}-32.h"
+#elif __WORDSIZE == 64
+# include "${basename%%.h}-64.h"
+#else
+# error "unexpected value for __WORDSIZE macro"
+#endif
+EOF
+}
+
+multilibFileVersions %{buildroot}%{_includedir}/%{name}-7/MagickCore/magick-config.h
+multilibFileVersions %{buildroot}%{_includedir}/%{name}-7/MagickCore/magick-baseconfig.h
+multilibFileVersions %{buildroot}%{_includedir}/%{name}-7/MagickCore/version.h
+
+
 %check
 export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}
 make %{?_smp_mflags} check
 
-%clean
-rm -rf %{buildroot}
-
 %post libs -p /sbin/ldconfig
 
 %post c++ -p /sbin/ldconfig
@@ -216,7 +235,6 @@
 %{_mandir}/man1/%{name}.*
 
 %files libs
-%defattr(-,root,root,-)
 %doc LICENSE NOTICE AUTHORS.txt QuickStart.txt
 %{_libdir}/libMagickCore-7.Q16HDRI.so.*
 %{_libdir}/libMagickWand-7.Q16HDRI.so.*
@@ -226,7 +244,6 @@
 %{_sysconfdir}/%{name}-7
 
 %files devel
-%defattr(-,root,root,-)
 %{_bindir}/MagickCore-config
 %{_bindir}/MagickWand-config
 %{_libdir}/libMagickCore-7.Q16HDRI.so
@@ -244,23 +261,19 @@
 %{_mandir}/man1/MagickWand-config.*
 
 %files djvu
-%defattr(-,root,root,-)
 %{_libdir}/%{name}-%{VERSION}/modules-Q16HDRI/coders/djvu.*
 
 %files doc
-%defattr(-,root,root,-)
 %doc %{_datadir}/doc/%{name}-7
 %doc %{_datadir}/doc/%{name}-%{VERSION}
 %doc LICENSE
 
 %files c++
-%defattr(-,root,root,-)
 %doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
 %doc www/Magick++/COPYING
 %{_libdir}/libMagick++-7.Q16HDRI.so.*
 
 %files c++-devel
-%defattr(-,root,root,-)
 %doc Magick++/examples
 %{_bindir}/Magick++-config
 %{_includedir}/%{name}-7/Magick++
@@ -271,7 +284,6 @@
 %{_mandir}/man1/Magick++-config.*
 
 %files perl -f perl-pkg-files
-%defattr(-,root,root,-)
 %{_mandir}/man3/*
 %doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt