imagemagick.spec 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. ##
  2. ## imagemagick.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 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.2.7
  26. %define V_minor 5
  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
  35. Distribution: OpenPKG
  36. Class: BASE
  37. Group: Graphics
  38. License: GPL
  39. Version: %{V_opkg}
  40. Release: 20060509
  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. CC="%{l_cc}" \
  96. CXX="%{l_cxx}" \
  97. CFLAGS="%{l_cflags -O} %{l_cppflags tiff}" \
  98. CPPFLAGS="%{l_cppflags tiff}" \
  99. CXXFLAGS="%{l_cxxflags -O}" \
  100. LDFLAGS="%{l_ldflags}" \
  101. LIBS="-liconv" \
  102. %{l_bash} ./configure \
  103. --prefix=%{l_prefix} \
  104. --without-magick-plus-plus \
  105. --without-modules \
  106. --disable-shared \
  107. --enable-lzw \
  108. --with-zlib \
  109. --with-bzlib \
  110. --with-tiff \
  111. --with-jpeg \
  112. --with-jp2 \
  113. --with-png \
  114. --with-ttf \
  115. --with-xml \
  116. --with-lcms \
  117. --without-perl \
  118. %if "%{with_x11}" == "yes"
  119. --with-x \
  120. --x-includes=`%{l_rc} --query x11_incdir` \
  121. --x-libraries=`%{l_rc} --query x11_libdir` \
  122. --without-dps \
  123. %else
  124. --without-x \
  125. %endif
  126. --without-threads
  127. %{l_make} %{l_mflags}
  128. %if "%{with_perl}" == "yes"
  129. %{l_prefix}/bin/perl-openpkg prepare
  130. %{l_prefix}/bin/perl-openpkg -d PerlMagick configure build
  131. %endif
  132. %install
  133. rm -rf $RPM_BUILD_ROOT
  134. %{l_make} %{l_mflags} install \
  135. AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  136. %if "%{with_perl}" == "yes"
  137. %{l_prefix}/bin/perl-openpkg -d PerlMagick install
  138. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  139. %else
  140. >perl-openpkg-files
  141. %endif
  142. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  143. ( cd $RPM_BUILD_ROOT%{l_prefix} || exit 1
  144. rm -f bin/cgimagick
  145. rm -f bin/iptcutil
  146. rm -f man/man4/miff.4
  147. rm -rf share/doc >/dev/null 2>&1 || true
  148. rm -rf share/ImageMagick-* >/dev/null 2>&1 || true
  149. ) || exit $?
  150. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  151. %{l_files_std} `cat perl-openpkg-files` \
  152. "%not %dir %{l_prefix}/lib/pkgconfig"
  153. %files -f files
  154. %clean
  155. rm -rf $RPM_BUILD_ROOT