imagemagick.spec 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. ##
  2. ## imagemagick.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 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.0.0
  27. %define V_minor 6
  28. %if "%{V_minor}" == "0"
  29. %define V_dist %{V_major}
  30. %else
  31. %define V_dist %{V_major}-%{V_minor}
  32. %endif
  33. # package information
  34. Name: imagemagick
  35. Summary: Graphic Image Conversion Tool
  36. URL: http://www.imagemagick.org/
  37. Vendor: John Cristy
  38. Packager: The OpenPKG Project
  39. Distribution: OpenPKG
  40. Class: BASE
  41. Group: Graphics
  42. License: GPL
  43. Version: %{V_major}.%{V_minor}
  44. Release: 20040427
  45. # package options
  46. %option with_perl no
  47. %option with_x11 yes
  48. # list of sources
  49. Source0: ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-%{V_dist}.tar.gz
  50. # build information
  51. Prefix: %{l_prefix}
  52. BuildRoot: %{l_buildroot}
  53. BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc
  54. PreReq: OpenPKG, openpkg >= 20040130
  55. BuildPreReq: tiff, jpeg, jasper, bzip2, zlib, png, freetype, lcms, libxml
  56. PreReq: tiff, jpeg, jasper, bzip2, zlib, png, freetype, lcms, libxml
  57. %if "%{with_perl}" == "yes"
  58. BuildPreReq: perl
  59. PreReq: perl
  60. %endif
  61. %if "%{with_x11}" == "yes"
  62. BuildPreReq: X11
  63. PreReq: X11
  64. %endif
  65. AutoReq: no
  66. AutoReqProv: no
  67. %description
  68. ImageMagick is a robust collection of tools and libraries to read,
  69. write, and manipulate an image in many image formats (over 68 major
  70. formats) including popular formats like TIFF, JPEG, PNG, PDF, Photo
  71. CD, and GIF. With ImageMagick you can create images dynamically,
  72. making it suitable for Web applications. You can also resize,
  73. rotate, sharpen, color reduce, or add special effects to an image
  74. and save your completed work in the same or differing image format.
  75. Image processing operations are available from the command line, as
  76. well as through C, C++, and PERL-based programming interfaces.
  77. %track
  78. prog imagemagick = {
  79. version = %{V_major}-%{V_minor}
  80. url = ftp://ftp.imagemagick.org/pub/ImageMagick/
  81. regex = ImageMagick-(\d+\.\d+\.\d+(-\d+)?)\.tar\.gz
  82. }
  83. %prep
  84. %setup -q -n ImageMagick-%{V_major}
  85. %{l_shtool} subst \
  86. -e 's/\([ ]*tagnames=.*echo.*tagnames,[FC][7X][7X].*\)/ if [ ".$tagnames" = . ]; then \1; fi/' \
  87. -e 's/\/magick -lMagick/\/magick\/.libs -lMagick/' \
  88. -e 's/^\(MagickLibSubdir="\)[^"]*\("\)/\1imagemagick\2/' \
  89. configure
  90. %{l_shtool} subst \
  91. -e 's;\(-L@MAGICKLIBDIR@\);-L../magick/.libs \1;g' \
  92. PerlMagick/Makefile.PL.in
  93. %build
  94. CC="%{l_cc}" \
  95. CXX="%{l_cxx}" \
  96. CFLAGS="%{l_cflags -O} %{l_cppflags tiff}" \
  97. CPPFLAGS="%{l_cppflags tiff}" \
  98. CXXFLAGS="%{l_cxxflags -O}" \
  99. LDFLAGS="%{l_ldflags}" \
  100. LIBS="-liconv" \
  101. ./configure \
  102. --prefix=%{l_prefix} \
  103. --without-magick-plus-plus \
  104. --without-modules \
  105. --disable-shared \
  106. --enable-lzw \
  107. --with-zlib \
  108. --with-bzlib \
  109. --with-tiff \
  110. --with-jpeg \
  111. --with-jp2 \
  112. --with-png \
  113. --with-ttf \
  114. --with-xml \
  115. --with-lcms \
  116. --without-perl \
  117. %if "%{with_x11}" == "yes"
  118. --with-x \
  119. --x-includes=`%{l_prefix}/etc/rc --query x11_incdir` \
  120. --x-libraries=`%{l_prefix}/etc/rc --query x11_libdir` \
  121. --without-dps \
  122. %else
  123. --without-x \
  124. %endif
  125. --without-threads
  126. %{l_make} %{l_mflags}
  127. %install
  128. rm -rf $RPM_BUILD_ROOT
  129. %{l_make} %{l_mflags} install \
  130. AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  131. %if "%{with_perl}" == "yes"
  132. %{l_prefix}/bin/perl-openpkg prepare
  133. %{l_prefix}/bin/perl-openpkg -d PerlMagick configure build install
  134. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  135. %else
  136. >perl-openpkg-files
  137. %endif
  138. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  139. ( cd $RPM_BUILD_ROOT%{l_prefix} || exit 1
  140. rm -f bin/cgimagick
  141. rm -f bin/iptcutil
  142. rm -f man/man4/miff.4
  143. rm -rf share/ImageMagick-%{V_major}/www
  144. rm -f share/ImageMagick-%{V_major}/*.txt
  145. rm -f share/ImageMagick-%{V_major}/*.html
  146. rm -rf share/ImageMagick-%{V_major}/images
  147. rmdir share/ImageMagick* >/dev/null 2>&1 || true
  148. rm -f lib/libMagick.la
  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