freeimage-vl.spec 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. %define _version 3100
  2. %define major 3
  3. Summary: Multi-format image decoder library
  4. Summary(ja): マルチフォーマット画像デコードライブラリ
  5. Name: freeimage
  6. Version: 3.10.0
  7. Release: 2%{?_dist_release}
  8. Group: System Environment/Libraries
  9. # freeimage is dual-licensed, see Whatsnew.txt (search for license) or:
  10. # http://freeimage.sourceforge.net/license.html
  11. License: GPL+ or MPLv1.0
  12. URL: http://freeimage.sourceforge.net/
  13. Source0: http://downloads.sourceforge.net/%{name}/FreeImage%{_version}.zip
  14. Patch0: FreeImage-3.10.0-syslibs.patch
  15. Patch1: FreeImage-3.10.0-doxygen.patch
  16. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  17. BuildRequires: libjpeg-devel libpng-devel libtiff-devel OpenEXR-devel
  18. BuildRequires: libmng-devel openjpeg-devel doxygen
  19. %description
  20. FreeImage is a library for developers who would like to support popular
  21. graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by
  22. today's multimedia applications.
  23. %package devel
  24. Summary: Development files for %{name}
  25. Summary(ja): Development files for %{name}
  26. Group: Development/Libraries
  27. Requires: %{name} = %{version}-%{release}
  28. %description devel
  29. The %{name}-devel package contains libraries and header files for
  30. developing applications that use %{name}.
  31. %prep
  32. %setup -q -n FreeImage
  33. %patch0 -p1 -z .syslibs
  34. %patch1 -p1
  35. touch -r Source/FreeImage.h.syslibs Source/FreeImage.h
  36. # remove all included libs to make sure these don't get used during compile
  37. rm -r Source/Lib* Source/ZLib Source/OpenEXR
  38. # some encoding / line ending cleanups
  39. iconv -f ISO-8859-1 -t UTF-8 Whatsnew.txt > Whatsnew.txt.tmp
  40. touch -r Whatsnew.txt Whatsnew.txt.tmp
  41. mv Whatsnew.txt.tmp Whatsnew.txt
  42. sed -i 's/\r//g' Whatsnew.txt license-*.txt gensrclist.sh \
  43. Wrapper/FreeImagePlus/WhatsNew_FIP.txt
  44. %build
  45. sh ./gensrclist.sh
  46. make %{?_smp_mflags} \
  47. COMPILERFLAGS="$RPM_OPT_FLAGS -fPIC -fvisibility=hidden `pkg-config --cflags OpenEXR`"
  48. # build libfreeimageplus DIY, as the provided makefile makes libfreeimageplus
  49. # contain a private copy of libfreeimage <sigh>
  50. FIP_OBJS=
  51. for i in Wrapper/FreeImagePlus/src/fip*.cpp; do
  52. gcc -o $i.o $RPM_OPT_FLAGS -fPIC -fvisibility=hidden \
  53. -ISource -IWrapper/FreeImagePlus -c $i
  54. FIP_OBJS="$FIP_OBJS $i.o"
  55. done
  56. gcc -shared -LDist -o Dist/lib%{name}plus-%{version}.so \
  57. -Wl,-soname,lib%{name}plus.so.%{major} $FIP_OBJS -lfreeimage-%{version}
  58. pushd Wrapper/FreeImagePlus/doc
  59. doxygen FreeImagePlus.dox
  60. popd
  61. %install
  62. rm -rf $RPM_BUILD_ROOT
  63. mkdir -p $RPM_BUILD_ROOT%{_libdir}
  64. mkdir -p $RPM_BUILD_ROOT%{_includedir}
  65. install -m 755 Dist/lib%{name}-%{version}.so $RPM_BUILD_ROOT%{_libdir}
  66. ln -s lib%{name}-%{version}.so $RPM_BUILD_ROOT%{_libdir}/lib%{name}.so.%{major}
  67. ln -s lib%{name}-%{version}.so $RPM_BUILD_ROOT%{_libdir}/lib%{name}.so
  68. install -m 755 Dist/lib%{name}plus-%{version}.so $RPM_BUILD_ROOT%{_libdir}
  69. ln -s lib%{name}plus-%{version}.so \
  70. $RPM_BUILD_ROOT%{_libdir}/lib%{name}plus.so.%{major}
  71. ln -s lib%{name}plus-%{version}.so $RPM_BUILD_ROOT%{_libdir}/lib%{name}plus.so
  72. install -p -m 644 Source/FreeImage.h $RPM_BUILD_ROOT%{_includedir}
  73. install -p -m 644 Wrapper/FreeImagePlus/FreeImagePlus.h \
  74. $RPM_BUILD_ROOT%{_includedir}
  75. %clean
  76. rm -rf $RPM_BUILD_ROOT
  77. %post -p /sbin/ldconfig
  78. %postun -p /sbin/ldconfig
  79. %files
  80. %defattr(-,root,root,-)
  81. %doc Whatsnew.txt license-*.txt Wrapper/FreeImagePlus/WhatsNew_FIP.txt
  82. %{_libdir}/lib%{name}*-%{version}.so
  83. %{_libdir}/lib%{name}*.so.%{major}
  84. %files devel
  85. %defattr(-,root,root,-)
  86. %doc Wrapper/FreeImagePlus/doc/html
  87. %{_includedir}/FreeImage*.h
  88. %{_libdir}/lib%{name}.so
  89. %{_libdir}/lib%{name}plus.so
  90. %changelog
  91. * Thu Apr 14 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 3.10.0-2
  92. - rebuilt with openjpeg-1.4
  93. * Thu Jun 11 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 3.10.0-1
  94. - initial build for Vine Linux
  95. * Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10.0-2
  96. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  97. * Tue Mar 18 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 3.10.0-1
  98. - Initial Fedora package