File freeimage.spec of Package freeimage
#
# spec file for package freeimage
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define so_ver 3
Name: freeimage
Version: 3.15.4
Release: 0
Summary: Multi-format Image Decoder Library
License: GPL-2.0 or GPL-3.0
Group: System/Libraries
Url: http://freeimage.sourceforge.net/
# repacked from http://downloads.sourceforge.net/freeimage/FreeImage3154.zip
Source0: FreeImage3154.tar.bz2
# PATCH-FIX-OPENSUSE makefiles_fixes.patch asterios.dramis@gmail.com -- Fix CFLAGS and CXXFLAGS, removed -s (strip) option, add missing symlinks for libfreeimageplus, remove root user from install
Patch0: makefiles_fixes.patch
# PATCH-FIX-OPENSUSE doxygen.patch asterios.dramis@gmail.com -- Fix documentation building (Based on patch from Fedora)
Patch1: doxygen.patch
# PATCH-FIX-OPENSUSE use_system_libs.patch asterios.dramis@gmail.com -- Use system libraries, except libjpeg and libtiff (the package uses some internal headers of these).
Patch2: use_system_libs.patch
# PATCH-FIX-OPENSUSE use_system_libs_openjpeg.patch asterios.dramis@gmail.com -- Use system libraries (openjpeg)
Patch3: use_system_libs_openjpeg.patch
# PATCH-FIX-OPENSUSE use_system_libs_libpng15.patch asterios.dramis@gmail.com -- Use system libraries (libpng15)
Patch4: use_system_libs_libpng15.patch
# PATCH-FIX-OPENSUSE use_system_libs_libpng14.patch asterios.dramis@gmail.com -- Use system libraries (libpng14)
Patch5: use_system_libs_libpng14.patch
# PATCH-FIX-OPENSUSE don't define conflicting types when libraw is used prusnak@opensuse.org
Patch6: libraw_types.patch
BuildRequires: OpenEXR-devel
BuildRequires: doxygen
BuildRequires: gcc-c++
BuildRequires: libpng-devel
%if 0%{?suse_version} == 1140
BuildRequires: libraw-devel
BuildRequires: libraw-devel-static
%else
BuildRequires: libraw-devel
%endif
%if 0%{?suse_version} > 1210
BuildRequires: openjpeg-devel
%endif
BuildRequires: zlib-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
FreeImage is an Open Source library project 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. FreeImage is easy to use, fast,
multithreading safe.
%package devel
Summary: Development Files for FreeImage
Group: Development/Libraries/C and C++
Requires: lib%{name}%{so_ver} = %{version}
Requires: lib%{name}plus%{so_ver} = %{version}
# libfreeimage-devel was last used at version 3.10.0
Provides: lib%{name}-devel = %{version}
Obsoletes: lib%{name}-devel < %{version}
%description devel
This package provides development libraries and headers needed to build
software using FreeImage.
%package -n lib%{name}%{so_ver}
Summary: Multi-format Image Decoder Library
Group: System/Libraries
%description -n lib%{name}%{so_ver}
FreeImage is an Open Source library project 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. FreeImage is easy to use and fast,
multithreading safe.
%package -n lib%{name}plus%{so_ver}
Summary: Multi-format Image Decoder Library
Group: System/Libraries
%description -n lib%{name}plus%{so_ver}
FreeImage is an Open Source library project 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. FreeImage is easy to use and fast,
multithreading safe.
%prep
%setup -q -n FreeImage
%patch0 -p1
%patch1
%patch2 -p1
%if 0%{?suse_version} > 1210
%patch3 -p1
%endif
%if 0%{?suse_version} > 1220
%patch4 -p1
%else
%patch5 -p1
%endif
%patch6 -p1
# Remove bundled libs (except of LibJPEG/ and LibTIFF4/) to make sure these don't get used during compile
rm -rf Source/LibPNG/ Source/LibRawLite/ Source/OpenEXR/ Source/ZLib/
%if 0%{?suse_version} > 1210
rm -rf Source/LibOpenJPEG/
%endif
# Fix "wrong-file-end-of-line-encoding" rpmlint warning
sed -i 's/\r$//' license-fi.txt license-gplv2.txt license-gplv3.txt Whatsnew.txt
%build
sh ./gensrclist.sh
sh ./genfipsrclist.sh
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
make %{?_smp_mflags}
make %{?_smp_mflags} -f Makefile.fip
pushd Wrapper/FreeImagePlus/doc
doxygen FreeImagePlus.dox
popd
%install
make DESTDIR=%{buildroot} INSTALLDIR=%{buildroot}%{_libdir} install
make -f Makefile.fip DESTDIR=%{buildroot} INSTALLDIR=%{buildroot}%{_libdir} install
# Remove static libraries
rm -f %{buildroot}%{_libdir}/*.a
%post -n lib%{name}%{so_ver} -p /sbin/ldconfig
%postun -n lib%{name}%{so_ver} -p /sbin/ldconfig
%post -n lib%{name}plus%{so_ver} -p /sbin/ldconfig
%postun -n lib%{name}plus%{so_ver} -p /sbin/ldconfig
%files devel
%defattr(-,root,root,-)
%doc Whatsnew.txt license-*.txt
%doc Wrapper/FreeImagePlus/doc/html/
%{_includedir}/FreeImage.h
%{_includedir}/FreeImagePlus.h
%{_libdir}/libfreeimage.so
%{_libdir}/libfreeimageplus.so
%files -n lib%{name}%{so_ver}
%defattr(-,root,root,-)
%{_libdir}/lib%{name}.so.3*
%{_libdir}/lib%{name}-%{version}.so
%files -n lib%{name}plus%{so_ver}
%defattr(-,root,root,-)
%{_libdir}/lib%{name}plus.so.3*
%{_libdir}/lib%{name}plus-%{version}.so
%changelog