imagemagick.spec 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. ##
  2. ## imagemagick.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2010 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.6.3
  25. %define V_minor 0
  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: 20100704
  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. BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, grep, sed
  48. PreReq: OpenPKG, openpkg >= 20100101
  49. BuildPreReq: tiff, jpeg, jasper, bzip2, zlib, png, freetype, fontconfig, lcms, liblqr, libxml, libiconv
  50. PreReq: tiff, jpeg, jasper, bzip2, zlib, png, freetype, fontconfig, lcms, liblqr, libxml, libiconv
  51. %if "%{with_perl}" == "yes"
  52. BuildPreReq: perl, perl-openpkg
  53. PreReq: perl
  54. %endif
  55. %if "%{with_x11}" == "yes"
  56. BuildPreReq: X11
  57. PreReq: X11
  58. %endif
  59. %description
  60. ImageMagick is a robust collection of tools and libraries to read,
  61. write, and manipulate an image in many image formats (over 68 major
  62. formats) including popular formats like TIFF, JPEG, PNG, PDF, Photo
  63. CD, and GIF. With ImageMagick you can create images dynamically,
  64. making it suitable for Web applications. You can also resize,
  65. rotate, sharpen, color reduce, or add special effects to an image
  66. and save your completed work in the same or differing image format.
  67. Image processing operations are available from the command line, as
  68. well as through C, C++, and PERL-based programming interfaces.
  69. %track
  70. prog imagemagick = {
  71. version = %{V_dist}
  72. url = ftp://ftp.imagemagick.org/pub/ImageMagick/
  73. regex = ImageMagick-(\d+\.\d+\.\d+(-\d+)?)\.tar\.(bz2|gz)
  74. }
  75. %prep
  76. %setup -q -n ImageMagick-%{V_dist}
  77. %patch -p0
  78. %{l_shtool} subst \
  79. -e 's/^\(MagickLibSubdir="\)[^"]*\("\)/\1imagemagick\2/' \
  80. -e 's/\(-lxml2\)/\1 -liconv/' \
  81. configure
  82. %if "%{with_x11}" == "yes"
  83. %{l_shtool} subst \
  84. -e "s;\\(-lMagickWand\\);\\1 -L`%{l_rc} --query x11_libdir` -lX11 -lXext;" \
  85. PerlMagick/Makefile.PL.in
  86. %endif
  87. %{l_shtool} subst \
  88. -e "s;\\(-lMagickWand\\);\\1 `pkg-config fontconfig --libs`;" \
  89. PerlMagick/Makefile.PL.in
  90. %build
  91. cppflags=""
  92. case "%{l_platform -t}" in
  93. amd64-* ) cppflags="-DPNG_NO_ASSEMBLER_CODE" ;;
  94. esac
  95. CC="%{l_cc}" \
  96. CXX="%{l_cxx}" \
  97. CFLAGS="%{l_cflags -O} %{l_cppflags tiff}" \
  98. CPPFLAGS="%{l_cppflags tiff} $cppflags" \
  99. CXXFLAGS="%{l_cxxflags -O}" \
  100. LDFLAGS="%{l_ldflags}" \
  101. LIBS="-liconv" \
  102. CONFIG_SHELL="%{l_bash}" \
  103. %{l_bash} ./configure \
  104. --prefix=%{l_prefix} \
  105. --mandir=%{l_prefix}/man \
  106. --without-magick-plus-plus \
  107. --without-modules \
  108. --disable-shared \
  109. --with-zlib \
  110. --with-bzlib \
  111. --with-tiff \
  112. --with-jpeg \
  113. --with-jp2 \
  114. --with-png \
  115. --with-xml \
  116. --with-lcms \
  117. --with-lqr \
  118. --with-freetype \
  119. --without-fftw \
  120. --without-gvc \
  121. --without-perl \
  122. %if "%{with_x11}" == "yes"
  123. --with-x \
  124. --x-includes=`%{l_rc} --query x11_incdir` \
  125. --x-libraries=`%{l_rc} --query x11_libdir` \
  126. --without-dps \
  127. %else
  128. --without-x \
  129. %endif
  130. --without-threads
  131. %{l_make} %{l_mflags}
  132. %if "%{with_perl}" == "yes"
  133. %{l_prefix}/bin/perl-openpkg prepare
  134. %{l_prefix}/bin/perl-openpkg -d PerlMagick configure build
  135. %endif
  136. %install
  137. %{l_make} %{l_mflags} install \
  138. AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  139. %if "%{with_perl}" == "yes"
  140. %{l_prefix}/bin/perl-openpkg -d PerlMagick install
  141. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  142. %else
  143. >perl-openpkg-files
  144. %endif
  145. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  146. ( cd $RPM_BUILD_ROOT%{l_prefix} || exit 1
  147. rm -f bin/cgimagick
  148. rm -f bin/iptcutil
  149. rm -f man/man4/miff.4
  150. rm -rf share/doc >/dev/null 2>&1 || true
  151. rm -rf share/ImageMagick-* >/dev/null 2>&1 || true
  152. ) || exit $?
  153. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  154. %{l_files_std} `cat perl-openpkg-files`
  155. %files -f files
  156. %clean