imagemagick.spec 5.8 KB

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