File embymagick.spec of Package embymagick

%global VERSION  6.9.6
%global Patchlevel  2
%global debug_package %{nil}

Name:           embymagick
Version:        %{VERSION}
Release:        %{Patchlevel}
Summary:        Use ImageMagick to modify and compose bitmap images in a variety of formats
Group:          Applications/Multimedia
License:        http://www.imagemagick.org/script/license.php
Url:            http://www.imagemagick.org/
Source0:        embymagick_%{VERSION}.orig.tar.gz
#Patch1:		tests-validate.patch
%if 0%{?suse_version} >= 1315
BuildRequires: libbz2-devel, libjasper-devel, liblcms2-devel
%else
BuildRequires: bzip2-devel, jasper-devel, lcms2-devel
%endif
BuildRequires:  freetype-devel, libjpeg-devel, libpng-devel
BuildRequires:  libtiff-devel, giflib-devel, zlib-devel
BuildRequires:  ghostscript-devel
BuildRequires:  libwmf-devel, libtool-ltdl-devel
BuildRequires:  libXext-devel, libXt-devel
BuildRequires:  libxml2-devel, librsvg2-devel
BuildRequires:  fftw-devel, libwebp-devel

%description
The MagickCore API is a low-level interface between the C programming language
and the ImageMagick image processing libraries and is recommended for
wizard-level programmers only. Unlike the MagickWand C API which uses only a
few opaque types and accessors, with MagickCore you almost exclusively access
the structure members directly.
This package contains the C libraries needed to run executables that make
use of MagickCore.
This version of MagickCore is compiled for quantum depth of 8 bits
and specifically for the emby project.
The MagickWand API is the recommended interface between the C programming language
and the ImageMagick image processing libraries. Unlike the MagickCore C API,
MagickWand uses only a few opaque types. Accessors are available to set or get
important wand properties.
This package contains the C libraries needed to run executables that make use of 
MagickWand.
This version of MagickWand is compiled for quantum depth of 8 bits and 
specifically for the emby project.


%prep
%setup -q
sed -i 's/libltdl.la/libltdl.so/g' configure
#%patch1 -p1

%build
%configure --prefix=/usr/lib/emby-server \
	--libdir=/usr/lib/emby-server/lib64 \
	--sysconfdir=/etc \
	--with-includearch-dir=/usr/include \
	--with-modules \
	--with-gs-font-dir=/usr/share/fonts/type1/gsfonts \
	--without-djvu \
	--without-wmf \
	--without-gvc \
	--enable-shared \
	--without-dps \
	--without-fpx \
	--without-rsvg \
	--with-tiff=yes \
	--with-webp=yes \
	--with-jpeg=yes \
	--with-png=yes \
	--with-xml=yes \
	--without-x \
	--enable-hdri=no \
	--without-gslib \
	--disable-openmp \
	--with-fontconfig \
	--without-gvc \
	--without-openexr \
    --disable-silent-rules \
	--with-quantum-depth=8 \
    --without-gcc-arch \
    --without-magick-plus-plus

# 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 %{?_smp_mflags}


%install
rm -rf %{buildroot}
make %{?_smp_mflags} install DESTDIR=%{buildroot} INSTALL="install -p"
rm -fr %{buildroot}%{_sysconfdir}/ImageMagick-6
rm %{buildroot}%{_bindir}/*
rm -fr %{buildroot}%{_includedir}/ImageMagick-6
rm %{buildroot}%{_prefix}/lib/emby-server/lib64/*.la
rm %{buildroot}%{_prefix}/lib/emby-server/lib64/*.a
rm -fr %{buildroot}%{_prefix}/lib/emby-server/lib64/pkgconfig
rm %{buildroot}%{_mandir}/man1/*
rm -fr %{buildroot}%{_datadir}/ImageMagick-6
rm -fr %{buildroot}%{_datadir}/doc/ImageMagick-6


%check
export LD_LIBRARY_PATH=%{buildroot}%{_prefix}/lib/emby-server/lib64
make %{?_smp_mflags} check
cat ./test-suite.log

%clean
rm -rf %{builddir}


%post -p /sbin/ldconfig


%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc LICENSE
%if 0%{?suse_version} >= 1315
	%{_prefix}/lib/emby-server
%else
	%{_prefix}/lib/emby-server/lib64/ImageMagick-*/config-*/*
    %{_prefix}/lib/emby-server/lib64/ImageMagick-*/modules-*/coders/*.la
    %{_prefix}/lib/emby-server/lib64/ImageMagick-*/modules-*/coders/*.so
    %{_prefix}/lib/emby-server/lib64/ImageMagick-*/modules-*/filters/*.la
    %{_prefix}/lib/emby-server/lib64/ImageMagick-*/modules-*/filters/*.so
%endif
%{_prefix}/lib/emby-server/lib64/libMagickCore*.so*
%{_prefix}/lib/emby-server/lib64/libMagickWand*.so*


%changelog