imagemagick.spec 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. ##
  2. ## imagemagick.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2005 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2005 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2005 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package version
  26. %define V_major 6.1.9
  27. %define V_minor 0
  28. %define V_dist %{V_major}-%{V_minor}
  29. %define V_opkg %{V_major}.%{V_minor}
  30. # package information
  31. Name: imagemagick
  32. Summary: Graphic Image Conversion Tool
  33. URL: http://www.imagemagick.org/
  34. Vendor: John Cristy
  35. Packager: The OpenPKG Project
  36. Distribution: OpenPKG
  37. Class: BASE
  38. Group: Graphics
  39. License: GPL
  40. Version: %{V_opkg}
  41. Release: 20050120
  42. # package options
  43. %option with_perl no
  44. %option with_x11 yes
  45. # list of sources
  46. Source0: ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-%{V_dist}.tar.bz2
  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
  53. PreReq: tiff, jpeg, jasper, bzip2, zlib, png, freetype, lcms, libxml
  54. %if "%{with_perl}" == "yes"
  55. BuildPreReq: perl
  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. %{l_shtool} subst \
  83. -e 's/^\(MagickLibSubdir="\)[^"]*\("\)/\1imagemagick\2/' \
  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/ImageMagick-%{V_major}/www
  148. rm -f share/ImageMagick-%{V_major}/[A-Z]*
  149. rm -f share/ImageMagick-%{V_major}/*.txt
  150. rm -f share/ImageMagick-%{V_major}/*.html
  151. rm -rf share/ImageMagick-%{V_major}/images
  152. rmdir share/ImageMagick* >/dev/null 2>&1 || true
  153. rm -f lib/libMagick.la
  154. ) || exit $?
  155. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  156. %{l_files_std} `cat perl-openpkg-files` \
  157. "%not %dir %{l_prefix}/lib/pkgconfig"
  158. %files -f files
  159. %clean
  160. rm -rf $RPM_BUILD_ROOT