%define _version 3170 %define major 3 Name: freeimage Version: 3.17.0 Release: 3%{?dist} Summary: Multi-format image decoder library # freeimage is tripple-licensed, see # http://freeimage.sourceforge.net/license.html # https://lists.fedoraproject.org/pipermail/legal/2013-October/002271.html License: GPLv2 or GPLv3 or MPLv1.0 URL: http://freeimage.sourceforge.net/ Source0: http://downloads.sourceforge.net/%{name}/FreeImage%{_version}.zip # Unbundle bundled libraries Patch0: FreeImage-3.17.0_unbundle.patch # Fix incorrect paths in doxyfile Patch1: FreeImage-3.17.0_doxygen.patch # Fix CVE-2015-0852 (#1257859) Patch2: FreeImage-3.17.0_CVE-2015-0852.patch BuildRequires: doxygen BuildRequires: OpenEXR-devel BuildRequires: libjpeg-devel BuildRequires: libmng-devel BuildRequires: libpng-devel BuildRequires: libtiff-devel BuildRequires: libwebp-devel %if 0{?fedora} BuildRequires: LibRaw-devel BuildRequires: jxrlib-devel BuildRequires: openjpeg2-devel %endif %description FreeImage is a library for developers who would like to support popular graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by today's multimedia applications. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %package plus Summary: C++ wrapper for FreeImage %description plus The %{name}-plus package contains the C++ wrapper library for %{name}. %package plus-devel Summary: Development files for %{name}-devel Requires: %{name}-plus%{?_isa} = %{version}-%{release} Requires: %{name}-devel%{?_isa} = %{version}-%{release} %description plus-devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}-plus. %prep %setup -q -n FreeImage %patch0 -p1 %patch1 -p1 %patch2 -p1 # remove all included libs to make sure these don't get used during compile rm -r Source/Lib* Source/ZLib Source/OpenEXR # clear files which cannot be built due to dependencies on private headers # (see also unbundle patch) > Source/FreeImage/PluginG3.cpp > Source/FreeImageToolkit/JPEGTransform.cpp # sanitize encodings / line endings for file in `find . -type f -name '*.c' -or -name '*.cpp' -or -name '*.h' -or -name '*.txt' -or -name Makefile`; do iconv --from=ISO-8859-15 --to=UTF-8 $file > $file.new && \ sed -i 's|\r||g' $file.new && \ touch -r $file $file.new && mv $file.new $file done %build sh ./gensrclist.sh sh ./genfipsrclist.sh %ifarch %{power64} make -f Makefile.gnu %{?_smp_mflags} CFLAGS="%{optflags} -fPIC" CXXFLAGS="%{optflags} -fPIC" LDFLAGS="%{__global_ldflags}" make -f Makefile.fip %{?_smp_mflags} CFLAGS="%{optflags} -fPIC" CXXFLAGS="%{optflags} -fPIC" LDFLAGS="%{__global_ldflags}" %else make -f Makefile.gnu %{?_smp_mflags} CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}" make -f Makefile.fip %{?_smp_mflags} CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}" %endif pushd Wrapper/FreeImagePlus/doc doxygen FreeImagePlus.dox popd %install install -Dpm 755 Dist/lib%{name}-%{version}.so %{buildroot}%{_libdir}/lib%{name}-%{version}.so ln -s lib%{name}-%{version}.so %{buildroot}%{_libdir}/lib%{name}.so install -Dpm 755 Dist/lib%{name}plus-%{version}.so %{buildroot}%{_libdir}/lib%{name}plus-%{version}.so ln -s lib%{name}plus-%{version}.so %{buildroot}%{_libdir}/lib%{name}plus.so install -Dpm 644 Source/FreeImage.h %{buildroot}%{_includedir}/FreeImage.h install -Dpm 644 Wrapper/FreeImagePlus/FreeImagePlus.h %{buildroot}%{_includedir}/FreeImagePlus.h # install missing symlink (was giving no-ldconfig-symlink rpmlint errors) ldconfig -n %{buildroot}%{_libdir} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %post plus -p /sbin/ldconfig %postun plus -p /sbin/ldconfig %files %license license-*.txt %doc Whatsnew.txt %{_libdir}/lib%{name}-%{version}.so %{_libdir}/lib%{name}.so.%major %files devel %doc Examples %{_includedir}/FreeImage.h %{_libdir}/lib%{name}.so %files plus %doc Wrapper/FreeImagePlus/WhatsNew_FIP.txt %{_libdir}/lib%{name}plus-%{version}.so %{_libdir}/lib%{name}plus.so.%major %files plus-devel %doc Wrapper/FreeImagePlus/doc/html %{_includedir}/FreeImagePlus.h %{_libdir}/lib%{name}plus.so %changelog * Thu Oct 15 2015 Karsten Hopp 3.17.0-3 - ppc64 and ppc64le need -fPIC (rhbz#1272048) * Wed Sep 30 2015 Sandro Mani - 3.17.0-2 - Fix under-linked library * Thu Sep 17 2015 Sandro Mani - 3.17.0-1 - Update to 3.17.0 - Add fix for CVE-2015-0852 (#1257859) - Put freeimage-plus in separate package * Wed Jun 17 2015 Fedora Release Engineering - 3.10.0-25 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Sat May 02 2015 Kalev Lember - 3.10.0-24 - Rebuilt for GCC 5 C++11 ABI change * Thu Feb 19 2015 Rex Dieter 3.10.0-23 - rebuild (gcc5) * Wed Nov 26 2014 Rex Dieter 3.10.0-22 - rebuild (openexr), tighten subpkg deps via %%{?_isa} * Sat Aug 16 2014 Fedora Release Engineering - 3.10.0-21 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Sat Jun 07 2014 Fedora Release Engineering - 3.10.0-20 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Wed Nov 27 2013 Rex Dieter - 3.10.0-19 - rebuild (openexr) * Mon Sep 09 2013 Bruno Wolff III 3.10.0-18 - Rebuild for ilmbase related soname bumps * Mon Aug 26 2013 Jon Ciesla - 3.10.0-17 - libmng rebuild. * Sat Aug 03 2013 Fedora Release Engineering - 3.10.0-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Sun Mar 10 2013 Rex Dieter - 3.10.0-15 - rebuild (OpenEXR) * Wed Feb 13 2013 Fedora Release Engineering - 3.10.0-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Fri Jan 18 2013 Adam Tkac - 3.10.0-13 - rebuild due to "jpeg8-ABI" feature drop * Fri Dec 21 2012 Adam Tkac - 3.10.0-12 - rebuild against new libjpeg * Fri Aug 3 2012 Tom Lane 3.10.0-11 - Add patch for libtiff 4.0 API changes Resolves: #845407 * Thu Jul 19 2012 Fedora Release Engineering - 3.10.0-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Mon Feb 13 2012 Bruno Wolff III 3.10.0-9 - Update for libpng 1.5 API * Thu Feb 09 2012 Rex Dieter 3.10.0-8 - rebuild (openjpeg) * Fri Jan 13 2012 Fedora Release Engineering - 3.10.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Tue Dec 06 2011 Adam Jackson - 3.10.0-6 - Rebuild for new libpng * Tue Feb 08 2011 Fedora Release Engineering - 3.10.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Wed Jan 12 2011 Rex Dieter - 3.10.0-4 - rebuild (openjpeg) * Fri Jul 24 2009 Fedora Release Engineering - 3.10.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Tue Feb 24 2009 Fedora Release Engineering - 3.10.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Tue Mar 18 2008 Hans de Goede 3.10.0-1 - Initial Fedora package