imagemagick.spec 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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.4
  26. %define V_minor 7
  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: 20070609
  41. # package options
  42. %option with_perl no
  43. %option with_x11 yes
  44. # list of sources
  45. Source0: ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-%{V_dist}.tar.bz2
  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, lcms, libxml, libiconv
  52. PreReq: tiff, jpeg, jasper, bzip2, zlib, png, freetype, 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\.gz
  78. }
  79. %prep
  80. %setup -q -n ImageMagick-%{V_major}
  81. %{l_shtool} subst \
  82. -e 's/^\(MagickLibSubdir="\)[^"]*\("\)/\1imagemagick\2/' \
  83. -e 's/\(-lxml2\)/\1 -liconv/' \
  84. configure
  85. %{l_shtool} subst \
  86. -e 's;\(-L@MAGICKLIBDIR@\);-L../magick/.libs \1;g' \
  87. PerlMagick/Makefile.PL.in
  88. %{l_shtool} subst \
  89. -e 's; && !defined(HAVE_STRLCPY_PROTOTYPE);;g' \
  90. -e 's; && !defined(HAVE_VSNPRINTF_PROTOTYPE);;g' \
  91. -e 's;^#if \(defined(HAVE_STRLCPY)\);#if !\1;g' \
  92. -e 's;^#if \(defined(HAVE_VSNPRINTF)\);#if !\1;g' \
  93. magick/studio.h
  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. %{l_bash} ./configure \
  107. --prefix=%{l_prefix} \
  108. --mandir=%{l_prefix}/man \
  109. --without-magick-plus-plus \
  110. --without-modules \
  111. --disable-shared \
  112. --enable-lzw \
  113. --with-zlib \
  114. --with-bzlib \
  115. --with-tiff \
  116. --with-jpeg \
  117. --with-jp2 \
  118. --with-png \
  119. --with-ttf \
  120. --with-xml \
  121. --with-lcms \
  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. "%not %dir %{l_prefix}/lib/pkgconfig"
  159. %files -f files
  160. %clean
  161. rm -rf $RPM_BUILD_ROOT