a6e4558
%define _version 3100
a6e4558
%define major 3
a6e4558
a6e4558
Name:           freeimage
a6e4558
Version:        3.10.0
06ee366
Release:        3%{?dist}
a6e4558
Summary:        Multi-format image decoder library
a6e4558
Group:          System Environment/Libraries
a6e4558
# freeimage is dual-licensed, see Whatsnew.txt (search for license) or:
a6e4558
# http://freeimage.sourceforge.net/license.html
a6e4558
License:        GPL+ or MPLv1.0
a6e4558
URL:            http://freeimage.sourceforge.net/
a6e4558
Source0:        http://downloads.sourceforge.net/%{name}/FreeImage%{_version}.zip
a6e4558
Patch0:         FreeImage-3.10.0-syslibs.patch
a6e4558
Patch1:         FreeImage-3.10.0-doxygen.patch
a6e4558
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
a6e4558
BuildRequires:  libjpeg-devel libpng-devel libtiff-devel OpenEXR-devel
a6e4558
BuildRequires:  libmng-devel openjpeg-devel doxygen
a6e4558
a6e4558
%description
a6e4558
FreeImage is a library for developers who would like to support popular
a6e4558
graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by
a6e4558
today's multimedia applications. 
a6e4558
a6e4558
a6e4558
%package        devel
a6e4558
Summary:        Development files for %{name}
a6e4558
Group:          Development/Libraries
a6e4558
Requires:       %{name} = %{version}-%{release}
a6e4558
a6e4558
%description    devel
a6e4558
The %{name}-devel package contains libraries and header files for
a6e4558
developing applications that use %{name}.
a6e4558
a6e4558
a6e4558
%prep
a6e4558
%setup -q -n FreeImage
a6e4558
%patch0 -p1 -z .syslibs
a6e4558
%patch1 -p1
a6e4558
touch -r Source/FreeImage.h.syslibs Source/FreeImage.h
a6e4558
a6e4558
# remove all included libs to make sure these don't get used during compile
a6e4558
rm -r Source/Lib* Source/ZLib Source/OpenEXR
a6e4558
a6e4558
# some encoding / line ending cleanups
a6e4558
iconv -f ISO-8859-1 -t UTF-8 Whatsnew.txt > Whatsnew.txt.tmp
a6e4558
touch -r Whatsnew.txt Whatsnew.txt.tmp
a6e4558
mv Whatsnew.txt.tmp Whatsnew.txt
a6e4558
sed -i 's/\r//g' Whatsnew.txt license-*.txt gensrclist.sh \
a6e4558
  Wrapper/FreeImagePlus/WhatsNew_FIP.txt
a6e4558
a6e4558
a6e4558
%build
a6e4558
sh ./gensrclist.sh
a6e4558
make %{?_smp_mflags} \
a6e4558
  COMPILERFLAGS="$RPM_OPT_FLAGS -fPIC -fvisibility=hidden `pkg-config --cflags OpenEXR`"
a6e4558
a6e4558
# build libfreeimageplus DIY, as the provided makefile makes libfreeimageplus
a6e4558
# contain a private copy of libfreeimage <sigh>
a6e4558
FIP_OBJS=
a6e4558
for i in Wrapper/FreeImagePlus/src/fip*.cpp; do
a6e4558
  gcc -o $i.o $RPM_OPT_FLAGS -fPIC -fvisibility=hidden \
a6e4558
    -ISource -IWrapper/FreeImagePlus -c $i
a6e4558
  FIP_OBJS="$FIP_OBJS $i.o"
a6e4558
done
a6e4558
gcc -shared -LDist -o Dist/lib%{name}plus-%{version}.so \
a6e4558
  -Wl,-soname,lib%{name}plus.so.%{major} $FIP_OBJS -lfreeimage-%{version}
a6e4558
a6e4558
pushd Wrapper/FreeImagePlus/doc
a6e4558
doxygen FreeImagePlus.dox
a6e4558
popd
a6e4558
a6e4558
a6e4558
%install
a6e4558
rm -rf $RPM_BUILD_ROOT
a6e4558
mkdir -p $RPM_BUILD_ROOT%{_libdir}
a6e4558
mkdir -p $RPM_BUILD_ROOT%{_includedir}
a6e4558
a6e4558
install -m 755 Dist/lib%{name}-%{version}.so $RPM_BUILD_ROOT%{_libdir}
a6e4558
ln -s lib%{name}-%{version}.so $RPM_BUILD_ROOT%{_libdir}/lib%{name}.so.%{major}
a6e4558
ln -s lib%{name}-%{version}.so $RPM_BUILD_ROOT%{_libdir}/lib%{name}.so
a6e4558
a6e4558
install -m 755 Dist/lib%{name}plus-%{version}.so $RPM_BUILD_ROOT%{_libdir}
a6e4558
ln -s lib%{name}plus-%{version}.so \
a6e4558
  $RPM_BUILD_ROOT%{_libdir}/lib%{name}plus.so.%{major}
a6e4558
ln -s lib%{name}plus-%{version}.so $RPM_BUILD_ROOT%{_libdir}/lib%{name}plus.so
a6e4558
a6e4558
install -p -m 644 Source/FreeImage.h $RPM_BUILD_ROOT%{_includedir}
a6e4558
install -p -m 644 Wrapper/FreeImagePlus/FreeImagePlus.h \
a6e4558
  $RPM_BUILD_ROOT%{_includedir}
a6e4558
a6e4558
a6e4558
%clean
a6e4558
rm -rf $RPM_BUILD_ROOT
a6e4558
a6e4558
a6e4558
%post -p /sbin/ldconfig
a6e4558
a6e4558
%postun -p /sbin/ldconfig
a6e4558
a6e4558
a6e4558
%files
a6e4558
%defattr(-,root,root,-)
a6e4558
%doc Whatsnew.txt license-*.txt Wrapper/FreeImagePlus/WhatsNew_FIP.txt
a6e4558
%{_libdir}/lib%{name}*-%{version}.so
a6e4558
%{_libdir}/lib%{name}*.so.%{major}
a6e4558
a6e4558
%files devel
a6e4558
%defattr(-,root,root,-)
a6e4558
%doc Wrapper/FreeImagePlus/doc/html
a6e4558
%{_includedir}/FreeImage*.h
a6e4558
%{_libdir}/lib%{name}.so
a6e4558
%{_libdir}/lib%{name}plus.so
a6e4558
a6e4558
a6e4558
%changelog
06ee366
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10.0-3
06ee366
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
06ee366
c39ac48
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10.0-2
c39ac48
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
c39ac48
a6e4558
* Tue Mar 18 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 3.10.0-1
a6e4558
- Initial Fedora package