freeimage-vl.spec 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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: 4%{?_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. Patch2: FreeImage-3.10.0-libpng15.patch
  17. Patch3: FreeImage-3.10.0-libtiff4.patch
  18. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  19. BuildRequires: libjpeg-devel
  20. BuildRequires: libmng-devel
  21. BuildRequires: libpng-devel
  22. BuildRequires: libtiff-devel
  23. BuildRequires: OpenEXR-devel
  24. BuildRequires: openjpeg-devel
  25. BuildRequires: doxygen
  26. %description
  27. FreeImage is a library for developers who would like to support popular
  28. graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by
  29. today's multimedia applications.
  30. %package devel
  31. Summary: Development files for %{name}
  32. Summary(ja): %{name} の開発用ファイル
  33. Group: Development/Libraries
  34. Requires: %{name} = %{version}-%{release}
  35. %description devel
  36. The %{name}-devel package contains libraries and header files for
  37. developing applications that use %{name}.
  38. %prep
  39. %setup -q -n FreeImage
  40. %patch0 -p1 -z .syslibs
  41. %patch1 -p1
  42. %patch2 -p0
  43. %patch3 -p1
  44. touch -r Source/FreeImage.h.syslibs Source/FreeImage.h
  45. # remove all included libs to make sure these don't get used during compile
  46. rm -r Source/Lib* Source/ZLib Source/OpenEXR
  47. # some encoding / line ending cleanups
  48. iconv -f ISO-8859-1 -t UTF-8 Whatsnew.txt > Whatsnew.txt.tmp
  49. touch -r Whatsnew.txt Whatsnew.txt.tmp
  50. mv Whatsnew.txt.tmp Whatsnew.txt
  51. sed -i 's/\r//g' Whatsnew.txt license-*.txt gensrclist.sh \
  52. Wrapper/FreeImagePlus/WhatsNew_FIP.txt
  53. %build
  54. sh ./gensrclist.sh
  55. make %{?_smp_mflags} \
  56. COMPILERFLAGS="$RPM_OPT_FLAGS -fPIC -fvisibility=hidden `pkg-config --cflags OpenEXR` `pkg-config --cflags libopenjpeg`"
  57. # build libfreeimageplus DIY, as the provided makefile makes libfreeimageplus
  58. # contain a private copy of libfreeimage <sigh>
  59. FIP_OBJS=
  60. for i in Wrapper/FreeImagePlus/src/fip*.cpp; do
  61. gcc -o $i.o $RPM_OPT_FLAGS -fPIC -fvisibility=hidden \
  62. -ISource -IWrapper/FreeImagePlus -c $i
  63. FIP_OBJS="$FIP_OBJS $i.o"
  64. done
  65. gcc -shared -LDist -o Dist/lib%{name}plus-%{version}.so \
  66. -Wl,-soname,lib%{name}plus.so.%{major} $FIP_OBJS -lfreeimage-%{version}
  67. pushd Wrapper/FreeImagePlus/doc
  68. doxygen FreeImagePlus.dox
  69. popd
  70. %install
  71. rm -rf $RPM_BUILD_ROOT
  72. mkdir -p $RPM_BUILD_ROOT%{_libdir}
  73. mkdir -p $RPM_BUILD_ROOT%{_includedir}
  74. install -m 755 Dist/lib%{name}-%{version}.so $RPM_BUILD_ROOT%{_libdir}
  75. ln -s lib%{name}-%{version}.so $RPM_BUILD_ROOT%{_libdir}/lib%{name}.so.%{major}
  76. ln -s lib%{name}-%{version}.so $RPM_BUILD_ROOT%{_libdir}/lib%{name}.so
  77. install -m 755 Dist/lib%{name}plus-%{version}.so $RPM_BUILD_ROOT%{_libdir}
  78. ln -s lib%{name}plus-%{version}.so \
  79. $RPM_BUILD_ROOT%{_libdir}/lib%{name}plus.so.%{major}
  80. ln -s lib%{name}plus-%{version}.so $RPM_BUILD_ROOT%{_libdir}/lib%{name}plus.so
  81. install -p -m 644 Source/FreeImage.h $RPM_BUILD_ROOT%{_includedir}
  82. install -p -m 644 Wrapper/FreeImagePlus/FreeImagePlus.h \
  83. $RPM_BUILD_ROOT%{_includedir}
  84. %clean
  85. rm -rf $RPM_BUILD_ROOT
  86. %post -p /sbin/ldconfig
  87. %postun -p /sbin/ldconfig
  88. %files
  89. %defattr(-,root,root,-)
  90. %doc Whatsnew.txt license-*.txt Wrapper/FreeImagePlus/WhatsNew_FIP.txt
  91. %{_libdir}/lib%{name}*-%{version}.so
  92. %{_libdir}/lib%{name}*.so.%{major}
  93. %files devel
  94. %defattr(-,root,root,-)
  95. %doc Wrapper/FreeImagePlus/doc/html
  96. %{_includedir}/FreeImage*.h
  97. %{_libdir}/lib%{name}.so
  98. %{_libdir}/lib%{name}plus.so
  99. %changelog
  100. * Sun Jul 10 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.10.0-3
  101. - rebuild with gcc-5.4.0
  102. * Thu Apr 14 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 3.10.0-2
  103. - rebuilt with libmng 2.0.2, libpng 1.6.12, libtiff 4.0.3, OpenEXR 2.2.0 and openjpeg 1.5.2
  104. - added Patch2 and Patch3
  105. * Thu Apr 14 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 3.10.0-2
  106. - rebuilt with openjpeg-1.4
  107. * Thu Jun 11 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 3.10.0-1
  108. - initial build for Vine Linux
  109. * Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10.0-2
  110. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  111. * Tue Mar 18 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 3.10.0-1
  112. - Initial Fedora package