imagemagick.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. ##
  2. ## imagemagick.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package version
  24. %define V_major 6.4.9
  25. %define V_minor 10
  26. %define V_dist %{V_major}-%{V_minor}
  27. %define V_opkg %{V_major}.%{V_minor}
  28. # package information
  29. Name: imagemagick
  30. Summary: Graphic Image Conversion Tool
  31. URL: http://www.imagemagick.org/
  32. Vendor: John Cristy
  33. Packager: OpenPKG Foundation e.V.
  34. Distribution: OpenPKG Community
  35. Class: BASE
  36. Group: Graphics
  37. License: ImageMagick
  38. Version: %{V_opkg}
  39. Release: 20090309
  40. # package options
  41. %option with_perl no
  42. %option with_x11 no
  43. # list of sources
  44. Source0: ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-%{V_dist}.tar.bz2
  45. Patch0: imagemagick.patch
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc, grep, sed
  50. PreReq: OpenPKG, openpkg >= 20040130
  51. BuildPreReq: tiff, jpeg, jasper, bzip2, zlib, png, freetype, fontconfig, lcms, libxml, libiconv
  52. PreReq: tiff, jpeg, jasper, bzip2, zlib, png, freetype, fontconfig, lcms, libxml, libiconv
  53. %if "%{with_perl}" == "yes"
  54. BuildPreReq: perl, perl-openpkg
  55. PreReq: perl
  56. %endif
  57. %if "%{with_x11}" == "yes"
  58. BuildPreReq: X11
  59. PreReq: X11
  60. %endif
  61. AutoReq: no
  62. AutoReqProv: no
  63. %description
  64. ImageMagick is a robust collection of tools and libraries to read,
  65. write, and manipulate an image in many image formats (over 68 major
  66. formats) including popular formats like TIFF, JPEG, PNG, PDF, Photo
  67. CD, and GIF. With ImageMagick you can create images dynamically,
  68. making it suitable for Web applications. You can also resize,
  69. rotate, sharpen, color reduce, or add special effects to an image
  70. and save your completed work in the same or differing image format.
  71. Image processing operations are available from the command line, as
  72. well as through C, C++, and PERL-based programming interfaces.
  73. %track
  74. prog imagemagick = {
  75. version = %{V_dist}
  76. url = ftp://ftp.imagemagick.org/pub/ImageMagick/
  77. regex = ImageMagick-(\d+\.\d+\.\d+(-\d+)?)\.tar\.(bz2|gz)
  78. }
  79. %prep
  80. %setup -q -n ImageMagick-%{V_dist}
  81. %patch -p0
  82. %{l_shtool} subst \
  83. -e 's/^\(MagickLibSubdir="\)[^"]*\("\)/\1imagemagick\2/' \
  84. -e 's/\(-lxml2\)/\1 -liconv/' \
  85. configure
  86. %if "%{with_x11}" == "yes"
  87. %{l_shtool} subst \
  88. -e "s;\\(-lMagickWand\\);\\1 -L`%{l_rc} --query x11_libdir` -lX11 -lXext;" \
  89. PerlMagick/Makefile.PL.in
  90. %endif
  91. %{l_shtool} subst \
  92. -e "s;\\(-lMagickWand\\);\\1 `pkg-config fontconfig --libs`;" \
  93. PerlMagick/Makefile.PL.in
  94. %build
  95. cppflags=""
  96. case "%{l_platform -t}" in
  97. amd64-* ) cppflags="-DPNG_NO_ASSEMBLER_CODE" ;;
  98. esac
  99. CC="%{l_cc}" \
  100. CXX="%{l_cxx}" \
  101. CFLAGS="%{l_cflags -O} %{l_cppflags tiff}" \
  102. CPPFLAGS="%{l_cppflags tiff} $cppflags" \
  103. CXXFLAGS="%{l_cxxflags -O}" \
  104. LDFLAGS="%{l_ldflags}" \
  105. LIBS="-liconv" \
  106. CONFIG_SHELL="%{l_bash}" \
  107. %{l_bash} ./configure \
  108. --prefix=%{l_prefix} \
  109. --mandir=%{l_prefix}/man \
  110. --without-magick-plus-plus \
  111. --without-modules \
  112. --disable-shared \
  113. --with-zlib \
  114. --with-bzlib \
  115. --with-tiff \
  116. --with-jpeg \
  117. --with-jp2 \
  118. --with-png \
  119. --with-xml \
  120. --with-lcms \
  121. --with-freetype \
  122. --without-gvc \
  123. --without-perl \
  124. %if "%{with_x11}" == "yes"
  125. --with-x \
  126. --x-includes=`%{l_rc} --query x11_incdir` \
  127. --x-libraries=`%{l_rc} --query x11_libdir` \
  128. --without-dps \
  129. %else
  130. --without-x \
  131. %endif
  132. --without-threads
  133. %{l_make} %{l_mflags}
  134. %if "%{with_perl}" == "yes"
  135. %{l_prefix}/bin/perl-openpkg prepare
  136. %{l_prefix}/bin/perl-openpkg -d PerlMagick configure build
  137. %endif
  138. %install
  139. rm -rf $RPM_BUILD_ROOT
  140. %{l_make} %{l_mflags} install \
  141. AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  142. %if "%{with_perl}" == "yes"
  143. %{l_prefix}/bin/perl-openpkg -d PerlMagick install
  144. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  145. %else
  146. >perl-openpkg-files
  147. %endif
  148. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  149. ( cd $RPM_BUILD_ROOT%{l_prefix} || exit 1
  150. rm -f bin/cgimagick
  151. rm -f bin/iptcutil
  152. rm -f man/man4/miff.4
  153. rm -rf share/doc >/dev/null 2>&1 || true
  154. rm -rf share/ImageMagick-* >/dev/null 2>&1 || true
  155. ) || exit $?
  156. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  157. %{l_files_std} `cat perl-openpkg-files`
  158. %files -f files
  159. %clean
  160. rm -rf $RPM_BUILD_ROOT